How can I set up custom code using do_plugins to stop events firing twice

andersonjh

04-04-2020

Our shopping cart has a number of popups that, after selected, cause the page to refresh and the scView or Checkout event to reload again. For this reason, in the 5 years we've had Adobe (I'm new so not my fault haha), they've never created a path for the 6 page shopping cart. 

 

I tried to use this code to limit the shopping cart view page to once per visit or session with this:

 

s.usePlugins = true;
s.doPlugins = function() {
s.events="scView,event52";
s.events = s.getValOnce(s.events,"event52,scView")
};

 

What am I doing wrong or is there a better way?

getValOnce stop events from firing with page refresh

Accepted Solutions (0)

Answers (1)

Answers (1)

Andrey_Osadchuk

MVP

05-04-2020

Hi Anderson,

 

If the goal is to fire the mentioned events once per visit, just update the event settings in the report suite by setting Unique Event Recording to Record Once per Visit.

 

Alternatively, you may want to create an advanced calculated metric for each event to dedupe them by Visit.