Skip to content

Instantly share code, notes, and snippets.

Created November 11, 2021 20:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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() +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment