Google Analytics

ga('set', 'anonymizeIp', true); - Google Analytics

ga('set', 'anonymizeIp', true);

by gianluigi.zanettini » Sat Jun 13, 2015 2:23 pm

Due to EU "cookie's law" in Italy, we have to add this to our Analytics code:

Code: Select all

ga('set', 'anonymizeIp', true);


I did it on my site, but... could you please add it to the official package?

Thanks on behalf of all the EU forums owners :D
User avatar
gianluigi.zanettini
Registered User
Posts: 109
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Re: ga('set', 'anonymizeIp', true);

by VSE » Sat Jun 13, 2015 4:41 pm

Your code has nothing to do with a user who wants to opt out of cookies. That just anonymizes a users IP address, but does not stop cookies from being stored on their computer (even if they wanted to opt out).

Google has a user opt out documentation, but it requires a front end interface for users to opt out. https://developers.google.com/analytics ... ced#optout

This extension can not implement such a feature since this extension is not also an EU cookie law opt-out extension. However you can add to your own site (or via another extension) something like the example JS code they show in the documentation if you use this extension and are worried about such things.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4882
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: ga('set', 'anonymizeIp', true);

by gianluigi.zanettini » Sat Jun 13, 2015 9:28 pm

If you want to understand why this is related+important, please read the laws pulished here: http://www.garanteprivacy.it/cookie long story short: for the italian law, the cookies set by Google Analytics in anonymizeIp-mode are considered "technical" and thus don't require the site to display a "cookie warning" + wait for the user consent + pay a 150 € legal fee. All these are due without anonymizeIp.

Thanks again for your help.
User avatar
gianluigi.zanettini
Registered User
Posts: 109
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Re: ga('set', 'anonymizeIp', true);

by VSE » Sun Jun 14, 2015 1:06 am

If you are going to allow your users to opt out of cookie storage, then Google Analytics will not track those users, and you will get incorrect analytics data. So if you are concerned about this then you should probably not use Google Analytics on your website - because otherwise your analytics will be incorrect (it will also be incorrect in some ways if you anonymizing IPs) and thus, there is no point to using analytics tracking if you are not tracking all your users or gathering accurate data.

But if you still want to use it, you could modify your site for your own unique needs either by adding that code yourself or the opt-out code sample recommended by Google. Or take a look at the EU Cookie Policy extension.

Ultimately, we are not Google, so using Analytics and dealing with the cookies it stores is a Google issue, and subject to the terms of using G.A. on your site. That is, Google is the organization making the cookie here, not this extension, nor phpBB. And Google is a U.S. based organization outside the jurisdiction of the EU cookie law, technically speaking, which is why Google has not shown any concern over the EU cookie law regarding their Analytics.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4882
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

anonymisation....

by heinrich_k » Sun Jun 21, 2015 1:00 pm

Hi,

there apparently are two ways to use google analytics, one only uses a part of the visitor's IP address and is therefore anonym. This extension should have a description which method is used and (even better) allow to switch between both.
For using the not anonym version might raise legal concerns regarding legal statutes, for example in Germany.

Any clarification on that matter would be nice.

Best regards,
Heinrich
heinrich_k
Registered User
Posts: 195
Joined: Fri Jul 17, 2009 11:40 am
Contact:

Re: ga('set', 'anonymizeIp', true);

by VSE » Sun Jun 21, 2015 2:53 pm

If you want or need to anonymize IPs on your site's GA code, you can try adding this extension add-on:
Attachments
phpbb-gaAnonymizeIp.zip
(9 KiB) Downloaded 147 times
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4882
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: ga('set', 'anonymizeIp', true);

by heinrich_k » Sun Jun 21, 2015 3:10 pm

Ah, my post was merged wit this topic, hadn't realised that before....

So, for clarification to gianluigi.zanettini's "cookie law".
EU law (or German law in my case) are concerned with information of site users that are given to third parties, in this case google. It's not just cookies, but all information. That is why google has this 'anonymizeIp' option implemented. "cookie law" is a term coined by media for the masses, not a technical correct term.

Fact is, the German phpBB homepage has a privacy page, stating that no user information is given to third parties, and my guess is, that is the standard privacy statement phpBB is distributed with. So, if one runs this extension, one fails to adhere to the rights one granted one's users. For an official phpBB extension that is pretty unforeseeable.

Be it as it may, this extension should grant an option to use anonymized IPs - maybe even use it as default.
Google analystics works just fine with all it statistics, even if you do not grant google the possibility to track your users individually.

