Page Rule : Forwarding URL but preserve utm query strings?


I have a page rule to re-write “” to “” but want to be able to preserve arbitrary utm tags/query strings so that campaigns to drive traffic to the more memorable “” can be built… otherwise the re-write drops the query strings before it hits the origin server with Google Analytics?

I know I can put analytics via CF but am already using GA on another subdomain with another UA ID on this domain with CF.

How to preserve utm query strings when the URL is rewritten?


I’ve not tried this, but for your rewrite, does it include a wildcard? I ask because each wildcard (*) can be carried over as a variable ($1, $2, etc) in the rewrite.


Hmm, so simple I never tried it! BRB :slight_smile:


Hmmm… so… page rule now maps:* to$1

and if I check in curl -vvv” mapped to “” i.e. only 1x query string…

Google Analytics is a PITA and needs multiple query strings 3x or 4x to register on Analytics…

I also tried with the wildcard in the original request and $1$2$3$4 in the mapping/re-write but that doesn’t pass the CF validator and won’t save. If there’s 2x separated wildcard asterisks then you can use $1 $2 as per the doco. I tried quadruple * for fun too but of course it gave out :frowning:

So essentially the * wildcard only seems to grab 1x query string or token? Any more ideas or am falling foul of not RTFM’ing again? I re-read the doco but other than your link and searching in this forum, seems info on query strings is sparse?


That’s something I hope someone from Cloudflare can respond to.

There’s the far outside chance it’s tied to your Cache Level settings, but I doubt it. That’s the only other setting I know of that addresses query strings:


I want to redirect my URL to Please help