Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics SDK 3.0 for iOS: Anonymize IPs

Since the iOS SDK 3.0 of Google Analytics has been released, plenty of changes have been made with the API. There is one big problem we encounter that has to do with the anonymize IP feature.

In Germany one has to anonymize the IPs by law when using some tracking framework. With the previous version of the SDK (2.0) it worked like this:

tracker.anonymize = YES;

where tracker is an instance of id<GAITracker>. Now with the version 3.0 one has to use the set method of the tracker:

[tracker set:kGAIAnonymizeIp value:@"?????"];

The signature of the method is

- (void)set:(NSString *)parameterName
      value:(NSString *)value;

and that's the problem. What should the parameter value be? @"YES" or @"NO"? @"ON" or @"OFF"? @"1" or @"0"? Are these parameters case-sensitive?

There is no information about the value in the documentary. Does anyone know what parameter is correct to anonymize the IPs?

like image 743
who9vy Avatar asked Sep 02 '13 21:09

who9vy


People also ask

Does Google Analytics anonymize IP addresses?

The IP-anonymization feature in Universal Analytics sets the last octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to zeros in memory shortly after being sent to Google Analytics. The full IP address is never written to disk in this case.

Does Google Analytics collect IP addresses?

Google collects IP addresses from your website visitors whenever you send a hit to their systems (think each time a page finishes loading). That means every Google Analytics hit from your tags is attached to an IP address. But Google truncates this data before it enters your analytics reports.

How do you anonymize your IP address?

IP anonymization, also known as IP masking, is a method of replacing the original IP address with one that cannot be associated with or traced back to an individual user. This can be done by setting the last octet of IPV4 addresses or the last 80 bits of IPv6 addresses to zeros. For example, 10.200.


1 Answers

Work for me:

[tracker set:kGAIAnonymizeIp value:[@NO stringValue]];

or

[tracker set:kGAIAnonymizeIp value:[@YES stringValue]];
like image 107
Yauheni Shauchenka Avatar answered Oct 11 '22 18:10

Yauheni Shauchenka