Asynchronous code enhancement for Outbound Link Tracking Google Analytics

by Suketu Parikh on December 22, 2011

in analytics,Resources

You all are aware of “Update to Brian Clifton’s Outbound Link Tracking Code” post

I would like to update that script for Asynchronous Google Analytics Implementation, which is available here

It will serve four purposes:

  1. External Link Tracking: To track all links on your webpage which are external links i.e. sub-domain or 3rd party domain links.
  2. Email Link Tracking: To track all links which are “mailto” links.
  3. Document Download Tracking: Track all documents which ending with .jpg, .doc, .docx, .xls, .zip, .pdf etc. (you can change according to your need in the code).
  4. Time Tracking: It will also track how much time later user clicked on the link.

All you have to include the code just before the </head> tag in your website.

<script language="javascript" type="text/javascript" src="/external_link_tracking.js" ></script>

Note: This script requires JQuery library to work. Please comment if you need such library for any other JavaScript framework like Mootools or Prototype.

Liked this? Get more by Signing up for our free newsletter!

Would you like to understand the value of predictive analysis when applied on web analytics data to help improve your understanding relationship between different variables? So register now for our Upcoming Webinar: How to perform predictive analysis on your web analytics tool data. Get More Info & Book Your Seat Now!

Suketu Parikh

Suketu Parikh

Suketu Parikh working with Tatvic as Tech Lead., have more than 5 years of experience as developer. Google Plus Profile: Suketu Parikh

Twitter - More Posts

  • Sam

    Does it work with a right-click on the link ??

    • http://www.tatvic.com Suketu Parikh

      Yes, If user right clicks and opens in a new tab/window.

  • http://www.facebook.com/charmis.pala Charmis Pala

    Hello Team (Tatvic)Can you help me with the full script, for tracking out bound links.i also need the J script library for the same.

    • http://www.tatvic.com Suketu Parikh

      Sure Charmis.
      Please include
      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
      in section before google analytics code
      and you can download the outbound link tracking script just before the section on all your pages.

      Let me know the url, if you want me to look over the implementation.

      Regards,
      Suketu Parikh

    • http://www.tatvic.com Suketu Parikh

      Sure Charmis.

      Please include
      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
      in section before google analytics code
      and follow the above instructions to include external link tracking script on all your pages.

      Let me know the url where you want to implement this script so i can take a look at the implementation.

      Regards,
      Suketu Parikh

  • http://www.facebook.com/craig.sander Craig Sander

    Hi, thanks for this!

    I’ve installed it all, but where in Analytics should I see results? Content? Events? Special reports? 

    Thanks again!

    • http://www.tatvic.com Suketu Parikh

      Hi Craig, Thanks for using. You would be able to see it under content -> events section.
      Note: Generally it takes 2-4 hours for data to appear.

      Regards,

      Suketu Parikh

Previous post:

Next post: