First note: This site is hosted on WPEngine (varnish caching), but I can't seem to replicate the issue on another server.
We need to be able to access the $_GET php variable on some pages. For testing, I modified our Wordpress header.php to do a var_dump on the very first line.
Normally, everything works OK. However if the URL string contains "utm_", every subsequent variable in $_GET is stripped. The extra weird part is that if I am logged in to Wordpress, everything works fine.
Our Paypal return URL looks like this:
http://oururl.com/buy/thankyou/?utm_nooverride=1tx=xxxxyyyy...
The utm_nooverride causes the $_GET to be an empty array. If I change it to "test=1&tx=xxxxyyyy", it works OK. If I use "utm_test=1&tx=xxxxyyyy" I get an empty array again.
There is nothing odd in the .htaccess, only a few standard Wordpress lines.
Could there be something in the hosting causing this?
In case anyone else runs into the same problem, as I just did, I spoke with WPEngine support team via Live chat and. They rectified it within a few minutes
Here's a shortened transcript of our chat:
Link for reference: https://wpengine.com/support/utm-gclid-variables-caching/
WP Engine may have (mis)configured Varnish to ignore query string parameters when they reference Google Analytics campaign variables. They may have done this so they can reference the cache of the page without the query string, since the campaign variables are read client-side (not server-side) by analytics provider. Therefore ignoring these variables server-side would ostensibly have no effect, and it would improve performance for sites making heavy use of inbound Google Analytics tracking.
I say it's possible since there's a Stack Overflow question asking how to do just that: "Stripping out select querystring attribute/value pairs so varnish will not vary cache by them". The only way to know for certain is to contact WP Engine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With