Two Ways to Use Google Analytics Better
// July 30th, 2009 // 2 Comments » // tagged: google > Technology > Tutorials > web
Google Analytics provides GREAT data straight “out of the box”… I use it for every site I build. Recently – I started doing two new things with GA.
- Tracking how effective specific ads (some regular ol’ plain text links too) were. We have a flash ad rotation on several of our sites … and I wanted to know how many people were clicking on what specific ads to get to other sections of the site. I wanted to know more than just “they came from the homepage”. I wanted to know – did they click on the Antarctica ad or the New Zealand ad? Did they click on the text link in the navigation?
- Tracking outbound links to our social medial pages … we wanted to see how many people ended up on our facebook page through what specific ads and promotions.
Both of these require a little manual effort – you have to create specific links to gather specific data.
For the first — Google calls this CAMPAIGN tracking. As in—an ad campaign. Makes sense :)
There are three things I’m keeping track of with this:
- Campaign Source (utm_source): to identify a search engine, newsletter name, or other source where your ad is going to be seen (if you have an ad in an email – you’d put the name of email here)
- Campaign Medium (utm_medium): to identify a medium such as email or cost-per- click. What type of ad is it? Banner ad, text link, or a link from an e-mail?
- Campaign Name (utm_campaign): to identify a specific product promotion or strategic campaign. What promotion is this ad part of? Free shipping?
You can use Google’s URL builder here – or of course you can manually create your links. Once you know the format – it’s just as easy to do your own.
So for instance, let’s say I had an ad for football tickets that I placed in an email newsletter. The URL to the event was:
a href=”http://www.mydomain.com/sportingevent.html”
In order to track the data for that specific URL – I would change that link used in the email newsletter to be something like this:
a href=”http://www.mydomain.com/sportingevent.html?utm_source=july2009newsletter&utm_medium=email&utm_campaign=VUfootball09262009″
To view your analytics for these links:
- Login to Google Analytics
- In the left side-bar, select Traffic Sources.
- Then click on Campaigns.
- Select the Campaign Name you want to track. This is the Campaign Name you designated when tagging the ad URL above.
For the second – tracking our outbound links, we’re going to do a little javascript-ery-trickery to get what we want.
Without this – it’s pretty much impossible to track how people are getting to our social media sites. Those sites don’t live on our servers – so we can’t put the GA code on them. We could track how many people click on a link on a specific page on our servers – but that gets kind of clunky tracking-wise.
So – what’s the best way to track which external links are popular with your site visitors?
(There is a javascript “addon” that will track this information (available here) — it will track external links and file downloads. Simply install the code right above the GA code on all your pages – and wala. You don’t have to manually edit each link.)
Here is how I prefer to track this information.
Our link starts out like this:
a href=”http://www.externalwebsiteurl.com/”
To track it … we’ll turn it into this:
a href=”http://www.externalwebsiteurl.com” onClick=”javascript: pageTracker._trackPageview(‘/outgoing/externalwebsiteurl.com‘);”
(you could make outgoing anything you want … but decide on a standard so that you can easily pull this data)
View the number of clicks to the externalwebsiteurl.com from your own website by
- Login to Google Analytics
- In the left side-bar, select Content.
- filter the urls by putting “outgoing” in the filter box.
- You’ll see the data for your tagged outgoing links here!
You could also use this for tracking file downloads. Just change the /outgoing/ part to /downloads/ or something.
original url:
a href=”http://www.mydomain.com/assets/How-To-Waggle.pdf”
altered, google analytics tracking url:
a href=”http://www.mydomain.com/assets/How-To-Waggle.pdf” onClick=”javascript: pageTracker._trackPageview(’/downloads/WaggleHowTo’);”
