seo

5 Quick Google Analytics Hacks

1) Regex for Counting ” ” and “/”

Regex is awesome. I don’t claim to be amazing at it but there are a few common regex strings I use all the time in my analysis.

Length of Keyword

To quickly filter your keywords report by the length of keyword, I use some regex to count the number of spaces in the keyword like this:

^([^ ]+ ){5,50}[^ ]+$

The above regex searches for keywords that have between 5 and 50 spaces in them. You can also search across a single number as shown below. This image is a search for all keywords with 6 spaces in them for the distilled site (i.e. 7 words):

Depth of Page

Very similar to the above regex, but when I’m looking at top landing pages I use regex like this to count the number of slashes in a URL:

^/([^/]+/){3}[^/]*$

Note that because I’m not a full regex ninja this actually counts those URLs that have 4 slashes in (i.e. n+1). So the following image is showing all traffic to those pages with 5 slashes in them:

Note how useful this search is? Pretty much all of these pages are low quality like pagination or blog pages that have multiple categories assigned. For large sites if you construct the regex correctly this can be a great way to analyse where traffic is landing on the site and identify low quality pages to remove from the index.

If you’re new to regex – this is my goto guide for using regex in Google Analytics (PDF).

2) Check Your Analytics Code Is Correctly Installed

This is a super easy one, but definitely one worth running on any new site you take a look at. SiteScanΒ will crawl your site and check for the analytics code which is pretty nifty. It even intelligently checks for the old and new versions of the GA code. Nice. Unfortunately the free version only checks 100 pages but it’s definitely a solid resource for smaller sites:

Another quick check for correctly installed Google Analytics is to look for referrals from your own domain. Any referral from your own domain indicates that there are pages not correctly tagged (and will even show you which ones!). Nice.

3) 5 Ways to Segment your Funnel

Segmenting your funnel is not something you can do natively in Google Analytics which annoys the hell out of me. I’m hopeful that Google will be adding this feature sometime in the near future. In the meantime, there’s a few ways to segment your funnel:

Why do you care about segmenting your funnel? Well I give a detailed run-down of why this is important over hereΒ but hopefully this image should explain itself (the output of segmenting the funnel using my method):

4) Track SEO Variables In Google Analytics

This is a nifty use of custom variables which I recently started using on a few sites. Imagine you’re running a hotels reviews website. Some of your reviews have 100s of reviews and are lovely content-rich pages. But some of your hotels are awaiting their first review. In that case, your hotel page might be very light on content and might only have the name and address of the hotel on the page (which is duplicated on 100s of other sites). Wouldn’t it be nice to be able to segment your Google traffic by how many reviews your hotel page had? Well using page level custom variables this is as easy as the following code:

_gaq.push(['_setCustomVar',
Β  Β  Β  Β  Β 
1, Β  Β  Β  Β  Β  Β  Β  Β  Β  // This custom var is set to slot #1. Required.
Β  Β  Β  Β  Β 
'Num_Reviews', Β  Β  Β  // The name of the custom variable. Required.
Β  Β  Β  Β  Β 
0, Β  Β  Β  Β  Β  // Sets the value of "Num_Reviews" to 0. Required.
Β  Β  Β  Β  Β 
3 Β  Β  Β  Β  Β  Β  Β  Β  Β  Β // Sets the scope to page-level. Β Optional.
Β  Β  Β  Β  Β 
]);

You don’t have to limit yourself to just using this for number of reviews, you could look at other factors that you think might be affecting your pages ability to rank and pass those into GA. For example, you could pass the length of the description of a page. Or the number of tweets it has or anything you can think of really!

Learn more about page level custom variables over here.

5) Track Form Abandonment

This one comes from a blog post Duncan wrote a little while back, but I love how simple this is to use and how useful the insight is. Basically, using jquery it becomes very easy to track how far through a form people get. The idea was prompted by Sam’s post from some time ago, but uses events instead of virtual page views.

You should read the full write-up on Duncan’s post but the code looks something like this:

1.  $(document).ready(function() {   
2. var currentPage = jQuery.url.attr("path");
3. $(':input').blur(function () {
4. if($(this).val().length > 0){
5. pageTracker._trackEvent("Form: " + currentPage, "input_exit", $(this).attr('name'));
6. }
7. });
8. });

Bonus!

While writing this post, one of Dave Naylor’s gang posted about a new interface for in-page analytics which replaces the old site overlay. I’m quite excited about this, I think it paves the way for all kinds of cool things (not least of which is heatmaps as David points out…)

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button