Search Engine Result Ranks Tracking in Google Analytics, Part 1

November 29th, 2010 Seth Meranda 4 Comments

Search Engine Optimization (SEO) is a crucial part of a successful online strategy. If we have worthwhile content, we want our users to find it. In increasing fashion, our audiences are turning the to likes of Google, Bing, Yahoo! and other search engines to help them find our content. To help us, Content Management Systems are “baking-in” SEO best-practices and helping to close the gap between what needs to be done and what can be done.

Once we’ve implemented SEO strategies, it can be cumbersome to determine success or failure. The most elementary solution is to query the search engines on a regular basis and observe if a position has moved up or down. This audit requires an understanding of keywords to focus on (defined in your SEO strategy) and time to do these searches and catalog results. Not to mention the possibility of localization which could vary your results from users across the country.

It’s time for a better solution: use Google Analytics to track keyword position when our visitors click on our result in the search listing. With a quick setup, we can track the actual item rank based on keyword from Google listings.

Ever since Google Instant, Google has been sending the actual result rank in the page referrer consistently. Google Analytics treats this traffic as search engine traffic, and therefore removes these referrers from the Referring Sites reports. However, with some profile filtering, we can still use the referring URL to setup Result Ranking Tracking.

Setting it Up

We’ll do this by creating two filters inside a new profile in Google Analytics. I encourage a new profile, as we’re going to scope to only specific traffic and thus exclude a large portion.

Our first filter will setup the profile to only include traffic from a Google search result page:

GA Filter: Include Google Organic
The important parts from this filter:

  • Filter Type: Custom Filter (Include)
  • Filter Field: Referral
  • Filter Pattern: google\.[a-z]+/url

Our second filter is more advanced. It parses out parameters from the referral URL and repurposes them into a combined result of keyword and rank inside our User Defined report (a report setup for this type of filter).

GA Filter: Output Google Ranking

The important parts of this filter:

  • Filter Type: Custom filter (Advanced)
  • Field A -> Extract A [Campaign Term] (.*)
  • Field B -> Extract B [Referral] (\?|&)cd=([^&]*)
  • Output To -> Constructor [User Defined] $A1 | Rank: $B2

This will now give us data inside the User Defined Report (found under ‘Visitors’). The data will have a ‘keyword | Rank: X‘ pattern:

GA Results: Search Rank Tracking

We now have a combined resource of keyword and rank in the result list. Now, we can use our web analytics reporting environment to analyze our SEO strategy results. In the second part of this post, I’ll go into more detail on how to use this in reports. Until then, gather the data!

A Few Caveats

While this can be very helpful, it’s important to understand a few limitations:

  1. Presently, this only works with the Google Search results.
  2. It requires the user to visit your site from the actual result. It’s like advertising, you can’t easily measure impressions, just conversions (though Webmaster Tools will help).
    1. Keep in mind, if a result isn’t clicked, it won’t show up on the list.
  • Jean-Paul

    thanks very much, i put the code, but when i get results, i get this

    product%20pc (Rank: 1)

    How i can replace “%20” by a space as ?

    product pc (Rank: 1)

  • New to GA

    I have the same problem with %20.

    How do I remove this?

  • You could create a replace filter which would substitute all of the %20 with spaces:
    1. Setup a new filter, and select ‘Custom Filter’
    2. Change the ‘Filter Field’ to ‘User Defined’
    3. Enter ‘%20’ in the Search String box
    4. For the ‘Replace String’ enter a

    Make sure this filter comes after both of the above filters.

  • Jean-Paul

    For replace string i put in the field ‘a’ or other combinaison as ‘ – ‘ ?