JeremyEnglert / JointsWP-CSS

A blank WordPress theme built with Foundation 6, giving you all the power and flexibility you need to build complex, mobile friendly websites without having to start from scratch.
http://jointswp.com
75 stars 23 forks source link

JointsWP - Adding analytics tracking code to top nav help #21

Open fusiongt opened 7 years ago

fusiongt commented 7 years ago

I was hoping someone could help me add analytics tracking code to the top nav. I've looked at the functions/menu.php file but it only addressed the <ul> portion and not the <li><a> portion that I need to add the tracking code to.

For example, I'd like something like this: <li><a href="/gallery" onClick="ga('send', 'event', 'TopNav', 'Click', 'Gallery');">Gallery</a></li>

Then of course I'd like Gallery to change to Homepage, News, etc depending on what the link was pointing to.

Any solutions would be really helpful! Thank you.

(PS: Love JointsWP, I've been using it for developing sites like http://marketstreetprototyping.org/, http://groundplaysf.org, http://www.rentsfnow.com (redesign coming) - definitely my go-to wordpress theme!!)