Skip to content

Instantly share code, notes, and snippets.

@seanhamlin
Created Nov 11, 2021
Embed
What would you like to do?
Strip analytics (Google, Facebook etc) query parameters in Fastly
# Query string stripping for web analytics.
#
# Currently stripped query parameteres include:
# - Google Analytics
# - Google Adwords (Doubleclick)
# - Facebook
set req.http.X-Original-Url = req.url;
set req.url = querystring.globfilter(req.url, "utm_*");
set req.url = querystring.filter(req.url,
"fbclid" + querystring.filtersep() +
"dclid" + querystring.filtersep() +
"gclid" + querystring.filtersep() +
"_ga" + querystring.filtersep() +
"gclsrc");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment