Meta Google Analytics in menu

SupportCategory: TA PlutonMeta Google Analytics in menu
Fabrica Staff asked 3 years ago
Good afternoon.
I'm sorry my bad English.
I must be included in each menu button, ta-pluton theme, google analytics code. Which script should I include these codes, because the menu is generated dynamically?

Follow the Google Analytics code:

Home Menu = onclick="ga('send','event','click','home');"

Services Menu = onclick="ga('send','event','click','servico');"

I have to do this in all menus site

Thank you and I'm waiting.
1 Answers
Rohit Staff answered 3 years ago

Hi Fabrica, the menu links are managed by the core of WordPress, not the theme. Now WordPress do not support add event to menu links. What you want to do is hacking the core function of WordPress menus. I’m afraid a theme can not do that. You can try to search a plugin for this function. Thanks!