January 2, 2017

Track contact Sitecore goal execution

How can we track a contact has executed a specific goal or not ? To track goal execution we have GetKeyBehaviorCache() method.

Guid
goalReadId = new Guid("Goal GUID"
);
Sitecore.Analytics.Tracking.
KeyBehaviorCache cacheGoal = Sitecore.Analytics.Tracker
.Current.Contact.GetKeyBehaviorCache();
bool
goalBlogTriggered = cacheGoal.Goals.Any(G => G.Id == goalReadId);

No comments:

Post a Comment