Search code examples
sitecoresitecore-dms

How do I trigger a profile in Sitecore DMS?


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?

I've looked at relevant documentation on SDN (http://sdn.sitecore.net/Reference/Sitecore 6/DMS Documentation.aspx), but so far haven't found a way.

EDIT: Raised this on Sitecore Support Portal - will post an answer once I find out more.


Solution

  • 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 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();
    

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