0

It is totaly in caos. The trigger is always fired when I click on any element. But I am sure I setup the trigger setting on particular element.

enter image description here

This is extremely weierd. Does someone tell me why it happens, and what is the problem with ?

Takeo Nishioka
  • 369
  • 2
  • 11

2 Answers2

0

There is (almost) no problem, that's just how GTM works. The event listener is not bound to the element, but to the document, and waits for the event to bubble up.

So the click is triggered on every element, goes up the DOM tree and when it arrives at the document GTM checks if the target element matches the filter you have configured in your trigger.

This is not really a problem until it comes to debugging in GTM preview mode, because then every click will produce an entry in the preview pane and it gets crowded pretty fast.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
0

If it is gtm.click then it should be just fine . I attached a screen shot here . If you see the something like this when you click any where on the page then it is fine . Gtm automaticlly trigger this event when you implement any onclick trigger gtm

GTM Guy
  • 46
  • 5