简体   繁体   中英

Track menu link clicks in Wordpress with Google Tag Manager?

I would like to track how many people click on a link in the menu bar and where did they come from. Is there a way to do it? I see that in Wordpress there is a class called menu-item, but I don't know how this would help me.

Thanks in advance.

Google Analytics will track where users come from by default. Because of this, you only need to create an event to fire on the click class: menu-item.

After setting up event tracking, navigate to Behaviour -> Events -> Top Events. Once at this page, search for the naming of the event you created, and then select a secondary dimension such as Default Channel Grouping, Source/Medium, or whatever is relevant to your needs.

1) You need to create universal event tag. In fields to set, choose variable refferer and as value select {{refferer}} .

2) Create "click classes" variable with value: gtm.elementClasses

3) Create trigger of "Click - All Elements" type. Select "some clicks" and fill it with: {{click classes}} equals menu-item .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM