Offsite Tracking in Google Analytics

Published on 13 Oct 2013 at 9:04 pm.
Filed under Google,Marketing,Search Engine Optimization.

Are you interested in adding offsite tracking to your Google Analytics reports? Here is how you can make any link a page in your reports.

Why you should use offsite tracking

First let me start off by explaining what I mean by offsite tracking. By default Google Analytics will only show you information on pages on your site. Those are two important distinctions that I hope are clear. They are only showing you information on pages, and they are only showing you information about your site. This makes sense for a number of reasons:

  • Google cannot know that a link to page on another domain is one that they should associate with your site.
  • It is the other domain owner’s right to have information on their own domain.
  • Non-pages, such as PDF files, hosted on your site cannot run Google Analytics.

But sometimes you’re going to have links that don’t fit this criteria that are just as important as any page on your site. A link to your Facebook page is no less important to your brand than your About Us page. It might even be more important. You’re probably displaying it in the header or footer of your site. Why not include it in your reports?

You might also have a call to action on your site that directs the user to a non-web page. On the mobile website for Trinity Home Renovations we include a click to call button. Earlier this week I added code to track when a user clicked on this button. Clicking this button merely brings up the dial pad which we can track. We cannot know if the user made a call, but it is nice to know they got to the point where they considered making a call.

I tested this code in various mobile browsers and then loaded Google Analytics to view the report.

Mobile browser support for offsite tracking a link in Google Analytics.

Google Analytics can report the number of clicks on a “click to call” button on a mobile website.

Google Analytics successfully reported the clicks from every mobile browser, except Opera Mini. Given the low usage volume for Opera Mini this not much of a concern.

How to configure offsite tracking

It is very easy to configure offsite tracking for a link on your site. Suppose you wanted to link to your Facebook page. The HTML code for that would look like:

<a href="">Visit us on Facebook</a>

You would simply need to add an onclick attribute that tells Google Analytics to record the click as a page, and to give that page a name. It would look like:

<a href="" onclick="_gaq.push(['_trackPageview','/FacebookPage']);">Visit us on Facebook</a>

In this example I gave the link the page name “/FacebookPage”. I included the “/” so that the page name looks like every other page in Google Analytics. I’d recommend avoiding spaces in the page name. I’m not sure what would happen and it’s very bad practice to have spaces in your URLs anyways.

That’s all you need to do . Just add a bit of code and you are now tracking clicks on offsite pages from your website.

This post was originally published as Offsite Tracking in Google Analytics for Brand Builder Websites.

Comments are closed.