-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SuperProperties are not registered during init before the automatic events are tracked. #658
Comments
@gulcebasar I'm not able to repro. Make sure you are using the latest version of the SDK:
https://github.com/mixpanel/mixpanel-swift/blob/master/Sources/MixpanelInstance.swift#L1303-L1304 https://github.com/mixpanel/mixpanel-swift/blob/master/Sources/MixpanelInstance.swift#L1059-L1066 with this code:
I can see |
Hello @jaredmixpanel can you please try it with Mixpanel.initialize(token: "MY_TOKEN", trackAutomaticEvents: true, optOutTrackingByDefault: true, superProperties: ["init_prop": "1.0"]) I checked it again and I think the issue might be caused by Super properties are not registered when |
@gulcebasar https://docs.mixpanel.com/docs/tracking-methods/sdks/swift#opt-out-of-tracking |
Ok so my current flow is as follows: mixpanelInstance = Mixpanel.initialize(token: "MY_TOKEN", trackAutomaticEvents: true, optOutTrackingByDefault: true, superProperties: ["init_prop": "1.0"]) then after opt in I have mixpanelInstance?.optInTracking()
mixpanelInstance?.registerSuperPropertiesOnce(["init_prop": "1.0"]) and my tracked events are
OR I could possibly do mixpanelInstance?.optInTracking(properties: ["init_prop": "1.0"])
mixpanelInstance?.registerSuperPropertiesOnce(["init_prop": "1.0"]) then I would have
But currently, due to this if mixpanel-swift/Sources/Track.swift Line 89 in 61ce9b4
it is not possible to register super properties before opt-in and there is no way to add a super property to the tracking of First App Open while using optOutTrackingByDefault: true
I would like to have a way of adding my super properties also to |
@gulcebasar I see, I see... you've actually found a different bug.
This sequence should NOT produce a The reason it does get tracked is because we check the opt out status outside of the tracking queue, but the opt out update is inside the tracking queue, so we end up checking the status before the update has been processed. https://github.com/mixpanel/mixpanel-swift/blob/master/Sources/MixpanelInstance.swift#L1059-L1061 https://github.com/mixpanel/mixpanel-swift/blob/master/Sources/MixpanelInstance.swift#L1496-L1520 If a user is opted out, the Mixpanel SDK should not be tracking anything. There should not be ANY tracked events with timestamps prior to the If you still want to capture data about your users while they are opted out, you'll need to implement your own So you'd just need to set a similar key:value pair in your own |
Thank you, |
@gulcebasar For now, you can do...
|
I am trying to use
to register super properties before tracking of the automatic events
but since registerSuperProperties is async
automaticEvents.initializeEvents(instanceName: self.name)
is run before super properties are set.Is it possible to fix this issue?
The text was updated successfully, but these errors were encountered: