Track outgoing links with Google Analytics and jQueryTrack outgoing links with Google Analytics and jQuery

Posted August 4th, 2010 in Javascript and Offsite Articles

Neal Grosskopf posted "Tracking Outgoing Links in Google Analytics Using Event Tracking and jQuery" which looks at the correct way to track outgoing links compared with the incorrect way people often post which suggests to track them as pageviews.

The article

In the article, Neal looks at:

  • The Old and Wrong Way
  • The Right and New Way
  • Dissecting pageTracker._trackEvent
  • How the Data Looks in Google Analytics

and then posts a link to the official documentation, which is here. Read Neal's full post here.

My comments

The post uses jQuery but you obviously don't have to use jQuery. If you are not already using jQuery in your project then it may not necessarily be advisable to include jQuery just to use this code; you can modify it to suit the framework you already use, or use traditional onClick="" style event handlers.

And secondly, the post uses the old style non-async tracker as pointed out by the first comment on the page. That comment also shows the code to use to track it using the new async tracker.

Comments

blog comments powered by Disqus