我们想要匹配游客与模式卡的基础上,他们已经进行了所有的访问,而不仅仅是目前的访问。分段生成器规则“匹配模式”是:
where the visitor matches the [PatternName,Pattern,selectprofilefirst=1&resulttype=Name,specific] pattern card in the [ProfileName,Profile,resulttype=Name,specific] profile这是从
Sitecore.Analytics.Rules.SegmentBuilder.Conditions.HasPatternCondition,Sitecore.SegmentBuilder是否可以将其添加到页面编辑器可以为组件选择的可用个性化规则中,并在运行时对其进行评估?
Sitecore.NET 7.2 (修订版140526)
发布于 2014-12-20 22:37:25
分段生成器规则的设计是为了根据您的标准匹配大量现有访问者的集合。如果检查任何分段生成器条件下的代码,您将看到它们构建了一个子句,该子句最终将针对访问者表执行。
关于OOTB条件呈现规则仅匹配当前访问的模式卡,您是正确的。谢天谢地,很容易将该规则扩展到包括所有访问的概要文件:
using Sitecore.Analytics;
using Sitecore.Analytics.Data.DataAccess;
using Sitecore.Analytics.Rules.Conditions;
using Sitecore.Rules;
namespace MyProject.Web.Analytics.Rules.Conditions.Patterns
{
public class VisitorHasPatternCondition<T> : HasPatternCondition<T> where T : RuleContext
{
protected override bool Execute(T ruleContext)
{
// Load all profiles into current dataset
Tracker.Visitor.LoadAll(VisitLoadOptions.Profiles, VisitorOptions.None);
return base.Execute(ruleContext);
}
}
}LoadAll()方法将把访问者的所有配置文件加载到当前的DataSet中。然后,我们调用基本的Execute()方法,它检查匹配模式卡的DataSet。
https://stackoverflow.com/questions/27565375
复制相似问题