[英]Trigger a profile in Sitecore DMS 7.5
我在sitecore 6.5中使用以下代码触发配置文件:
var profile = Sitecore.Analytics.Tracker.CurrentVisit.GetOrCreateProfile("<Profile Name>");
profile.BeginEdit();
profile.Score("<profile key>",<profile key value you want to set>);
profile.Score("<profile key>",<profile key value you want to set>);
profile.UpdatePattern(); //sets the appropriate pattern based on the current profile keys values you have just set.
profile.EndEdit();
现在它不适用于新的dms API,您知道我应该使用什么吗?
采用
Sitecore.Analytics.Tracker.Current.Interaction.Profiles
以此目的
触发Sitecore 7.5+中的配置文件的完整代码如下:
var profile = Tracker.Current.Interaction.Profiles["yourProfile"];
var scores = new Dictionary<string, float>();
scores.Add("key1", 5);
scores.Add("key2", 10);
profile.Score(scores);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.