Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.