Inserting Onclick Into previous_post_link and next_post_link
-
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
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Inserting Onclick Into previous_post_link and next_post_link’ is closed to new replies.