Hey everyone,
I’ve started using onclick push data to Google Analytics to get a better idea of how visitors are navigating through my site. It’s going great except I’ve hit a snag tracking clicks on next and previous post links, as I can’t figure out how to insert the onclick code into the actual next and previous post links. Does anyone know how to do this?
For example, I need to insert:
onclick="_gaq.push(['_trackEvent', 'Next Page']);"
Into a href=”next post”, so that it looks like
a href="next post"
onclick=”_gaq.push([‘_trackEvent’, ‘Next Page’]);”`
Thanks!
-Alec