[Privacy] Google Analytics anonymize Ip

RESOLVED FIXED

Status

Websites
Web Analytics
--
major
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: sjw, Unassigned)

Tracking

({privacy})

Details

(Whiteboard: [kb=1270272][qa-], URL)

(Reporter)

Description

5 years ago
I propose to anonymize the IPs, that are sent to Google.
(Reporter)

Updated

5 years ago

Comment 1

5 years ago
More info here too:

https://support.google.com/analytics/answer/2905384?hl=en

We don't have access to IPs in GA to start and this would only reduce geo accuracy some. When we are doing A/B testing and funnel analysis, we are usually at the country level for geography.
(Reporter)

Comment 2

5 years ago
Of course it's a goal conflict, but I think we should prefer the privacy.

Comment 3

5 years ago
Gareth: Can you check to see if this anonymizer function works with Universal Analytics and the GA tag manager?
Flags: needinfo?(garethcull.bugs)
Chris: Yes. There is an anonymizer function in Universal Analytics. More details available here:
https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#anonymizeip

Also, there is a setting available in GTM here: https://support.google.com/tagmanager/answer/3281077?hl=en
Flags: needinfo?(garethcull.bugs)

Comment 5

5 years ago
Users can also totally opt-out of GA via an add-on:

http://www.mozilla.org/en-US/privacy/policies/websites/#opt-out
(Reporter)

Comment 6

5 years ago
(In reply to Chris More [:cmore] from comment #5)
> Users can also totally opt-out of GA via an add-on:
> 
> http://www.mozilla.org/en-US/privacy/policies/websites/#opt-out

An Add-On would just be a workaround. You could use NoScript, too or disable JavaScript. But I think Mozilla should also do something on their own to protect users privacy and this is a way to get still the statistics.
(Reporter)

Comment 7

5 years ago
Also note that in some states (e.g. Germany) you *have to* use this snippet.
(Reporter)

Comment 8

4 years ago
This week was the #DPD14. It would be a good time to enable this feature. :)
Flags: needinfo?(chrismore.bugzilla)
(Reporter)

Updated

4 years ago
Keywords: privacy

Comment 9

4 years ago
(In reply to Gareth Cull [:garethc] from comment #4)
> Chris: Yes. There is an anonymizer function in Universal Analytics. More
> details available here:
> https://developers.google.com/analytics/devguides/collection/analyticsjs/
> advanced#anonymizeip
> 
> Also, there is a setting available in GTM here:
> https://support.google.com/tagmanager/answer/3281077?hl=en

Gareth: Can you put the classic analytics tags here with the anonymizeIp so that we can get a PR done?
Flags: needinfo?(chrismore.bugzilla) → needinfo?(garethcull.bugs)
Here you go. We need to add _gaq.push (['_gat._anonymizeIp']); prior to _trackPageview in the GA Snippet:

var _gaq = _gaq || [];
_gaq.push (['_setAccount', 'UA-XXXXXXX-YY']);
_gaq.push (['_gat._anonymizeIp']);
_gaq.push (['_trackPageview']);

https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat#_gat._anonymizeIp
Flags: needinfo?(garethcull.bugs)

Comment 11

4 years ago
(In reply to Gareth Cull [:garethc] from comment #10)
> Here you go. We need to add _gaq.push (['_gat._anonymizeIp']); prior to
> _trackPageview in the GA Snippet:
> 
> var _gaq = _gaq || [];
> _gaq.push (['_setAccount', 'UA-XXXXXXX-YY']);
> _gaq.push (['_gat._anonymizeIp']);
> _gaq.push (['_trackPageview']);
> 
> https://developers.google.com/analytics/devguides/collection/gajs/methods/
> gaJSApi_gat#_gat._anonymizeIp

Ok, so the complete tag should be:

<script>
var _gaq = _gaq || [];
var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'UA-36116321-1']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowAnchor', true]);
_gaq.push(['_gat._anonymizeIp']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;

    var prefix = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www');
    ga.src = prefix + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
})();
</script>

right?
Looks good Chris.

Comment 13

4 years ago
Gareth: can you review this PR?

https://github.com/mozilla/bedrock/pull/1686

Comment 14

4 years ago
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/895bc7ce7ad2709b2a677ac2196c04c8619665fd
Bug 946705: Add anonymize tag to GA

https://github.com/mozilla/bedrock/commit/51b40b563c327e5865fd519264d05cba771f022e
Merge pull request #1686 from chrismore/anonymize-ga-ips-bug-946705

Bug 946705: Add anonymize tag to GA

Updated

4 years ago
Whiteboard: [kb=1270272]
(Reporter)

Comment 15

4 years ago
Yay, thanks for making this decision!
Before you launch the new script to the sites I'll push bug 946697, which could be included in this small update.
fixed on stage www.allizom.org
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Comment 19

4 years ago
Commit pushed to master at https://github.com/mozilla/remo

https://github.com/mozilla/remo/commit/4ea92884bd0649073235d3622325bf5ad8345953
[bug 946705] Update Google Analytics options.

* Mask IPs that are send to Google.
* setAllowLinker == true
* setAllowAnchor == true

Updated

4 years ago
Whiteboard: [kb=1270272] → [kb=1270272][qa-]

Comment 20

4 years ago
Commit pushed to master at https://github.com/mozilla/nocturnal

https://github.com/mozilla/nocturnal/commit/af405d7351a722ae9343e9a5ebf74c01e0e5c437
Update index.html

See bug 946705, bug 946697 
Updated URLS to https
Corrected Facebook URL
You need to log in before you can comment on or make changes to this bug.