I´m using the Salient Multipurpose theme and want to track clicks in my top navigation menu through Google Tag Manager.
A normal way of doing this would be to set up a trigger based on «click classes» seen in GTM debug preview mode. However, my site navigation does not seem to have any «click classes» as all I see is " ".
How can I add a click class to the top navigation menu?
I forgot to mention I´d already tried this. Still didn´t show up any of the classes I added that way. Don´t know if I need to give it some time to show or not. I only tried immediately after putting in the css classes.
Ok, will try that, but one question first, and probably a stupid one. Is there anything more to it than writing i.e. «About» in the CSS class for my «About» menu item?
Thanks a lot Tahir. Adding the attached code to functions.php enabled GTM to fetch the click classes from my WP installation, and me to get the common identificator for my trigger.
I´m using the Salient Multipurpose theme and want to track clicks in my top navigation menu through Google Tag Manager.
A normal way of doing this would be to set up a trigger based on «click classes» seen in GTM debug preview mode. However, my site navigation does not seem to have any «click classes» as all I see is " ".
How can I add a click class to the top navigation menu?
Hey arnestad ,
Thanks for reaching out! .
You can add the Classes in here:
Let me know if this helps! Happy to assist further if needed.
Best,
ThemeNectar Support Team
Thanks for trying to help Tahir.
I forgot to mention I´d already tried this. Still didn´t show up any of the classes I added that way. Don´t know if I need to give it some time to show or not. I only tried immediately after putting in the css classes.
Hey Again,
Try to clear your cache using this guide: https://themenectar.ticksy.com/article/6226/ .
Let me know if this helps! Happy to assist further if needed.
Best,
ThemeNectar Support Team
Ok, will try that, but one question first, and probably a stupid one. Is there anything more to it than writing i.e. «About» in the CSS class for my «About» menu item?
Flushed the wordpress cache with my One.com plugin, did another test, but still shows up empty.
Attached files: Screenshot 2024-10-18 at 14.51.55.png
Screenshot 2024-10-18 at 14.53.39.png
Hey Again,
This should help: https://wordpress.stackexchange.com/questions/108092/adding-different-classes-to-anchor-in-navigation-menu
Let me know if this helps! Happy to assist further if needed.
Best,
ThemeNectar Support Team
Thanks a lot Tahir. Adding the attached code to functions.php enabled GTM to fetch the click classes from my WP installation, and me to get the common identificator for my trigger.
Thanks for your patience and help.
Attached files: Screenshot 2024-10-21 at 12.45.41.png