Last active
December 2, 2017 12:28
-
-
Save hishaamn/f7f09691cca55d40ff80d2d74d3417a2 to your computer and use it in GitHub Desktop.
Check if goal has been triggered
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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