Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

onclick event based rule only fires once per page

jdkasen
Level 1
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
ParitMittal
Correct answer by
Level 10
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
ParitMittal
Level 10
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

jdkasen
Level 1
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 

ParitMittal
Correct answer by
Level 10
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

jantzen_belliston-Adobe
Community Manager
Community Manager

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