eHow launches Android app: Get the best of eHow on the go.

How To

How to Track Links in Google Analytics

Contributor
By eHow Contributing Writer
(3 Ratings)

Google Analytics allows you to track how often viewers on your website click particular links on your website. Links to internal pages are automatically tracked, however you must add JavaScript code to links that point to pages outside of your own website in order to track them.

Difficulty: Easy
Instructions
  1. Step 1

    Set up the links you wish to track. Add JavaScript code to each link you wish to track, so picking only the links you really care about saves effort.

  2. Step 2

    Open the web pages with the links in your web page editing software. Locate the link you would like to track.

  3. Step 3

    Add the following JavaScript into your "A HREF" tag, before any other code used by Google Analytics:
    <br>onClick="javascript: pageTracker._trackPageview('/outgoing/sample.com');"<br>
    Change the portion in the parentheses to the location you would like to have listed in your tracking report.

  4. Step 4

    Save the web page file. Upload it to your website.

  5. Step 5

    Verify that your links are being tracked by checking your log in Google Analytics after a day or two. Your links appear in the "Top Content" report. The links you added tracking code to should now appear in the report.

Tips & Warnings
  • Be aware that the directory specified in your code (in this example, /outgoing/sample.com) is how your link will be logged. Consider creating a logical directory structure for your links so that you can review the links more easily.
  • If you are not using the most recent version of Google Analytics, this code may not work for you. Read the help information provided for your version of Google Analytics to find out how to track links in the version you are using.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics