AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3.7K members online now
3.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

UTM parameters and hashtags

Badged Google Partner
# 1
Badged Google Partner

Hello guys,

 

I was wondering how do you tackle one-pagers and UTM parameters.

 

Let's say I have mysite.com/#benefits and I would like to add UTM parameters to a URL using a hashtag (not a question mark), e.g. mysite.com/#utm_source=test&utm_medium=test&utm_campaign=test.

 

I know an easy fix would be to substitute the hashtag for a question mark, so the URL would look like this: mysite.com/?utm_source=test&utm_medium=test&utm_campaign=test#benefits. Due to SEO reasons, I don't want to do that. Is there a way to reconcile this situation, so that I would be able to use the hashtag for the UTM parameters without sacrificing URL's functionality?

 

I like using Google Tag Manager, so if you have any solution utilising this tool, feel free to throw it in the discussion.

 

Thank you!

2 Expert replyverified_user

Re: UTM parameters and hashtags

Top Contributor
# 2
Top Contributor
Hi Honza,

Why won't you use the question mark? UTM parameters are being used for advertisements only, so usually there aren't any SEO issues like duplicate content with that.

Christoph

Re: UTM parameters and hashtags

Rising Star
# 3
Rising Star
Honza you can use the _setAllowAnchor() it is by default set to false which uses the ? question mark as the delimiter if you set it to true then the # becomes the delimiter. Here is a link to read up on it some more.
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?cs...

Re: UTM parameters and hashtags

Badged Google Partner
# 4
Badged Google Partner
Hi Christoph,

The problem with question marks is that they aren't used only in campaigns; they get used on micro sites or affiliate pages. When those URLs with a question mark get indexed, Google discounts their value.

H.

Re: UTM parameters and hashtags

Badged Google Partner
# 5
Badged Google Partner
Thanks, Brian!

I tried this, but there is a problem with one-pager websites. When you have a navigation structure like this: benefits section URL: example.com/#benefits | issues section URL: example.com/#issues, where do you put the UTM parameters?

example.com/#benefits&utm_source=test&utm_medium=test&utm_campaign=test
example.com/#utm_source=test&utm_medium=test&utm_campaign=test&benefits

Neither of the structures above work. Got any idea how can I make this viable?

Thank you!

Re: UTM parameters and hashtags

[ Edited ]
Top Contributor
# 6
Top Contributor

Hi Honza,

SetAllowAnchor has only been available in the old ga.js version of Google Analytics.

If you are going to use usual UTM parameters with question mark in ordinary links, that won't raise any SEO issues as long as you define the UTM parameters as passive parameters in Google Search Console [1] or use a canonical tag [2] in your page.

 

Generally, Google doesn't treat any web page differently just because it has a dynamical URL.

Christoph

[1] https://support.google.com/webmasters/answer/6080550?hl=en
[2] https://support.google.com/webmasters/answer/139066

Re: UTM parameters and hashtags

Badged Google Partner
# 7
Badged Google Partner
Way cool, Christoph! Thank you for pointing this out. Problem solved then. :-)