Adwords auto-tagging and arbitrary url parameters in CMSMS
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi
I have had a good search for this on Google and in the forums and it looks like this has never come up before which seems surprising.
I recently launched an adwords campaign and added a new ad group pointing at an internal landing page. Google adwords seems to have what it calls "auto-tagging" enabled by default if you have an adwords and analytics account that are linked together. Auto-tagging adds a parameter to the end of the destination url with ?gclid=blahblahblah to allow it to track info on add clickthrus in analytics.
The site this happened to me on uses the internal pretty urls and auto tagging results in a url of www.example.com/index.php/page-name?gclid=blahblahblah which serves a 404. Ads pointing at the homepage end up with www.example.com/?gclid=blahblahblah and are fine.
I tested this on another site that uses the pretty urls with rewrites. It uses urls like www.example.com/page-name.htm and the auto-tagging would create www.example.com/page-name.htm?gclid=blahblahblah which again returns a 404.
So I am posting for 2 reasons. Firstly, in case people have this problem and aren't aware (we only found out because some stranger called us to tell us), so they can check. You can solve it by turning auto-tagging off. Log in to your account and then
2. Click the 'My Account' tab and select 'Account Preferences'.
3. From the Tracking section, click 'Edit'.
4. Deselect the 'Destination URL Auto-tagging' checkbox.
5. Click 'Save Changes'.
The second reason I am posting is to ask whether anyone has a solution that would allow such arbitrary url parameters to be passed at the end of a url. In the case of the pretty urls site, I think I may be able to do it by hashing about with the url rewrites. I suppose that may be a solution with the internal pretty urls as well but I wanted to ask whether anyone had a smarter solution.
Thanks
Alastair
I have had a good search for this on Google and in the forums and it looks like this has never come up before which seems surprising.
I recently launched an adwords campaign and added a new ad group pointing at an internal landing page. Google adwords seems to have what it calls "auto-tagging" enabled by default if you have an adwords and analytics account that are linked together. Auto-tagging adds a parameter to the end of the destination url with ?gclid=blahblahblah to allow it to track info on add clickthrus in analytics.
The site this happened to me on uses the internal pretty urls and auto tagging results in a url of www.example.com/index.php/page-name?gclid=blahblahblah which serves a 404. Ads pointing at the homepage end up with www.example.com/?gclid=blahblahblah and are fine.
I tested this on another site that uses the pretty urls with rewrites. It uses urls like www.example.com/page-name.htm and the auto-tagging would create www.example.com/page-name.htm?gclid=blahblahblah which again returns a 404.
So I am posting for 2 reasons. Firstly, in case people have this problem and aren't aware (we only found out because some stranger called us to tell us), so they can check. You can solve it by turning auto-tagging off. Log in to your account and then
2. Click the 'My Account' tab and select 'Account Preferences'.
3. From the Tracking section, click 'Edit'.
4. Deselect the 'Destination URL Auto-tagging' checkbox.
5. Click 'Save Changes'.
The second reason I am posting is to ask whether anyone has a solution that would allow such arbitrary url parameters to be passed at the end of a url. In the case of the pretty urls site, I think I may be able to do it by hashing about with the url rewrites. I suppose that may be a solution with the internal pretty urls as well but I wanted to ask whether anyone had a smarter solution.
Thanks
Alastair
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Please provide more information about your server, hosting company, mod_security
CMSMS mod rewrite include the [QSA] parameter which is supposed to pass the additional url query vars
Some times mod_security can cause wierd problems
All my sites work fine.
CMSMS mod rewrite include the [QSA] parameter which is supposed to pass the additional url query vars
Some times mod_security can cause wierd problems
All my sites work fine.
Last edited by viebig on Tue Feb 24, 2009 7:19 pm, edited 1 time in total.
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi, viebig:
Can you please remove the link to my site? (Or just write it in a way that it's not a link?) Thank you. I just don't want it affecting my search results. Thank you!!!
N
Can you please remove the link to my site? (Or just write it in a way that it's not a link?) Thank you. I just don't want it affecting my search results. Thank you!!!
N
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi viebig
Can't think of anything useful I can add about my server really. It's unix / linux and running lighty rather than Apache. It's on a VPS, I have full root access.
I don't know what mod_security is. I am using the Internal pretty urls on this site so I would imagine there shouldn't be any mod rewrite going on at all (oh, and it's lighty). Should all presumably be internal CMSMS logic, no?
More details:
http://www.example.com/index.php?page=p ... ahblahblah
the above url format seems to work fine and CMSMS displays the page with no problem (note the use of the '&' instead of the '?')
I was assuming that the internal logic in CMSMS just wasn't expecting an extra "?" in the url and so either wasn't looking for it or had no idea how to deal with it?
The example you provide below is presumably using pretty urls and mod rewrite and taking care of the additional paramaters by parsing and passing on the content after the "?". Is that right?
Can't think of anything useful I can add about my server really. It's unix / linux and running lighty rather than Apache. It's on a VPS, I have full root access.
I don't know what mod_security is. I am using the Internal pretty urls on this site so I would imagine there shouldn't be any mod rewrite going on at all (oh, and it's lighty). Should all presumably be internal CMSMS logic, no?
More details:
http://www.example.com/index.php?page=p ... ahblahblah
the above url format seems to work fine and CMSMS displays the page with no problem (note the use of the '&' instead of the '?')
I was assuming that the internal logic in CMSMS just wasn't expecting an extra "?" in the url and so either wasn't looking for it or had no idea how to deal with it?
The example you provide below is presumably using pretty urls and mod rewrite and taking care of the additional paramaters by parsing and passing on the content after the "?". Is that right?
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
@nadia
Please forgive me, my bad. Link removed
@alastair_scs
when pretty urls are on
www.example.com/test/?foo=bar
rewrites to
www.example.com/index.php?page=test&foo=bar
the ? is used for the first variable of query vars, any other variable have a & suffix
Can you PM me a link?
Regards
Please forgive me, my bad. Link removed
@alastair_scs
when pretty urls are on
www.example.com/test/?foo=bar
rewrites to
www.example.com/index.php?page=test&foo=bar
the ? is used for the first variable of query vars, any other variable have a & suffix
Can you PM me a link?
Regards
Last edited by viebig on Tue Feb 24, 2009 7:26 pm, edited 1 time in total.
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Thanks
I will PM a link. Thing is that on the site in question, pretty urls are not on.
The urls are www.example.com/index.php/page-name
Interestingly, on my site with pretty urls, it also does not rewrite the way your example does. I guess this is because of the different rewrite rules used with lighttpd vs Apache.
Thanks for the help
I will PM a link. Thing is that on the site in question, pretty urls are not on.
The urls are www.example.com/index.php/page-name
Interestingly, on my site with pretty urls, it also does not rewrite the way your example does. I guess this is because of the different rewrite rules used with lighttpd vs Apache.
Thanks for the help
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi Viebig
Thanks for the help. I've been away from this for a day or two. I PM'd a response to your last message.
I am using Lighttpd, yes.
Thanks for the help. I've been away from this for a day or two. I PM'd a response to your last message.
I am using Lighttpd, yes.
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi
Thought I'd provide an update on what seems to be the situation so far.
It looks like, if you use the pretty urls option with CMSMS, an Adwords campaign with auto-tagging enabled will not work when pointing at internal pages. The "?" in the url will not be read and passed on in the way that Google expects and will result in a page not found type error. This seems to be the case regardless of the hosting or server setup as far as I can tell.
If you use the default setup where your urls are something like www.examplesite.com/index.php?page=page-name then auto-tagging seems to work fine.
If you use the pretty urls on Apache, you also seem to be fine. (I haven't tested this but Viebig says his works and it looks from the Mod Rewrite rule in the instructions that it should work).
If you use Lighttpd and the rewrite rules as presented in the documentation, then auto-tagging will screw up and ads that point at your internal pages will serve errors instead of content (or at least they did on the test I did). The Apache rewrites given in the Tips and Tricks page append the Query String when they rewrite the url. The Lighttpd arrangement doesn't seem to. From what I can find in the documentation Lighttpd doesn't have a [QSA] type operation so I presume you need to find a workaround.
I have included the workaround I used below. I don't know if it is the best or only way to do this or even if it works so use it at your own risk. It seems to be working for me.
The rewrite rules I used initially were modified versions of what's here: http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
The alteration I used for my setup was to add:
"^/([^.?]*)\?(.*)$" => "/index.php?page=$1&$2",
which catches urls with a ? in them and passes the query string along in a way that CMSMS seems to have no problem handling and doesn't create the server error.
I put that line in above this:
"^/([^.?]*)(/?)$" => "/index.php?page=$1"
Which is just the standard regex to catch my normal urls (in this case with or without a "/" at the end).
I am pretty certain that Lighttpd is going to rewrite once and only once, so it is important that the additional line goes above the main line designed to match your page urls. If they were the other way round I am pretty sure it wouldn't work.
Thought I'd provide an update on what seems to be the situation so far.
It looks like, if you use the pretty urls option with CMSMS, an Adwords campaign with auto-tagging enabled will not work when pointing at internal pages. The "?" in the url will not be read and passed on in the way that Google expects and will result in a page not found type error. This seems to be the case regardless of the hosting or server setup as far as I can tell.
If you use the default setup where your urls are something like www.examplesite.com/index.php?page=page-name then auto-tagging seems to work fine.
If you use the pretty urls on Apache, you also seem to be fine. (I haven't tested this but Viebig says his works and it looks from the Mod Rewrite rule in the instructions that it should work).
If you use Lighttpd and the rewrite rules as presented in the documentation, then auto-tagging will screw up and ads that point at your internal pages will serve errors instead of content (or at least they did on the test I did). The Apache rewrites given in the Tips and Tricks page append the Query String when they rewrite the url. The Lighttpd arrangement doesn't seem to. From what I can find in the documentation Lighttpd doesn't have a [QSA] type operation so I presume you need to find a workaround.
I have included the workaround I used below. I don't know if it is the best or only way to do this or even if it works so use it at your own risk. It seems to be working for me.
The rewrite rules I used initially were modified versions of what's here: http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
The alteration I used for my setup was to add:
"^/([^.?]*)\?(.*)$" => "/index.php?page=$1&$2",
which catches urls with a ? in them and passes the query string along in a way that CMSMS seems to have no problem handling and doesn't create the server error.
I put that line in above this:
"^/([^.?]*)(/?)$" => "/index.php?page=$1"
Which is just the standard regex to catch my normal urls (in this case with or without a "/" at the end).
I am pretty certain that Lighttpd is going to rewrite once and only once, so it is important that the additional line goes above the main line designed to match your page urls. If they were the other way round I am pretty sure it wouldn't work.
-
- Forum Members
- Posts: 23
- Joined: Sun Aug 17, 2008 6:41 pm
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
Hi
I just wanted to add another short note to say thanks very much to Viebig for the help provided here and by PM. I got to a solution much faster than I would have without the help and it is so much easier to work with a Content Management System when you know that there are people around willing to help with difficulties.
Also, in case anyone has problems understanding why this is a big deal. I discovered this when running an Adwords campaign for our site. I extended the campaign with a new ad targetting an internal page, double checked the url etc. and let it run. The ad turned out to be more popular than the rest of the campaign and generated a lot of visits. It served up an error page rather than content and we were $500 down before either Google or I noticed.
I was very lucky that this was my own site and not a client's. I am sure they would have managed to spend much more before identifying the problem and I would have had less flexibility in how to fix it.
I am not sure whether to mark this as Solved now. I have a solution but it is basically that I cannot use Internal pretty urls and certainly not on a site I do for someone else (since they will be unaware of the problem).
Thanks again for the help.
I just wanted to add another short note to say thanks very much to Viebig for the help provided here and by PM. I got to a solution much faster than I would have without the help and it is so much easier to work with a Content Management System when you know that there are people around willing to help with difficulties.
Also, in case anyone has problems understanding why this is a big deal. I discovered this when running an Adwords campaign for our site. I extended the campaign with a new ad targetting an internal page, double checked the url etc. and let it run. The ad turned out to be more popular than the rest of the campaign and generated a lot of visits. It served up an error page rather than content and we were $500 down before either Google or I noticed.
I was very lucky that this was my own site and not a client's. I am sure they would have managed to spend much more before identifying the problem and I would have had less flexibility in how to fix it.
I am not sure whether to mark this as Solved now. I have a solution but it is basically that I cannot use Internal pretty urls and certainly not on a site I do for someone else (since they will be unaware of the problem).
Thanks again for the help.
Re: Adwords auto-tagging and arbitrary url parameters in CMSMS
When I have time I'll do further investigations on my lighttpd server.
Regards
Regards