Created
November 11, 2021 20:25
-
-
Save seanhamlin/486497142097c0dc403135953024c73b to your computer and use it in GitHub Desktop.
Strip analytics (Google, Facebook etc) query parameters in Fastly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Query string stripping for web analytics. | |
# | |
# Currently stripped query parameteres include: | |
# - Google Analytics | |
# - Google Adwords (Doubleclick) | |
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