AdWords
4.6K members online now
4.6K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Question mark vs. ampersand in upgraded URLs

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

 

I'm having an issue setting tracking templates for upgraded URLs, since some of my final URLs contain a question mark, others (including some sitelinks) do not. 

 

How do I formulate a tracking template to cover both scenarios? 

 

If I use the following, then some URLs end up containing two question marks (eg. example.co.uk?colour=red?utm_source=google...) and the page doesn't load correctly:

  • {lpurl}?utm_source=google&utm_medium=cpc

 

And likewise the other URLs would break if I used this, since they'd end up with example.co.uk&utm_source...

  • {lpurl}&utm_source=google&utm_medium=cpc

 

But what's the alternative other than setting a template individually for each item?

 

Ryan

1 Expert replyverified_user

Re: Question mark vs. ampersand in upgraded URLs

Top Contributor
# 2
Top Contributor

Hi Ryan,

 

Welcome to AdWords Community.

 

How about including the first question mark in the Final URL itself and then using '&' for the tracking template?

 

Something like -

Final URL - example.co.uk?colour=red

Tracking - {lpurl}&utm_source=google&utm_medium=cpc

 

It shouldn't break the URL at all.

 

You can setup different Final URLs, with or without ?colour=red on different levels based on your requirement. The catch is that Tracking template will remain the same in all cases. You can use it even at the account level. 

 

Thanks
Ratan Jha

Re: Question mark vs. ampersand in upgraded URLs

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Ratan,

But what if I have some Final URLs with query string parameters (and by extension question marks) but some that do not. How does my tracking template know whether to use a ? or & as it will be different in each case.

Or are you suggesting that I add a question mark into every single final URL? I'm not I can see any other way around it apart from using multiple question marks (which seems to work but I'm not sure it would be considered an ideal solution)

Thanks for your help.

Re: Question mark vs. ampersand in upgraded URLs

[ Edited ]
Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi Sarah, I actually stumbled across a related thread (below) that addressed this same question, and it suggested exactly that: adding a question mark onto the end of URLs even when not strictly required.

It would mean that some of your URLs may end up with the format example.co.uk?&utm_source=google&utm_medium=cpc - ie. with '?&' which is a bit unusual but seems to work most of the time - I'd definitely suggest trying this structure with your own URLs and make sure it doesn't break anything though!

https://www.en.adwords-community.com/t5/From-the-Community-Team/Do-you-track-URLs-Product-Manager-ad...