Google PlusFacebook iconTwitter icon+44 113 260 4010 contact@branded3.com

Using Page Level Google Analytics Custom Variables to report on SEO traffic by page type

One of the most important reports an SEO agency gives for a large site is the one that breaks down the traffic to the different sections of that site. This allows you to analyse whether traffic rises came from product pages, product types, category pages, sub-category pages, blog posts etc.

For most sites you can produce this report by looking at the top Google Organic landing pages and filtering by an appropriate folder or file name from the URL.

The problem is that a lot of sites don’t have a difference URL structure for each section so the above method of gathering data won’t work. Certainly if you have an ecommerce site you can’t separate products by category unless you have the category in your URL and that’s usually a bad idea for SEO.

What we’ve been doing is to use Google Analytics Custom Variables, applied at the page level, to tell Google what type of page the user has landed on.

_gaq.push(['_setCustomVar',
1, // This custom var is set to slot #1. Required parameter.
'Section', // The top-level name for your online content categories. Required parameter.
'Life & Style', // Sets the value of "Section" to "Life & Style" for this particular aricle. Required parameter.
3 // Sets the scope to page-level. Optional parameter.
]);


This sounds quite simple to set up and it’s actually the main example Google gives about using the page level variables but the real problem is getting the data for your Custom Variables out of Google Analytics. It took a lot of work to figure out how to do this because every report we tried was just returning the overall visits to a page during the session rather than specifically for landing pages.

After much testing the report below is what we came up with. You need to set up a new Custom Report with the following metrics & dimensions. The addition of Entrances & Visits together is just a check – they should return the same number. Hope this is of use to anybody else trying to do this.

BY Patrick Altoft AT 11:25am ON Tuesday, 25 January 2011

Patrick Altoft is Director of Search at Branded3 and has worked in the SEO industry for over 10 years. With experience across some of the worlds largest brands as well as startup businesses Patrick is well known in the industry and speaks regularly at the major SEO conferences and events. Follow Patrick on Twitter or Google+

Comments

  • http://www.conversie-optimalisatie.com Martijn

    An interesting setup. I’ll try it on some sites!
    I’m not a big fan of putting entrances in my custom reports though. It limits your other options a lot. Did you try some alternative metrics there too?

  • Pingback: SearchCap: The Day In Search, January 25, 2011

  • http://twitter.com/glager Gennady Lager

    Why is having the category name in the URL of a product page usually bad for SEO?

    For example: http://www.example.com/catalog/category-name/product-name/

    What makes this bad?

  • http://www.blogstorm.co.uk Patrick Altoft

    Having the category name in the URL is bad because some products are in more than one category and you also might want to change the category or the category name which means changing the product urls

  • http://twitter.com/glager Gennady Lager

    I see. I guess this isnt a universal issue as it certainly doesnt affect all category and product-based sites meaning it isnt bad in all cases. Cheers.

  • http://www.piehole.co.uk/ piehole

    Custom reports are really the way to go if you want to crack web analytics. We are following Avinash Kaushik and this type of reports are really wort setting up.

    @Patrick – agree with your point, it’s much better if you can, to have custom urls with one keyword. When you have categories there, you might end up looking like a spammer – eg http://www.voiceoverartists.com/voiceovers/voiceovers-uk

  • http://www.chelthockey.org/ Nathen Less

    One option is to use a second tracking script, to create a separate roll up reporting profile within the parent account. This has the advantage of not using valuable custom variable slots that you may want to use elsewhere and it allows you to populate the _trackPageview() call with whatever value you want. Examples could include aCategoryPage, aSubCategoryPage, aProductPage and so on.

  • http://www.poweredbysearch.com Dev Basu

    Neat post Patrick. The CustomVar has so many applications and isn’t used as widely enough as it should be!

  • http://www.searchengineoptimisationworks.com Paul

    Id agree. this is a good way to pin point where traffic comes from in LARGE sites. Some of our sites number well over 1000 pages and some in the e-commerce fields have over 10, 000 products.

    Thanks Patrick

  • http://www.free-power-point-templates.com/ Julian

    This is extremely useful. We have been using this technique at our website to track the pages under categories (what you call here “section”). By using this custom variable in Google Analytic you can learn more about your data. Thanks for sharing.

  • http://www.industribasen.dk Maskinauktioner

    I will try that on my site…

    Thanks :-)

  • http://www.hairlossproductreviewer.com penny jones

    This is a really informative post. I never knew this was possible. I’ll give it a try, thanks for sharing this with us.

  • http://www.sportbasen.dk Benjamin

    This is such a usefull guide, thank you! I’ll try it right now – thanks again.

  • http://www.spaaza.com Sam Critchley

    I found this article and the comments really useful, thanks. I ran into problems getting Google Analytics to recognise my custom variables though. It turns out that the setCustomVar _gaq.push commands you have in your analytics snippet need to be placed BEFORE your trackPageview command or else they won’t be picked up. You can debug this with the Google Analytics Debugger extension in Chrome (and possibly in other browsers).