How do I trigger a profile in Sitecore DMS?

后端 未结 2 1213
孤城傲影
孤城傲影 2021-01-06 14:48

I am looking for a way to allow visitors to select what content they want displayed on the site.

Is there a way to programatically trigger a profile in Sitecore DMS?

2条回答
  •  逝去的感伤
    2021-01-06 15:32

    I have received a response from Sitecore support on this question. Here it is:

    "If you are using pattern cards for personalzation, then you can use the following code as the event handler for "item selected" event for the dropdown list:"

    var profile = Sitecore.Analytics.Tracker.CurrentVisit.GetOrCreateProfile("");
    profile.BeginEdit();
    profile.Score("",);
    profile.Score("",);
    profile.UpdatePattern(); //sets the appropriate pattern based on the current profile keys values you have just set.
    profile.EndEdit();
    

    This interferes with automatic profile matching, so I am not sure I want to use this approach.

提交回复
热议问题