Ensure anonymization of IP in GA (#3734)

This commit is contained in:
Ben Halpern 2019-08-16 14:06:02 -04:00 committed by GitHub
parent 30828cf0f7
commit 0b64407b81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -12,6 +12,7 @@ function initializeBaseTracking() {
wait++;
if (window.ga && ga.create) {
ga('create', '<%= ApplicationConfig["GA_TRACKING_ID"] %>', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview', location.pathname + location.search);
clearInterval(waitingOnGA);
logImpressions();

View file

@ -116,6 +116,7 @@
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', '<%= ApplicationConfig["GA_TRACKING_ID"] %>', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
ga('send', 'event', 'view', '/badge version impression', '<%= @html_variant.name %>', null);
</script>