AdWords
1.9K members online now
1.9K 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

Adwords value track and web server syntax

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi to everybody,

 

I would like to ask this question.

I need a way to track conversions (in my custom back end software) coming from Adwords, so I have started playing with Adwords Value Track.

The idea was to put this:

{lpurl}?source={_source}

at Campaign level (where "source" is a custom variable set by me).

 

The problem rise when the web server process the URL...let me explain:

 

the web server see my website pages like this...
www.mysite.com/?page=name_landing_page

...and it process it like this (what I see in my browser)
www.mysite.com/name_landing_page

Adwords sends the click url in this format but being two "question marks" my web server ignores the second (Adword's one)
www.mysite.com/?page=name_landing_page?source={_source}

My coder says that what we need is a & and not a ? in the Adwords url click, like this
www.mysite.com/?page=name_landing_page&source={_source}

to have finally a final url like this
www.mysite.com/name_landing_page&source={_source}

 

I hoped to be clear in my exposition.

 

Thanks for your help,

Matteo

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Andrea G
February 2016

Re: Adwords value track and web server syntax

Top Contributor
# 9
Top Contributor
Hi Matteo,

The problem is really on your side and the rewrite rule. When you rewrite the URL, the question mark (?) of the original query string needs to be changed to an ampersand (&).

Let me break that down.
If the URL is: http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/
and you add the value track values to that with an ampersand, it looks like this:
http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/&source=Google

That URL will never be found on your server because it will "think" estratto_di_mappa_catastale/&source=Google is the name of the page, since there is no question mark.

If we form that url properly it looks like this:
http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/?source=Google

But your rewrite rule then makes it look like this:
http://www.mysite.it/?var1=catasto_online&var2=estratto_di_mappa_catastale?source=Google

The way it looks to me, vising the rewrite rule is the only way to solve this. When you pickup the query string from the original request, replace the ? with a &. I'd kick this back to your developer to work on.

There is one other way, and I'm not sure if this will work with your rewrite rule. Instead of lpurl being http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/, make it the URL after the rewrite: http://www.mysite.it/?var1=catasto_online&var2=estratto_di_mappa_catastale, then, in the template, use & instead of ?.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

View solution in original post

Re: Adwords value track and web server syntax

Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭
Hi Matteo,

As far as having two '?' go, your developer is correct.

The first parameter needs to be a '?' and every subsequent parameter needs to be an ampersand.

Unfortunately a final URL that starts the parameter with an ampersand will not work, your query or tracking parameter needs to start with a '?'.

As far as the processing part goes I am out of my depth there, the above is as much as I am able to offer on this issue.

Perhaps someone with more experience in this area can jump in.

Good Luck

Re: Adwords value track and web server syntax

Top Contributor
# 3
Top Contributor

Hi @Andrea G

 

If your Final URL already has a question mark, there's no problem using what your developer suggests. It is accepted with AdWords upgraded URLs. 

 

For instance - if the Final URL is - website.com/?theme=blue, the tracking template can be {lpurl}&source=yourtracking. In this scenario the actual URL in browser would be website.com/?theme=blue&source=yourtracking 

 

Thanks
Ratan Jha


About Me: Community Profile | Ratan Jha INC.
If this or any other post solved your question, do not hesitate to accept it as the solution.

Re: Adwords value track and web server syntax

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Hi Ratan,

I tried what you say but I don't get the same result

Click URL
http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/?source=adwords&campagna=mappe

As you can see before "source" I have a ? and not a &

Thanks
Matteo

Re: Adwords value track and web server syntax

Top Contributor
# 5
Top Contributor
Hi Matteo,

I'm not quite understanding the URL structure for your site. Is the (1) Final Url www.mysite.com/name_landing_page? Or is (2) www.mysite.com/?page=name_landing_page the Final URL and it redirects to www.mysite.com/name_landing_page?

What I see in the Click URL you posted in your last post has only one question mark, so it really should be ok to use, unless number 2 above is correct. Did you try to follow the Click URL? Does it get to your page?

The part that is making no sense to me is this URL format:
www.mysite.com/name_landing_page&source={_source}

That is not a properly formed URL. And should return a page not found. Of course, we don't know what you are using for a back end CMS. It could be your CMS understands that and is able to parse the request to find the query string. But in most cases, the CMS will look at the query string for additional parameters, like the AdWords manual tagging. If the program looks for the query string in a URL formatted this way, it will find nothing.

A lot of questions and no answers. If the lpurl has a question mark (?) already, use [lpurl]&source={_source}. If the lpurl does not have a question mark in it, use [lpurl]?source={_source}. If you have a mixture of URL's with and without a question mark, they will need to use different tracking templates.

That's the best I can do without more information.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

Re: Adwords value track and web server syntax

Top Contributor
# 6
Top Contributor

Hi @Andrea G,

 

The point is as @petebardo also pointed out - if your URL has a question mark already, use a & sign for tracking template. But, if there is no question mark or it is lost in the kind of redirect you have and the click URL is left with a & only, the URL will be invalid. 

 

A lot depends on how your CMS understands and parse URLs. And is it really required to redirect the URL in browser removing that question mark?

 

Thanks
Ratan Jha


About Me: Community Profile | Ratan Jha INC.
If this or any other post solved your question, do not hesitate to accept it as the solution.

Re: Adwords value track and web server syntax

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Thanks to everybody!

I've followed your posts to my developer, hoping he'll find a solution suitable for me.

Matteo

Re: Adwords value track and web server syntax

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Anyway I'll try to explain better my issue

In my case
{lpurl} is http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/
to which I want to add some variables (es: source={_source})

URL is automatically mapped in Apache with a rewriterule in http://www.mysite.it/?var1=catasto_online&var2=estratto_di_mappa_catastale
then we should need to use the ampersand, like this {lpurl}&source={_source} and not with another question mark, like this {lpurl}?source={_source}
BUT...automatically at the submit phase "&" is changed with "?" and as consequence I loose the Adwords variable.

How can I automatically force the use of "&" and not of "?" or use a work around to solve the problem?

Thank you all
Matteo
Marked as Best Answer.
Solution
Accepted by topic author Andrea G
February 2016

Re: Adwords value track and web server syntax

Top Contributor
# 9
Top Contributor
Hi Matteo,

The problem is really on your side and the rewrite rule. When you rewrite the URL, the question mark (?) of the original query string needs to be changed to an ampersand (&).

Let me break that down.
If the URL is: http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/
and you add the value track values to that with an ampersand, it looks like this:
http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/&source=Google

That URL will never be found on your server because it will "think" estratto_di_mappa_catastale/&source=Google is the name of the page, since there is no question mark.

If we form that url properly it looks like this:
http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/?source=Google

But your rewrite rule then makes it look like this:
http://www.mysite.it/?var1=catasto_online&var2=estratto_di_mappa_catastale?source=Google

The way it looks to me, vising the rewrite rule is the only way to solve this. When you pickup the query string from the original request, replace the ? with a &. I'd kick this back to your developer to work on.

There is one other way, and I'm not sure if this will work with your rewrite rule. Instead of lpurl being http://www.mysite.it/catasto_online/estratto_di_mappa_catastale/, make it the URL after the rewrite: http://www.mysite.it/?var1=catasto_online&var2=estratto_di_mappa_catastale, then, in the template, use & instead of ?.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

Re: Adwords value track and web server syntax

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
Hi everybody,

the problem as Pete suggested was totally on my side and finally yesterday my developer fixed it rewriting the rewrite rule.

Thanks to all for you precious support.
Matteo