Tutorial - Track Online or Offline Link Clicks

by yukon Banned
2 replies
  • SEO
  • |
Here's how to track inbound hashtag link/keyword clicks & get that data shown in GA (Google Analytic).

Steps:

1) Add this code snippet (below) to the GA code that's on your webpage <head> HTML source code.

Code:
_gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);
The old default GA code should look something like this (below):

Code:
_gaq.push(['_trackPageview');
2) Now you can add anything you want to the end of any URL on your site that is running the GA tracking code.

Example, you can track one individual webpage with multiple external or internal links:
  • hxxp://domain.com/favorite-ice-cream/#vanilla
  • hxxp://domain.com/favorite-ice-cream/#chocolate
  • hxxp://domain.com/favorite-ice-cream/#strawberry

3) The way to view the GA data inside GA is to go to the Content Drilldown page:
  • Behavior > Content Drilldown > click whatever page your looking for

You have to click the page links inside Content Drilldown, that's where all the hashtag data will be (ex: #vanilla, #chocolate, #strawberry, etc...).



Notes:
The hashtag link doesn't even have to exist on the internet. If I type the hashtag/keyword link in my browser & hit enter, GA will still track the hashtag/keyword because I searched with a hashtag URL & landed on my webpage that includes the GA tracking code that's looking for hashtags.

You should be able to track anything you want as long as traffic lands on a webpage that includes the GA code.

Example:
  • Track link clicks inside pdf files on an offline PC desktop.
  • Track internet shortcut icon clicks from a file that's been downloaded to an offline PC desktop.
  • Track multiple links inside a single email newsletter with all the links pointing to a single sales page (ex: header link, image link, content link, footer link, Buy Now link, etc...).

Here's a tutorial on the subject, he has some extra steps in there compared to what I do, still it's a good reference.

There's other ways to track clicks with GA (ex: Events) but they usually force you to wrap the hyperlink with custom GA code. This way it's simply one line of code in the <head> of the landing pages HTML source code & you can track any link that exist, online or offline.
#clicks #link #offline #online #track #tutorial
  • Profile picture of the author yukon
    Banned
    Here's how to expand on tracking hashtag URL clicks with Google Analytics.

    This example is about tracking clicks directly on Google SERPs If you have hashtag jump links below the SERP description (ex: domain.com/ford#mustang).

    Here's a real example where Wikipedia could easily track all their individual keyword anchor-text clicks in Google SERPs.






    Here's the Wikipedia jump link URLs for the Google Sitelinks:
    • hxxp://en.wikipedia.org/wiki/Timeline_of_motor_vehicle_brands#Veteran_era
    • hxxp://en.wikipedia.org/wiki/Timeline_of_motor_vehicle_brands#Brass_era
    • hxxp://en.wikipedia.org/wiki/Timeline_of_motor_vehicle_brands#Vintage_era
    • hxxp://en.wikipedia.org/wiki/Timeline_of_motor_vehicle_brands#Pre-war_years

    So now I could track all the Google Sitelink (jump links) clicks & sort that data to see which keyword anchor-text search traffic is clicking the most. Here's the matching Google Sitelink anchor-text which could easily be money keywords:
    • ‎Veteran era
    • Brass era
    • Vintage era
    • ‎Pre-war years

    In the Wikipedia screenshot above all 5 SERP links (1 title + 4 jump links) could be tracked individually per page.
    {{ DiscussionBoard.errors[9213867].message }}
    • Profile picture of the author nest28
      Haven't been active here in months, but logged in just to say thank you. Great post.
      {{ DiscussionBoard.errors[9214149].message }}

Trending Topics