Google Analytics and SEO

Fixing Campaign Tagged URLs for Improved SEO

While attending the 2008 GAAC Summit at the Googleplex Robbin Steif of Lunametrics raised an interesting point regarding URLs that have Google Analytics campaign tags. Robbin pointed out that campaign tagged URLs can adversely effect SEO (Search Engine Optimization) as a result of duplicate content and that the _setAllowAnchor(true) function can be used to alleviate the problem.

Google Analytics and SEO Search Results

Okay, great, but can you repeat that in English?

Basically, Google sees a page on your site and campaigned tagged URL for the same page as actually being two separate pages. Then when we come to SEO, websites and pages can be given lower priority if there is duplicate content.

We have a landing page about being a Google Analytics Authorized Consultant: www.mangoldsengers.com/google-analytics-authorized-consultant

And we have a campaign tagged link to the same page on the Google Analytics partner page that looks like this: www.mangoldsengers.com/google-analytics-authorized-consultant?utm_source=gaac-listing&utm_medium=referal&utm_campaign=google-analytics

Although these are the same page Google sees them as two separate pages, so now the question is how do I fix the problem?

How to Fix Campaign Tagged URLs for SEO

Luckily, Google doesn't index anything after a # in a URL, so basically we need to change this: www.mangoldsengers.com/google-analytics-authorized-consultant?utm_source=gaac-listing&utm_medium=referal&utm_campaign=google-analytics to this: www.mangoldsengers.com/google-analytics-authorized-consultant#utm_source=gaac-listing&utm_medium=referal&utm_campaign=google-analytics

Google does not index anything after a destination anchor (i.e. the #), so now: www.mangoldsengers.com/google-analytics-authorized-consultant and www.mangoldsengers.com/google-analytics-authorized-consultant#utm_source=gaac-listing&utm_medium=referal&utm_campaign=google-analytics will be seen as the same page by Google. No more duplicate content!

Now that you have fixed the URLs, we need to get the campaign variables into Google Analytics. This is simply achieved by using the _setAllowAnchor(true) function that Robbin mentioned at the summit.

Your GATC (Google Analytics Tracking Code) will need to be modified (you will need to replace UA-XXXXXXX-X with your Google Analytics profile ID):

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
pageTracker._setAllowAnchor(true);
pageTracker._trackPageview();
} catch(err) {}</script>

If you have any questions or need help implementing SEO friendly campaign tags for Google Analytics then please get in touch!

Labels: , , ,

Share

Posted on Tuesday, November 25, 2008

3 Comments:

Anonymous brian@advanced-web-metrics.com said...

Just wandering why are using campaign variables on an organic referral link?

In our case, I attribute any [referral] traffic from http://www.google.com/analytics/authorized_consultants.html as the appropriate source/medium/campaign using a filter to re-write these within GA.

November 25, 2008 6:46 PM  
Blogger Rob Willox said...

Maintaining consistency of URI has always been important for SEO, for the reasons outlined.

But, was not aware that Google would regard pages with their own tags added, for analysis purposes, as different. Would have thought that they could have filtered by default.

Good to know, now, and thanks for the work-around!

November 25, 2008 9:23 PM  
Anonymous Anonymous said...

Now that the canonical url rel="canonical" 'suggestion' is out won't that be better? Less changes to implement all around.

August 20, 2009 9:40 PM  

Post a Comment

Links to this post:

Create a Link

Mangold Sengers provides Google Analytics consulting, Google Analytics onsite training and Google Analytics online training. Contact us to discuss your needs.