Actually, even the normal English Terms of Use from this very forum read "As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “phpBB.com” nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised. "
So, sending my IP (which is stored in the database, too) to google is an violation of this statement, if I did not give consent.
heinrich_k
Registered User
Posts: 195
Joined: Fri Jul 17, 2009 11:40 am
Contact:

Re: ga('set', 'anonymizeIp', true);

by VSE » Sun Jun 21, 2015 3:34 pm

https://support.google.com/analytics/an ... 3052?hl=en
http://www.quora.com/Is-Google-Analytic ... in-Germany

This extension is for sites that use Google Analytics. Most sites that use phpBB integrate phpBB into an existing site (phpBB isn't their entire site). And many times those sites will already be using GA, regardless of whether they have phpBB on there or not. This extension simply allows owners of sites to add the G.A. code they may already be using (on the rest of their site), or decide they want to begin using, to the phpBB section of their site, without hacking the core.

If you have been, or will, use the standard GA tracking code, then this extension is for you. If you have, for any reason, needed to create a highly customized G.A. code for your site, then this extension is not for you, and you'll just have to "mod" your forum to insert your custom tracking code if you want the phpBB section of your site tracked by G.A.

It's really just as simple as that. It's not for phpBB or this extension to dive into cookie laws and legalities. That's solely the responsibility of the web master to decide when contemplating adding GA to their site (irrespective of the phpBB section).
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4882
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: ga('set', 'anonymizeIp', true);

by heinrich_k » Sun Jun 21, 2015 4:56 pm

Why would there be a need to mod it yourself, if this extension would simply allow to choose between the IP maked version of GA, and the normal one?

In any case, an official mod to phpBB should address such concerns in the about section, warning people who use it, that they might become legally liable.

EDIT: also, it doesn't make much of a difference, if there are other pages besides the phpBB on any given domain. If domain.tld/phpBB/index.php is called no other scripts are run and even if the other pages of the homepage would use ip-masked GA the phpBB-generated sites would not and that would be defeating the purpose.
heinrich_k
Registered User
Posts: 195
Joined: Fri Jul 17, 2009 11:40 am
Contact:

Re: ga('set', 'anonymizeIp', true);

by VSE » Mon Jun 22, 2015 6:27 pm

heinrich_k wrote:Why would there be a need to mod it yourself, if this extension would simply allow to choose between the IP maked version of GA, and the normal one?

Some people have highly customised GA tracking codes that might include Google Adsense tracking, session tracking, or other possible options that stray from the standard GA code. That kind of tracking code is built within the Google Adsense site. A phpBB extension can not create that kind of code. So it only uses the generic standard GA tracking code that comes out of the box, which most users will use.

heinrich_k wrote:In any case, an official mod to phpBB should address such concerns in the about section, warning people who use it, that they might become legally liable.

GA is a 3rd party service. All rules, regulations and liabilities that come with using it are between the web site owner and Google. This extension does nothing except allow web owners who have already signed up for Google Analytics to easily add it to their forum too, without editing any files.

This extension was also designed to be extended by add-on extensions that can be optionally installed by users who want to make use of these rare/edge case scenarios such as mentioned in this topic.

However, as mentioned, if you are not using the out of the box GA code, then don't use this extension, and you'll just have to copy/paste your custom GA code into phpBB yourself, just as you'd do for any other part of your site.

The contribution page has been updated to clarify that this extension is for users who use the default tracking code.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4882
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: ga('set', 'anonymizeIp', true);

by heinrich_k » Mon Mar 13, 2017 1:55 pm

Still, as the official Extension for Google analytics the Extension should allow for this basic functionallity.

It is one additional call to add, and it is a privacy concern.

And to be blunt, I find it kind of shocking, that the option appears no to be turned on on phpbb.com itself.
heinrich_k
Registered User
Posts: 195
Joined: Fri Jul 17, 2009 11:40 am
Contact:

Re: ga('set', 'anonymizeIp', true);

by eindgebruiker » Mon Nov 05, 2018 9:22 pm

In the changelog I read:
1.0.4 - 2018-05-17
Added an option to enable visitor IP anonymization. This is recommended by Google to make the data collected for Analytics compliant with the EU‘s GDPR laws which go into effect May 25, 2018.
That's fine.

However in 1.0.2 a feature was added, which cannot be turned off, which automatically sends the userid to Google:

Code: Select all

ga('set', 'userId', <userid>);
A userid in combination with a site is personally identifiable information. This is not compliant with the GDPR.

To allow compliancy with the GDPR this should be made configurable.
eindgebruiker
Registered User
Posts: 19
Joined: Thu Oct 11, 2018 8:09 am
Contact: