Introduction: historical approaches

SEOs have often tried to extract keywords ranking from Google Analytics data by hacking advanced reports with custom filters, regular expressions and custom variables, trying to read the keyword position in Google SERP by parsing the querystring parameters from the referral url coming from organic searches.

The downsides were that the ranking position was trackable only for the impressions ending in a click, and that the method heavily depends on the referrer url format being kept constant, with keyword and position in clear.

Rank tracking with no compromises

The solution I'm going to introduce, while much simpler to implement, does not suffer such shortcomings.

Since some time Google Analytics provides an integration with Google Webmaster Tools search query data.

The trick is to filter a keyphrase with an exact match criteria:

Keyword ranking from Google Analytics

Simple and effective!

Differently from GWT, Analytics seems to store ranking data for longer periods of time, without limiting the available date ranges. The only thing to take care is ignoring the last few day, as the last three days data are not available.

We can even leverage the "Compare with past" feature:

Keyword ranking from Google Analytics, compare with past

You might be tempted to check the actual ranking, and discover there are some differences in the reported result.
Adding the country as secondary dimension lets us filter the results by nation, to visualize - for example - only the results coming from the United Kingdom, and better matches the google.co.uk SERP.

Keyword ranking from Google Analytics, filter by Nation

A word of caution:
The reported average position is calculated among all the impressions received, often coming from personalized SERPs significantly differ from the one seen with the pws=0 parameter; nevertheless the approximation is pretty good when the number of registered impressions is large enough, as distributed local results nullify each other.

Another important filter to apply is by "Google property", restricting to the value of "Web". This is the equivalent of filtering on GWT the type of search.

Keyword ranking from Google Analytics, filter by search type

By doing so we can better match the SERP by - say - cutting out results from the Google Images result page (which sometimes might strongly alter the results).

Google Webmaster Tools search queries, filter by search option

Limitation:

  • I couldn't figure out yet a way to apply both filters together, and this prevents to better reproduce the search results as observable on Google SERP.
  • Weird graphs show up when no data is recorded for certain dates: instead of missing segment, the line exhibits negative values, with different values!

Keyword ranking from Google Analytics, weird negative results

  • At the time of writing, Google GData APIs do not offer a way to access search query data.

Personal considerations on hypothetical Google provided ranking data:

I think one of the big mistakes of the Mountain View giant is not providing a supported and Google-backed way to track ranking positions. It keeps saying "don't bother about ranking, and concentrate on your user experience", but ranking is what site owners – and SEO clients – often really care (I agree they should care more about increasing their income, but stay with me); ignoring such needs only leads to:

  • SEOs, SEO tools and automated bots scraping like hell the Google SERPs against the Google guidelines (apparently Big G is indirectly causing a behavior against its own interests)
  • badly loading their servers with automated requests, increasing back-end costs and potentially hurting user experience with longer wait time and minor service availability (I admit Google is pretty good on keeping a more than decent response time)
  • badly altering search volume statistics for highly competitive keywords (who knows how badly; I suspect a lot, but even Google cannot say)
  • so causing AdWord prices – in good part influenced by such statistics – to unjustly rise (which might not be so much against Big G's interests... OK, better I stop here...)

Google could even sell the information via paid API usage, and SEOs still find it convenient against scraping, as they would have quicker and more reliable data.

Conclusions:

I illustrated an alternative way, and in my opinion a better one, to get key-phrases rank tracking over time to the traditional approaches; while still not optimal, it offers an easy tool which does not depend on internal undocumented implementations subject to change.
I'm testing this technique since the GWT integration appeared, and I'm surprised no one – as far as I'm concerned – has ever written of anything similar since then, so I decided to blog about it.
I hope to have arisen curiosity among the SEO community.
How long will you take before trying it?

Related articles:
Keyword Position on Google Webmaster Tools and the SERP