在Sitecore DMS 7.5中触发配置文件

时间:2015-07-08 22:45:00

标签: sitecore sitecore7 sitecore-dms sitecore7.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,你知道我应该使用什么吗?

2 个答案:

答案 0 :(得分:1)

使用

Sitecore.Analytics.Tracker.Current.Interaction.Profiles

为此目的

答案 1 :(得分:1)

在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); 
相关问题