Hey guys this is a guest post from Alex Mouravskiy from content marketing firm Stunt and Gimmick’s (see below), pretty awesome I learnt a few things here!
Everyone loves Google Analytics! And why not? It’s free, and it comes with everything you need right out of the box. Or does it?
Technically, yes, but a lot of that juicy information is hidden deep inside the way GA functions. The good news is that GA is fairly simple to work with once you get a handle on some of the specific language and functionality. This, then, is a beginners dictionary for translating GA into business goals.
Why Bother?
Of course, you can run a perfectly functional campaign with Google Analytics tracking and get some pretty good insights. But I don’t want to be a “good enough” marketer. I want to be a great marketer, and you should too. Think of all the amazing information that slips through your fingers when you simply cut and paste the GA snippet onto your page (or into your app) without doing anything else. Think of all the relevant, actionable, ROI-busting insights that you can glean for what amounts to a couple of hours (tops!) of extra code.
So what kind of insights can you get with a few well-placed hacks?
- Add source/medium/keyword data to conversion forms
- Track how much of your content is actually being read
- Integrate e-commerce functionality with users’ browsing habits
- Find out which of your content categories are the most relevant for leads
- Track the most effective time to post social content and your biggest influencers
And these are just the ones I want to focus on today. The truth is, once you get past a simple “install and ignore” mentality with Google Analytics, you’ll very quickly realize that there is virtually no end to the things you can track, measure, and relate directly to your business goals. So without further ado, here are some tips to get you started:
Adding Source/Medium/Keyword Data to Conversions
This tid-bit actually arose from a request from a client. After doing a smashing job helping the client optimize and improve their AdWords campaigns, their marketing director asked if we could help them track exactly where their conversion forms were coming from, to link their database of personal information to anonymous visitor data in Analytics.
This seemed like a bit of a tricky proposition, as there were three main stumbling blocks:
- Google Analytics doesn’t necessarily track each visitor and each interaction with your site. This is a minor concern, since all conversion data is tracked, but it is still something to consider.
- Google’s TOS expressly forbids storing any PII (Personally Identifiable Information) inside Analytics. This means you can’t simply read someone’s name from a form and add it to their visit as a custom variable (more on this later). Moreover, even if you could, you would end up with a reporting mess when you tried to view this in GA.
- While you can see pretty detailed reports on which visits completed a goal in GA, and you can filter this report down to source/medium/keyword, it still doesn’t tell you which keyword led to which conversion and when, unless you have very few conversions and they all come from different keywords.
Still, this data is vital: knowing what keyword/source brought a visitor in could help with further PPC optimization, and would be a great help in the sales process (imagine being able to say “So, you’ve recently had windows damaged by that big storm that passed though? No problem, we can help” without having to ask what brought the lead in).
The solution is easier than you might think, though, provided you know some basic JavaScript or PHP (whichever you prefer). You see, every time you visit a GA-enabled site, Google places several cookies on your machine. These cookies, affectionately named ‘__utma’ , ‘__utmb’, ‘__utmc’, ‘__utmz’, ‘__utmv’ and ‘__utmx’, provide all the information you could possibly want to track with conversions. Specifically, we’re going to be looking at __utmz. This is a session-level cookie that tracks referral information on all your visitors.
__utmz (or urchin tracking module z, if you want to impress your old-school analytics friends), is structured pretty simply:
123456789.0987654321.10.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=google%20analytics%20hacks
Breaking that down, you get:
- 123456789 – The unique domain hash of your domain
- 0987654321 – timestamp for when the cookie was set
- 10 – session number
- 1 – campaign number
- utmcsr=google – campaign source, in this case Google
- utmccn=(organic) – campaign name, (organic)
- utmcmd=organic – campaign medium, organic
- utmctr=google%20analytics%20hacks – keyword for this visit, google analytics hacks
So, looking at this cookie, we get that this visit came in through organic search from Google, and used the keyword “google analytics hacks” to find that page. From there, it’s a relatively simple process to pull that information and append it to all conversion form submissions. You can do this with hidden fields, either using PHP to pull out the cookie information and insert it into the html on page-load (great tutorial here), or by using javascript’s document.cookie (read this for more info and example scripts). Then just stick those values into the hidden fields of your form, and suddenly you have an exact record of who converted when and how they got to your web form.
This is especially great when you’re trying to do more advanced PPC optimization by linking final sales to top-level keyword data, something that is near-impossible without knowing what keyword people used to get to your submission page. Now, whenever you close a sale, you can attribute the exact sale dollar amount to a specific keyword. Ta Da!
Track How Much Of Your Content Is Actually Being Read
We have a blog, and it gets a decent amount of visitors. It also, like many blogs, has a fairly high bounce rate. This (likely) isn’t because our blog sucks and no one is interested in it. Instead, this is a common problem for content creators and has to do with the technicalities of how Google Analytics calculates bounce rate – a bounce is any visit to your page that doesn’t result in an event or click on a link from your page.
So the problem content creators face is that a visitor might arrive directly on a blog post, read it, love it, but then not have time to browse your site further. Maybe they bookmark it for further reading, maybe they don’t. Maybe they read your amazing and thoughtful article all the way through, maybe they didn’t. Looking at bounce rate alone won’t tell you that, and because other content consumption metrics (like time on page) are based on navigating to other internal pages, they don’t really tell you much.
So how do you tell if someone is reading your posts and then leaving as opposed to “legitimate bounces” wherein someone gets to your article and leaves immediately? One good solution is to see how far down the article they made it before leaving, and record that as an event.
The first step here is to familiarize yourself with jQuery, since that’s the easiest way to track a user’s location on the page. If you aren’t familiar with jQuery, here’s a good resource.
The next step is to set up some hooks. What we use in-house is a 25%, 50%, 75%, and 100% level. This is a simple bit of code and looks something like this:
var t = $(document).scrollTop(); var h = $(document).height(); switch (true) { case (t > (h*.75)): break; case (t > (h*.50)): break; case (t > (h*.25)): break; default: break; }
Ideally, you want this to be hooked into the scroll event, so that every time the user scrolls, the function is checked. You also want to start with the highest value to avoid firing multiple events at the same time and having a cascade of events in the wrong order.
So now that you have your code, you need to add tracking to it. This is where GA’s event tracker comes in. The event tracker is an incredibly powerful tool if used right. The basic code is:
_gaq.push([‘_trackEvent’, ‘category’, ‘action’, ‘opt_label’, ‘opt_value’, ‘opt_noninteraction’]);
I won’t break that down, since I think the linked Google page does a great job of explaining everything; however, I do want to mention that you want to explicitly set the last argument (opt_noninteraction) to false, since the goal here is partially to figure out the “real” bounce rate.
When you plug this code into your javascript, the full result will look something like this:
var t = $(document).scrollTop(); var h = $(document).height(); switch (true) { case (t > (h*.75)): _gaq.push([‘_trackEvent’, ‘content’, ‘scrolling’, ‘75%’, ‘’, ‘false’]); break; case (t > (h*.50)): _gaq.push([‘_trackEvent’, ‘content’, ‘scrolling’, ‘50%’, ‘’, ‘false’]);break; case (t > (h*.25)): _gaq.push([‘_trackEvent’, ‘content’, ‘scrolling’, ‘25%’, ‘’, ‘false’]);break; default: break; }
Now, not only will a piece of content avoid being lumped in with bounces if the user has scrolled through at least 25% of the content, you will also be able to break down how far down each article users made it. This gives you a great idea of what content your visitors are actually reading and engaging with, even if they don’t go on to read anything else.
Note: You might need to play with the percentages, based on your blog layout. Some layouts have a very small footer, such that the top of the screen will never make it past 75%. One possible solution is to track the bottom of the screen, instead of the top. This will, however, give you worse data on very short blog entries that fit entirely on one screen.
Track Social Influencers
So you’re tweeting out all your awesome content, sending links every which way, and sometimes your targets even notice AND retweet them! Exciting, right? Of course, since Twitter doesn’t provide referral information on who retweeted that link that got visitors to your site, it’s often a bit of a crapshoot to figure out who your most valuable social connections are. Especially if you target multiple influencers, and more than one of them picks up your link.
One solution we love is using campaign tracking with links. There’s a great resource, and URL builder, available on Google’s documentation here. The basic premise is that in order to better track where your inbound social mentions are coming from, you tag every link you send out with campaign information and referrer information based on which influencer you’re trying to target. So if I wanted to send a tweet at, say, Mr. Avinash Kaushik – the go-to guy for everything analytics – and I wanted to see how many people came back to my site if he retweeted that link, I would open up the Google URL builder, and fill it out something like this:
Then wrap that all in a handy URL-shortener like bit.ly or goo.gl, and you’re all set. Now, when visitors come in from that influencer, they are tagged as campaign referrals and you can monitor which of your targeted influencers are sending the most valuable traffic through to your site.
Or, as an alternative, you can use time as a source, and see what times are best for sending out social updates (hint: just assuming that visitors that came in close proximity to a tweet or status update are the result of that particular tweet or update is very very bad, not good!)
These three easy hacks are just a primer on some of the amazing things a data-hungry marketer can do to make their analyzing experience much more pleasant, though it barely scratches the surface of what’s possible with GA and some minimal coding ability.
What are some of your favorite Google Analytics hacks?
Please leave a comment below and let us know.
About the author
Wordsmith with a heart of gold by day; obsessive data nerd by night; and all-around swell guy, Alex Mouravskiy is the Creative Director at Stunt & Gimmick’s – a boutique content marketing firm.
The post Hacking analytics for fun and data appeared first on WP Curve.