mixpanel / mixpanel-iphone

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

Several events are silently dropped after calling createAlias #904

Closed zkhalapyan closed 3 years ago

zkhalapyan commented 4 years ago

Integration Method: CocoaPods Xcode Version: Version 11.5 (11E608c) Library Version: Mixpanel-swift (2.7.3) Platform: iOS Language: Swift Description:

I log "did_view_login", then the user logs in, I create an alias with their user ID, then I call "did_login", and a few other events as user goes through onboarding. I have noticed that the first few events after calling createAlias are silently dropped. No error, no indication of problem or warning.

If the user logs out, logs back in where I only call identity(), all onboarding events are properly called. So it's something with calling createAlias that drops these first events.

Seems like https://github.com/mixpanel/mixpanel-iphone/issues/824 is a similar issue but hasn't been addressed for 6 months now.

High-level steps:

  1. Reset Mixpanel from dashboard so we start from a clean slate
  2. Initialize Mixpanel:
    Mixpanel.initialize(token: "XYZ", flushInterval: 10)
  3. Log event 1 ("did_view_login")
  4. Create alias with some ID:
    Mixpanel.mainInstance().createAlias(result.user.uid, distinctId: Mixpanel.mainInstance().distinctId)
  5. Log event 2 ("did_login")
  6. Log event 3

Notice that event 2 and 3 are not logged!

I have not found a workaround other than not using createAlias 🤕.

Expected Behavior: All events should be logged properly; if they are not, at least give me some error so I know what's the issue, so that I don't have to launch an app and only post analysis realize there is this major issue 😢

zihejia commented 4 years ago

hi @zkhalapyan , thanks so much to bring this up. Do you mind to create the same issue to our swift repo? https://github.com/mixpanel/mixpanel-swift

zkhalapyan commented 4 years ago

Created https://github.com/mixpanel/mixpanel-swift/issues/379, feel free to close this if that's better for your tracking 😊

jaredmixpanel commented 3 years ago

https://github.com/mixpanel/mixpanel-swift/issues/379#issuecomment-659718055