Mobile app version of vmapp.org
Login or Join
Phylliss660

: How to restrict Google Tag Manager click events to fire only when in a specific area of the page? I'm using Google Tag Manager to track click events. These events are contained within a certain

@Phylliss660

Posted in: #GoogleAnalytics #GoogleTagManager

I'm using Google Tag Manager to track click events.

These events are contained within a certain section of the site - within a div class="splash-slide-content"

This div is not the parent div, from inspect element it looks like the grand parent.

What would be the best method of restricting the firing of this event? I'd like to create a new macro along the lines of something like: New macro "ancestor element" > ancestor class contains "splash-slide-content".

Then I could create a rule that says only fire if ancestor class contains "some string" (in this case "splash-slide-content")

Put another way, is there a way to specify "only fire this tag if it has an ancestor with class "splash-slide-content"?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

Although an old question, in case someone is looking for the answer:


Simply replace the div with the clicked element of choice (span,p,li,etc.).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme