Don't send event if the eVarX value is the same as last time | Community
Skip to main content
Level 4
July 19, 2021
Solved

Don't send event if the eVarX value is the same as last time

  • July 19, 2021
  • 1 reply
  • 2029 views

Hey Community.
I'm currently looking for a look alike of getValOnce functionality.

Context: 
When my users are processing an internal search, an event1 is being triggered once he land on search page results. If the user click on a product page, and then go back to the search page results the event1 will be trigger again.


My question is the following:
Is there any way to not send an event (here the event1) a second time if the keyword (eVarX) value hasn't changed since last time?

 

Thanks a lot for your help here.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuhuisg

You could set a flag in sessionStorage or localStorage when event1 occurs. Then, you can read that back with a data element as a condition for whether you want to track event1 again.

1 reply

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
July 20, 2021

You could set a flag in sessionStorage or localStorage when event1 occurs. Then, you can read that back with a data element as a condition for whether you want to track event1 again.

Swanan_Author
Level 4
July 20, 2021
Hey Yushuisg,