Google Analytics is much more robust than most people give it credit for. Contrary to popular belief, it can do most of the things more advanced analytics suites can do, except Google does it for free.
Many web designers and developers complain about the limitations of Google Analytics. At first glance, it doesn’t seem as powerful as some of the other web analytics suites out there because it doesn’t let you track outbound links or see data in real time. So, developers flock to premium products like Clicky and Mint, but those services can be expensive, especially if your web project isn’t generating any income yet. Also, while they fix some of the limitations inherent in Google Analytics, they lack some of the Google-only tie-in features, such as Adwords and Adsense tracking.
But, that only scratches the surface: it also allows you to create specific campaigns, goals, funnels, and reports that builds actionable data-sets and provides key insight into otherwise nebulous data. Most people have analytics set up, but a lot of them fail to dig into the data and miss golden opportunities to optimize their site. Every time you change the copy, structure, or design of your website, your web analytics suite will tell you what you should change (and whether you should make any changes in the first place). By using the advanced features in Google Analytics, not only will you obliterate most of the reasons for paying for another analytics service, but you will understand your audience and your website in ways that your competitors on the web often won’t.
Here are six advanced features you can use to power up Google Analytics and turbocharge data-driven decisions:
1. Figure Out Where Your Audience is Going By Tracking Outbound Links
Even if your bounce rate is low, it is still key to understand where your visitors are going when they exit your page. By understanding the outbound link behavior of your users, you can optimize your website for conversion and your brand messaging for strategically maximum effect. This is true for two reasons.
First, many web business models rely on driving traffic to a page that is located on a different domain. A good example of this is affiliate programs where you have to drive traffic to a landing page to make money. If you track the behavior of that outbound link, you’ll know which domains convert the best. Paired with an 80-20 work ethic, you can then focus all of your marketing efforts on those media channels, and reserve your new found free time to test out new ideas, perform freelance work, or take a nap.
Second, by tracking outbound links, you’ll know which spots on your page convert the best, and then you can plan according as to which links you want to put in that prime position. For instance, you might want to remove a low value link and replace it with a link to your best content, or to an outside blogger who has helped you significantly. If you find that none of your inbound or outbound links are converting well, you can easily pair up Google Analytics with Google Website Optimizer to do some split testing.
Now that I’ve convinced you to track outbound links, here’s a crash course in how to do it. If you’re using a custom-made CMS or web app, the best way to do it is to stick the following code into the
<head> portion of your page:
This will delay links from loading by fraction of a second, giving Analytics time to record the click before the user leaves the page. Thankfully, the delay is so small that it won’t affect the user experience, so you need not worry. Then, you can track any link you want by adding the following onClick function to the links you want to track:
<a href="http://www.example.com" onClick="recordOutboundLink(this, 'Outbound Links', 'example.com'); return false;">
There are two parameters in
recordOutboundLink that you might want to change to further customize your report. The second parameter, which has the value of
Outbound Links in the example above, refers to the folders that will be used to organize your data when you view it in Google Analytics. Renaming Outbound Links is a good first start, but it isn’t descriptive enough to properly segment all of the data you’re going to collect. A better way might be to classify outbound links by type: either “blog,” “landing page,” or “social media.” Or, you can do it by the position on the page: “top,” “sidebar,” or “bottom.” The third parameter in the list is the individual identifier of the page. The truncated domain is a perfectly sane value for this, but you could also rename it to something more memorable if you would like, such as “Hongkiat” or “Facebook.”
Outbound link tracking is even easier to implement if you’re using a popular CMS or web framework. If you’re using WordPress, you can track links automatically with the Slimstat Analytics plugin. On Rails, you can bake this into your models with the Google Analytics Gem.
2. Get Real Time Statistics (Kind of)
One of the main reasons why people use something other than Google Analytics is because they want built-in real time statistics. And they’re right when they complain about how Google Analytics can’t do that. But you can use a simple trick to get almost up-to-the-minute statistics without shelling out cash for a premium service. Google updates your statistics on an hourly basis. To get that data, all you need to do is click on the date selector calendar in your Analytics report, and select the current date as the end date. Of course, this data isn’t completely up-to-date, but up to the hour is likely close enough to take fast and intelligent action when your content goes viral.
Normally, when you click on the date drop-down, you’ll notice that the blue bar indicating the selected date only goes up to yesterday. To get it to show real-time data, select the first date in your preferred range, and then click the latest date that isn’t grayed out. And voila! You have almost real time tracking.
3. Track Social Media Buttons
Social media is a powerful way to drive traffic to your site. Most bloggers encourage their readers to share their content via Facebook and Twitter – and when their users actually do so, it can be enough to bring in tens of thousands of new readers, subscribers, and consumers. We all want to go viral on social media. Therefore, it makes sense to track which users click on the buttons so we can focus our attention on the users that will reliably make our content go viral.
In a nutshell, you’re going to merely add an onClick function to your FBML code that allows the event tracking engine in Google Analytics to fire up when people click on the button. Here’s what the modified code will look like:
When a user clicks on the Facebook button, Google Analytics will track it as a pageview, allowing it to show up in your reports in much the same way that a blog post or landing page would. Here,
_trackPageview has one parameter that specifies how the click will appear in your reports. I recommend customizing each of the buttons on your site by including something like the blog post ID, the permalink, or a URL-escaped title (like
advanced-google-analytics), followed by
You can use this technique to hack together event tracking for almost any clickable element on your page. For instance, it’s simple to implement this on Twitter’s official retweet button. All you have to do is call
_trackPageview asynchronously, and you’re good. Here’s how I would do it:
Just like in the Facebook example above, you can edit the sole
_trackPageview parameter to customize how retweets appear in Analytics. I generally set my tracking identifiers to end in
4. Create Custom Campaign URLs to Track the Effectiveness of Link Building Campaigns
While tracking how many users interact with your social media buttons will give you a level of insight significantly higher than most other sites on the web, it won’t automatically tell you how effective social media buttons are at getting new users to visit your site (a la viral media). Of course, with a few modifications, you can easily change that. Google Analytics allows you to set up custom campaign URLs that automatically categorize and track the users who come in via those paths. To do it, all you need to do is add some parameters after the URL in the standard
?variable=value format. Here’s the variables you can use:
utm_campaignidentifies a specific product or campaign. You might set this to
utm_sourceidentifies where the traffic is coming from. Think of it as the site name or the URL. For a social media tracking campaign, you might set it to
utm_mediumdescribes the type of traffic, such as cost per click, organic search traffic, or RSS. Here, you might set it to
For tracking a social media campaign, I would use a URL like the following:
Now, the trick is to make sure that this is the URL that is shared on Facebook and Twitter. All you need to do is to append the tracking variables to the end of the URL set inside the settings for the social media buttons, and you’re all set. Building on the Facebook like button code illustrated above, it would look like this:
Of course, social media is not the only use for campaign tracking URLs. I also use it in my RSS feeds in order to get a more accurate snapshot of content usage within feed readers. It allows you to calculate the true value of a new subscriber, and focus your energy on the subscriber segments that will provide the most value to your site.
5. Use Custom Variables to Refine Data
Out of the box, Google Analytics only tracks pages, and it tracks each page in exactly the same way. For most, this is fine because you can usually tell which page is which by looking at the URL. However, Google Analytics is much more powerful than that – the system is flexible enough to let you build a model of your site’s content organization scheme right within Google Analytics. Then, you aren’t limited to tracking mere pages anymore. In fact, you can adapt it to track categories, tags, sections, or whatever other taxonomy you can think to throw at it. This is especially helpful with web applications and e-commerce sites where you might want to track specific actions or types of products.
Harnessing this power is as easy as sticking custom variables directly into your page code. The only sticking point is that variables are restricted to specific scopes of visitor engagement. Google Analytics offers the following three scopes:
You can read about the scopes in Google’s custom variables documentation. It can be a bit confusing at first, but the best way to think about it is by the thing you’re trying to segment. For instance, if you want to compare pages that are in one category versus another category, you would use the page scope. If you want to compare whether a user is logged in, you would use the session scope. The visitor scope is best used when you want to compare different types of users.
Here’s the basic code you’ll need to put in the
<head> section of your page to get started with custom variables:
_gaq.push(['_setCustomVar', 1, 'Category', 'Photoshop Tutorials', 3]);
1 in the code above refers to the index. Analytics only gives you five slots for custom variables, so you can pick a number from 1 to 5 to assign it to a slot. You can only use a slot once, so you’re limited to having only five custom variables at a time.
Category text is the name of the variable. You can set it to whatever you want. If you wanted to track tags on your WordPress blog, for instance, you might set it to
Photoshop Tutorials is the value of the custom variable. In the tag example mentioned above, you would set this to the name of the tag. If you’re using WordPress or another CMS, you’ll want to use the appropriate function to set this dynamically.
Finally, the last parameter sets the scope.
1 is the visitor scope,
2 is the session scope, and
3 is the page scope.
6. IP exclusion (so you don’t inadvertently measure yourself or your web team)
Whenever I launch a new site, I generally spend an hour or two fidgeting with the design and the code to make sure that everything is perfect. From there, I’ll usually do some initial link building and go to Analytics to see if I got any traffic. And every time, I would see a huge spike on the first day. For months, I thought I was an online marketing god. That is, until I dug into the data and saw that all of the traffic came from the same browser. And from the same city. And from the same IP address. Whoops.
Now, I use the IP exclusion feature in Google Analytics to make sure that my testing doesn’t skew the data (and get my hopes up for nothing). In order to do it, click on the “Edit” button for your site on the main profile page.
On the “Profile Settings” page, scroll down the page until you see the box named “Filters Applied to Profile” (below goals). Click on the “Add Filter” link, and you’ll be taken to the “Create New Filter” page.
Once you’re there, you can stick in your IP address (or range of IP addresses) so that it is excluded from Google Analytics. As soon as you’re done, click “Save Changes” and you’re all set.
How Will You Supercharge Your Analytics?
Google Analytics has plenty of advanced features that makes it possible to never need a premium analytics service ever again. With these features and the Analytics API, you can build a very powerful web statistics system that will allow you to make very successful conversion and traffic optimizations. Do you use Google Analytics on your site? How are you going to incorporate these features? And, what features would you like to see in Google Analytics that don’t currently exist?
Editor’s note: This post is written by Kurt Edelbrock for Hongkiat.com. Kurt is a law student, freelance writer, web developer, and online marketing expert.