3

I want to prevent goal from triggering multiple times.

What should I do?

Any suggest?

Thank you.

I tried:

The rule doesn't work!

The rule doesn't work!

  • Mark Cassidy answered on the same question here – Andrei Paliakou Nov 16 '17 at 9:06
  • you mean trigger one goal for one contact one time ? – Vlad Iobagiu Nov 16 '17 at 9:32
  • @SitecoreClimber Yes.No matter how to refresh the page, It only add up the engagement value one time for the contact. – Gray Nov 17 '17 at 0:16
  • @AndreiPaliakou Thank you for your reply. Does I have to create a Engagement Plan? – Gray Nov 17 '17 at 0:29
3

Assumption

Once the goal has been triggered by a visitor, the visitor cannot trigger the same goal.

Solution

If you are triggering the goal programmatically, you can check if the user has already trigger the goal. The below snippet can be used to check if the 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 the goal is being triggered via rules, implement a new rule to perform the check if the goal has been triggered.

Moreover, if you are using Outcomes, you can change the above code to check if the user is already assigned a specific outcome.

Guid outcomeId= // your outcome ID
KeyBehaviorCache cache = Sitecore.Analytics.Tracker.Current.Contact.GetKeyBehaviorCache();
bool isAssociatedOutcome = cache.Outcomes.Any(a => a.Id == outcomeId);
| improve this answer | |
  • 1
    I know this is an old answer, but it would be nice to have an updated answer with how to accomplish the same in Sitecore 9, as KeyBehaviorCache has been deprecated. – GTHvidsten Jan 11 '19 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.