Viewing 9 replies - 1 through 9 (of 9 total)
  • Why not add a .htaccess rule that redirects gclid=* to the url without that parameter?

    Thread Starter DaveBurns

    (@daveburns)

    That misses the point so sorry if I was unclear.

    If I remove that param, then the Google JS code that looks for it to do better ad tracking has nothing to work with. The ideal would be to leave it there for Google to use but have the plugin ignore it. Some sort of solution where I could supply a list of URL params that are known to NOT affect the cached result seems like a good way to go. Thoughts?

    Ah, I didn’t know that. An ignore list would be useful. I can’t promise it’ll be added quickly however.

    Thread Starter DaveBurns

    (@daveburns)

    Ok. I may took a look at the code myself if I can find the time. In the meanwhile, how should things behave in my situation if I have the “Don’t cache pages with GET parameters” option UNchecked on the Advanced tab?

    I presume you’ve tried it already but the plugin will create wp-cache cache files if GET parameters are present. At least in this case all anonymous users who come to the site with the same gclid param will be served the same wp-cache file.

    Thread Starter DaveBurns

    (@daveburns)

    Right. The point is that this “gclid” param is unique per click (gclid = Google Click ID). So no one will share the same gclid with anyone else which breaks caching.

    Papoum

    (@papoum)

    Hi,

    I have the same problem.
    Have you found a solution to ignore gclid parameter and make Adwords visitors see cached pages ?

    Thanks.

    Papoum

    (@papoum)

    I found a way to ignore gclid parameter (Adwords automatic tracking) by addind the following lines in the wp-cache-config.php (in the wp-content folder) :

    $param = "gclid";
    unset($_GET[$param]);
    list($urlRoot, $params) = array_pad(explode('?', $_SERVER[ 'REQUEST_URI' ]), 2, '');
    if (!empty($params)) {
    	parse_str($params, $vars);
    	unset($vars[$param]);
    	if (count($vars) > 0) {
    		$newParams = http_build_query($vars);
    		$_SERVER[ 'REQUEST_URI' ] = $urlRoot . '?' . $newParams;
    	}
    	else {
    		$_SERVER[ 'REQUEST_URI' ] = $urlRoot;
    	}
    }

    There are probably better ways to do that but it seems to work.
    Now cached pages are served to Adwords visitors.

    As I want to ignore also parameters used by Google Analytics Experiments, I apply the same method for “utm_expid” and “utm_referrer”.

    Thank you Papoum for posting this.

    Did you put it anywhere?

    Also – I am new to php, etc, did you just add

    $param = “glclid,utm_expid,utm_referrer”;
    or list one per param?

    param = gclid
    param = utm_expid
    param = utm_referrer

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WP Super Cache] Google AdWords gclid parameter conflicting with caching’ is closed to new replies.