Mobile app version of vmapp.org
Login or Join
Ann8826881

: How do I keep the hash (#) in a URL while using utm query strings in Google Analytics? I've got a website that uses hash # to identify URLs. So URLs might look like: www.mywebsite.com/somepage.aspx#productname

@Ann8826881

Posted in: #GoogleAnalytics #Url

I've got a website that uses hash # to identify URLs. So URLs might look like:
mywebsite.com/somepage.aspx#productname
Obviously, "product name" is important here, and I need it to show up in Google Analytics, and by default, it does - the above URL shows up in GA as: somepage.aspx#productname

However, the tricky bit comes when I also need to add Google Analytics campaign parameters. They of course need to be added before the hash, so the above URL might need to look like this:
mywebsite.com/somepage.aspx?utm_source=source&utm_medium=medium#productname
However, if I do this, the page will just show up in Google Analytics as "somepage.aspx". Is there a way to make it so that even when using campaign parameters, I can still keep the part of the URL after the hash in the Google Analytics page name?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

Why not use # as campaign parameter instead?

See this from Google Analythics:


_setAllowAnchor(bool) This method sets the # sign as the query string delimiter in campaign tracking. This option is set to false by
default.

Conventional campaign tracking URLs use the question mark (?) to
indicate the beginning of key/value pairs that make up the query. If
you set this option to true, your campaign tracking URLs can use a
pound (#) sign instead of the question mark (?) to indicate the
beginning of the query string.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme