Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Last active December 2, 2017 12:28
Show Gist options
  • Select an option

  • Save hishaamn/f7f09691cca55d40ff80d2d74d3417a2 to your computer and use it in GitHub Desktop.

Select an option

Save hishaamn/f7f09691cca55d40ff80d2d74d3417a2 to your computer and use it in GitHub Desktop.
Check if goal has been triggered
Guid goalId = // your goal Id
KeyBehaviorCache cache = Sitecore.Analytics.Tracker.Current.Contact.GetKeyBehaviorCache();
bool goalTriggered = cache.Goals.Any(a => a.Id == goalId);
if(!goalTriggered)
{
// continue with goal execution
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment