0

I plan to track when a user clicks on a navigation menu buttons, the buttons are "Team" and "Career" banner buttons to be exact, however, I don't want to track the "Contact Us" button.

All three buttons are identified with a unique id in CSS on my page

div id ='team'
div id ='career'
div id ='contactus'

They are all nested under the parent

class div class="navigation"

In DTM I am using the Element Tag or Selector CSS selector to try and get my tracking to work, however, I can never get the rule to fire, most likely because my conditions are not met.

My conditions are:

Event type: Click

div#team.div#career:not(div.navigation)

Is this wrong? how else can I select the correct CSS for my rule to trigger?.

I have also tried: div.navigation,:not(div"contactus)

Does anyone have any pointers?

  • Yes, that is wrong on multiple levels. `#team, #career` would be the most obvious thing to try - IDs must be unique within an HTML document, and assuming that you are not using those IDs elsewhere on different elements, that should be enough already. If you needed to specifically select elements with these IDs inside the navigation container only (because maybe on other pages, these IDs are used for something else), something like `.navigation #team, .navigation #career` should do it then. – 04FS Jun 03 '19 at 11:42
  • Thank you, this makes more sense to me now. I'll test it out shortly in DTM. Thanks for the super helpful advice. – Logicpro8_user Jun 04 '19 at 17:15

0 Answers0