Archived topic
Menu click classes not pulling through
3 replies · Started by Michael on April 19, 2022
Hi there,
I've added optional css classes to our menu but they aren't pulling through as GTM variables: https://www.goodsignals.com/
Any ideas?
Hi there,
how did you add the Class ? Was that in the Appearance > Menus ? If so those classes get added to the <li> list element not the <a> anchor so it may be the listener is only looking for links (?)
Yes, that's correct via appearance > menus. Do you know another way to add class IDs to menu items?
Its been a while but when you define the trigger is there still a config for:
Click Element -> Matches CSS Selector
If so you should be able to use that and in the 3rd field do something like:
.my-gtm-class a
Then it should target the clicked element.... i think