SEO Manager Definition
/
This has been a big year for keyword (not provided). It has become more difficult than ever to gauge the success of SEO campaigns. That single term is now showing for over 95% of LunaMetrics.com’s organic search traffic! Yikes!
Our SEO team has been hard at work finding ways to get back some of that keyword data, through Webmaster Tools, AdWords, and some fancy mathetmatizing. Reid Bandremer blogged about some ways to combat (not provided) in a post in October.
But what if we could do even better? Rather than focusing on a user’s search term, what if we could see, on a page-by-page basis inside Google Analytics, exactly which keywords we optimized those pages for? Then we’d be able to see which of our actual SEO keywords are performing best, using metrics like conversions, bounce rates, time-on-page, etc.
The following is a way to get optimized keyword data inside Google Analytics, across your entire website, using Google Tag Manager.
The optimized keyword is defined according to a set of rules that we control. Our script will try to identify the optimized SEO keyword of each page, by checking these items in the following order:
- Manual dataLayer definition (if it exists)
- One-to-one URL lookup (if it’s defined)
- Meta keywords (if it’s on the page)
- H1 tag (if it’s on the page)
For this recipe, you’ll need:
- Google Tag Manager, across your site
- 1 Universal Analytics property (with Edit permission at the property level)
- 1 available Custom Dimension in Universal Analytics
- Several live organic search listings
- Optional: jQuery
Ok! Inside Google Analytics, in our Universal Analytics property, we’re going to add a new custom dimension. You’ll do so in the Admin section, under “Custom Definitions”.
Custom dimensions are unique to Universal Analytics, and they allow us to define our own custom Analytics dimensions that we want to record, in a similar way to the old custom variables of yore.
We’re going to create a custom dimension called “Optimized Keyword”. It is critical that the scope be set to session, for reasons that we’ll see later.
This may be your first custom dimension, or you may have other dimensions defined. For most users, you’ll have 20 maximum dimensions you can create (though Premium users have up to 200!). At any rate, make note of the “Index”. In our example, this is the first custom dimension, so the Index is .
Now on to Google Tag Manager. We’re going to create a new rule called “Search Traffic Landing Page Only”. This rule will have one Condition, based on the HTTP referrer. It will only fire when the {{referrer}} macro matches a regular expression that includes one of the search engines we’re optimizing for. In other words, it will only fire when a person arrives on our site from a search engine. See below:
Those “|” are “pipes” separating the search engines we want to target, all lowercase. In this example, we’re using google|bing|yahoo .