Last Updated: February 25, 2016
·
1.395K
· otupman

Anonymise Google Analytics on iOS

I spent a fair old while looking for this - the Google Analytics documentation describes the GA anonymisation of IPs for the JavaScript tracker, but I found very few hits for the iOS SDK.

In fact, once I found the particular setting, I found something like 7. If you're not digging through the settings you'll miss it.

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
if(tracker) {
    // Anonymise the user's IP address (as per GA documentation).
    [tracker set:kGAIAnonymizeIp value:[@YES stringValue]];
}