Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets anonymizeIp to true in GA snippet #2219

Merged
merged 4 commits into from
Apr 16, 2020
Merged

Sets anonymizeIp to true in GA snippet #2219

merged 4 commits into from
Apr 16, 2020

Conversation

roblarsen
Copy link
Member

closes #2212

@roblarsen roblarsen added this to the 8.0 milestone Apr 15, 2020
@roblarsen roblarsen requested a review from coliff April 15, 2020 19:57
@roblarsen roblarsen self-assigned this Apr 15, 2020
Copy link
Member

@coliff coliff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice... though I think it'd be worthwhile having a link to Google's docs about IP Anonymization.
https://support.google.com/analytics/answer/2763052?hl=en
Explains how it works with some useful additional links.

dist/doc/html.md Outdated
@@ -176,6 +176,13 @@ included.
We use `analytics.js` rather than the newer `gtag.js` as
[it's faster and supports tasks and plugins](https://github.com/philipwalton/analyticsjs-boilerplate/issues/19#issuecomment-333714370)

Starting with version 8 we, by default, <a href="https://support.google.com/analytics/answer/2763052?hl=en">anonymizse IP addresses</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anonymize typo here 🤓
Also - should use markdown style links, not HTML ones I think

dist/doc/html.md Outdated
By default Google Analytics records the full IP address of a user visiting the site, but
that full IP address is never available to the Google Analytics property admin.
By anonymizing the IP address you can make your site more GDPR-compliant as a
full IP address can be defined as PII (publicly identifiable information.)
Copy link
Member

@coliff coliff Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry another thing... my fault as this was copied from my comment... but this should actually be personally identifiable information (PII)
REF: https://en.wikipedia.org/wiki/Personal_data

By default Google Analytics records the full IP address of a user visiting the site, but
that full IP address is never available to the Google Analytics property admin.
By anonymizing the IP address you can make your site more GDPR-compliant as a
full IP address can be defined as PII (publicly identifiable information.)
full IP address can be defined as PII (personally identifiable information.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, last nit-pick and then we're good. There's 2 line breaks after this section and should be just 1 to be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit-picking is why we're here 👍

Copy link
Member

@coliff coliff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. looks good.
Overall, in the markdown docs there are some inconsistencies in line-lengths and line breaks which we should probably deal with at some point...

Not related to this PR specifically; just a general thought

@TheDancingCode
Copy link
Contributor

Another level of privacy might be to respect the DoNotTrack signal of browsers.

In that case, the code would be wrapped in a conditional:

var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
if (dnt !== 'yes' && dnt !== '1') {
    window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
    ga('create', 'UA-XXXXX-Y', 'auto'); ga('set', 'anonymizeIp', true); ga('set','transport','beacon'); ga('send', 'pageview');
}

@coliff
Copy link
Member

coliff commented Apr 16, 2020

thanks @TheDancingCode - the DoNotTrack has actually been deprecated now.

DNT is not widely adopted by the industry, with companies citing the lack of legal mandates for its use, as well as unclear standards and guidelines for how websites are to interpret the header. Thus, it is not guaranteed that enabling DNT will actually have any effect at all. The W3C disbanded its DNT working group in January 2019, citing insufficient support and adoption. Apple discontinued support for DNT the following month.

https://en.wikipedia.org/wiki/Do_Not_Track

@roblarsen roblarsen merged commit af86a90 into master Apr 16, 2020
@roblarsen roblarsen deleted the AnonymizeIP branch April 17, 2020 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnonymizeIP for Google Analytics
3 participants