I was approached about this exact problem this week. After too long looking at control panel adjustments and htaccess fiddling I went for the Nuclear option.
Just add this to your config.php
if(isset($_GET['gclid'])) {
unset($_GET['gclid']);
}This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 13, 2010 12:42pm
Subscribe [8]#16 / Nov 04, 2011 11:35am
I was approached about this exact problem this week. After too long looking at control panel adjustments and htaccess fiddling I went for the Nuclear option.
Just add this to your config.php
if(isset($_GET['gclid'])) {
unset($_GET['gclid']);
}#17 / Nov 07, 2011 3:44am
Many thanks for sharing this solution. Would you be able to very briefly explain what it does?
Thanks again,
Andrew
#18 / Nov 07, 2011 3:50am
All arguments after a ? character in a URL are available to PHP as variables in an array called $_GET.
This code checks for the presence of one called ‘gclid’ and removes it if found. Because config.php runs early in the order of EE code, it stops later code getting confused by the presence of the variable.
This approach also has the added benefit of leaving the URL unchanged, which means any Javascript based analytics that are running will still function as intended.
#19 / Nov 07, 2011 4:03am
Excellent, thanks for your swift reply!
Andrew
#20 / Nov 28, 2011 5:04am
All arguments after a ? character in a URL are available to PHP as variables in an array called $_GET.
This code checks for the presence of one called ‘gclid’ and removes it if found. Because config.php runs early in the order of EE code, it stops later code getting confused by the presence of the variable.
This approach also has the added benefit of leaving the URL unchanged, which means any Javascript based analytics that are running will still function as intended.
Hi
where I can find config.php ?
I have similar problem with 3-rd party tracking. Instead ‘gclid’ I have ‘campaign’
Not sure if I can use:
if(isset($_GET[‘campaign’])) {
unset($_GET['campaign']);
}
#21 / Nov 28, 2011 5:07am
#22 / Jun 21, 2013 7:29am
Does anyone know if this whole issue has been adressed/fixed in one of the younger releases of EE?
I am just curious and in the process of setting up a new site and stumbled across this thread and wanted to go “future-proof” with my setup but couldn’t reproduce the problem without even changing anything.
I am using Focus Labs Master Config and checked it too if something going in that direction was included by default, but it doesn’t seem like it (or I am not seeing it). So any information on this would be super awesome. 😊
Thanks and Cheers, Marc