Skip to content

Instantly share code, notes, and snippets.

@seanhamlin
Created November 11, 2021 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanhamlin/486497142097c0dc403135953024c73b to your computer and use it in GitHub Desktop.
Save seanhamlin/486497142097c0dc403135953024c73b to your computer and use it in GitHub Desktop.
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