mixpanel / mixpanel-iphone

Official iOS (Objective-C) Tracking Library for Mixpanel Analytics
http://mixpanel.com
Apache License 2.0
1.05k stars 567 forks source link

App clips, identifier for Vendor and unique distinct id #990

Open olarivain opened 2 years ago

olarivain commented 2 years ago

Integration Method: Any Xcode Version: Any Library Version: 4.x, most likely earlier releases too Platform: iOS Language: Any Description:

AppClips have an annoying behavior where identifierForVendor on UIDevice silently returns a zero'd out UUID. This means that anybody passing true for useUniqueDistinctId will end up with all events rolled up under a single identifier, breaking any reports relying on unique events (typically, funnels).

useUniqueDistinctId is also confusingly named. false implies don't use a unique distinct ID, which is kind of weird for an analytics library featuring unique/total for each event, specially given that it's the default value. Looking at the implementation, it's of course not what it does, what it really means is "use device specific distinct identifier" (as opposed to "use a completely random distinct identifier").

You may say "well, don't pass in true for that param in an app clip then", and you wouldn't be entirely wrong. However, a case can be made for either of the following:

I'm happy to send out a PR for this, I'm just not sure which (if any) suggestion you'd rather go with.