Tracking an external link as a goal in Google Analytics

3 replies
  • SEO
  • |
Im trying to decipher this help article on google its not making much sense to me

Tracking an external link as a goal - Analytics Help

For example, to log every click on a particular link to IANA — Example domains as a pageview for /G1/example.com you would add the following attribute to the link's tag:

<a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview("/G1/example.com");">
i want to do this for my amazon links, but i just dont get what "/G1/example.com" should be??
#analytics #external #goal #google #link #tracking
  • Profile picture of the author mgreener
    Hi,

    So to adapt this example to your Amazon links. Let's say that one of your links is to a 64GB iPad 2 and one of the links is to a Kindle.

    In order to track, you would setup links with identifiers such as:

    <a href="http://www.affiliatelinkgoeshere" onClick="javascript: pageTracker._trackPageview("/amazon.com/ipad64gb");">


    <a href="http://www.affiliatelinkgoeshere" onClick="javascript: pageTracker._trackPageview("/amazon.com/kindle");">

    In other words, the "/G1/example.com" can be whatever you want it to be and will show up in analytics as being clicked on. So be sure to make each something that you will understand when looking at your stats.
    {{ DiscussionBoard.errors[5272717].message }}
    • Originally Posted by mgreener View Post

      Hi,

      So to adapt this example to your Amazon links. Let's say that one of your links is to a 64GB iPad 2 and one of the links is to a Kindle.

      In order to track, you would setup links with identifiers such as:

      <a href="http://www.affiliatelinkgoeshere" onClick="javascript: pageTracker._trackPageview("/amazon.com/ipad64gb");">


      <a href="http://www.affiliatelinkgoeshere" onClick="javascript: pageTracker._trackPageview("/amazon.com/kindle");">

      In other words, the "/G1/example.com" can be whatever you want it to be and will show up in analytics as being clicked on. So be sure to make each something that you will understand when looking at your stats.
      thankyou very much for clearing that up, it makes sense now

      im wondering, do you think i could use my prettylink url instead of the full amazon link?

      that way i can track my goals in GA and also check out clicks on PrettyLink
      {{ DiscussionBoard.errors[5272854].message }}
  • Profile picture of the author KirkMcD
    ("/G1/example.com")
    You can put what ever you want in the quotes, but it needs to look like a URL. It is NOT used for the actual link, but only to track the click.
    {{ DiscussionBoard.errors[5273033].message }}

Trending Topics