Google PlusFacebook iconTwitter icon+44 113 260 4010 contact@branded3.com

Google Analytics: How to track all your outgoing links the easy way

One of the common questions asked following my posts about Google Analytics was “How can I track the traffic to external links without adding the onClick code to each and every link?”

With a bit of searching I found a script that you can place in the header file at the top of each of your pages (you might need to edit the templates if you run WordPress). The script tracks clicks to external links and reports them in Google Analytics. You need to filter the results in the “Top Content” tab to show page views for “outgoinglink” to get the pages to show.

You can find the script here.

Let me know how it works out for you.

thanks to SEO agencies and digital agencies for the help on this.

BY Patrick Altoft AT 9:25am ON Wednesday, 20 June 2007

Patrick Altoft is Director of Search at Branded3 and has worked in the SEO industry for over 10 years. With experience across some of the worlds largest brands as well as startup businesses Patrick is well known in the industry and speaks regularly at the major SEO conferences and events. Follow Patrick on Twitter or Google+

Comments

  • http://buildingtheergonomicguitar.com Robert Irizarry

    Good stuff. Just a heads up for WordPress users that the plugin Ultimate Google Analytics also tracks outgoing links as part of its functionality. I wonder how different the actual code implementation is?

  • http://blogstorm.co.uk Patrick Altoft

    Thanks Robert. Here is the link:
    Ultimate Google Analytics

  • http://destyonline.com Desty

    I put my code in the sidebar since every page calls the sidebar, except for the actual ‘pages’ posts.

  • http://planetapex.blogspot.com Planet Apex

    Thanks. very useful

  • http://patel1402.wordpress.com/ seo

    I have placed this script before closing head tag. But I was not able to find outbound link report.

  • Ethan Williams

    Looks like you can use each link’s onclick event to do this:

    http://techoctave.com/c7/posts/58-entourage-js-automatic-download-tracking-for-asynchronous-google-analytics

    That decreases the file size. Also the onclick event is standard so you don’t have to tackle the cross-browser issues found in native event attaching: