Skip to content

Instantly share code, notes, and snippets.

@said-and-done
Last active June 13, 2018 08:54
Show Gist options
  • Save said-and-done/2ae268a00292d61696de58cbbc2a4602 to your computer and use it in GitHub Desktop.
Save said-and-done/2ae268a00292d61696de58cbbc2a4602 to your computer and use it in GitHub Desktop.
Anonymize IP in analytics embed code
#!bash
$ find ../static -type f -name 'content.json' \
-exec grep -Hi "ga('send', 'pageview');" {} \; \
-exec gsed -i "s|ga('send', 'pageview');|ga('set', 'anonymizeIp', true);ga('send', 'pageview');|g" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment