Expand my Community achievements bar.

SOLVED

onclick event based rule only fires once per page

Avatar

Level 1

I'm having an issue where an onclick event based rule will only execute once per page load and I need it to execute multiple times in certain instances.  Basically I created an event based rule to fire when a user clicks through any one of several information tabs on a page -- however, the rule will only execute on the first click, and not on any future clicks until the page is reloaded.

In working to debug this, I created a onclick event rule to fire on click of any header tag and can see that on some pages this rule will execute multiple times while on other pages it will only fire once. I don't see any meaningful differences between the pageload rules for pages where this works vs ones where it doesn't. 

I saw some other posts from the past where users had this same issue - but there didn't seem to be any resolutions posted. 

Has anyone had a similar issue with this and determined the cause?

thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Jese,

It's possible that some other code is preventing the click event from being emitted to the DTM code. This will happen if other click handler code uses the preventDefault() functionality or return false, which keeps the event from triggering any other listeners.

Can you please trigger the following command from console _satellite.setDebug(true) .  Debug Mode tells you what rules are firing, what rules are not firing, and lets you know what events DTM is listening for.

Thanks & Regards

Parit Mittal

View solution in original post

4 Replies

Avatar

Level 10

Hi ,

Can you please share your DTM account login credentials as wellas Test URL of the Website so that we can debug the issue at our end.

Also,Do you see any error in console when a user clicks multiple times on the tabs on a page & event based rule beacon is fired only once ?.

Thanks & Regards

Parit Mittal

Avatar

Level 1

Hi Parit, 

There are no errors in the console either on load or after one or more clicks. This issue is only present on all product pages, and I do not experience this issue on any other page types that I have found.

Unfortunately, the test URL is behind a firewall which I cannot provide access too at this time. So, I'm not sure that approach will work. I can direct you to the production version of the page - but no DTM scripts are in place there at this time, so I don't suspect that will be much help. Is there any other way to work thru this?

thanks,

Jesse 

Avatar

Correct answer by
Level 10

Hi Jese,

It's possible that some other code is preventing the click event from being emitted to the DTM code. This will happen if other click handler code uses the preventDefault() functionality or return false, which keeps the event from triggering any other listeners.

Can you please trigger the following command from console _satellite.setDebug(true) .  Debug Mode tells you what rules are firing, what rules are not firing, and lets you know what events DTM is listening for.

Thanks & Regards

Parit Mittal

Avatar

Level 10

Hi Jesse,

Did you still need assistance with this question? If not, can we mark one of Parit's answers correct in case others view this thread at a later time?

Thanks,
Jantzen