bcc-code / bcc-media-app

[BCC Media] Video-on-demand app for iOS and Android
https://apps.apple.com/no/app/brunstadtv/id913268220
Apache License 2.0
16 stars 3 forks source link

Investigate what anonymous ID in RS for kids #418

Closed mulundapm closed 3 months ago

andreasgangso commented 3 months ago

Note: These things are a bit tricky to verify but I think it's correct as far as I understand after reading RS code and checking metabase. Also, for reference: The first released version on android was May 22 (v4.4.1) The redesigned kids app was released Nov 10th 2023 on android (v5.0.8)

iOS

Version <4.9.0 (up to sep 11 2023): Based on device id (same across same vendor, so probably same as bcc media). Version >4.9.0 (sep 11 2023 -> now): Existing device IDs are cleared. Always a persistent UUID per install.

Android

TLDR ANDROID Version <4.4.8 (up to june 7 2023): Anonymousid was based on deviceid, which is per-device unique and consistent across installs on the same device. Between v4.4.8-v4.9.0 (june 7 2023 -> sep 11 2023): Based on device id for existing installs. All new installs get a random UUID on each open. Between >4.9.0 (sep 11 2023 -> now): Existing device IDs are cleared. Always a persistent UUID per install.

History AnonymousId used to be == deviceID. For kids, since rudderstack hadn't implemented a way to disable this, I implemented a workaround via a fork: https://github.com/andreasgangso/rudder-sdk-android/commit/ef8d0919d196d2e9e39cbdd354410294d88e26d0 This was included ever since Bible Kids v4.4.8, released on June 7, 2023.

This made the anonymousId unique every launch, for new installs. Existing installs that used deviceId continued to use deviceId. I think that's why we can still observe multiple "application opened" with "backgrounded: false" even after 4.4.8:

Image https://metabase.bcc.media/question/755-average-count-opened-by-app-version

Later on RS implemented a separation of deviceId and anonymousId, available in rudder_sdk_flutter version 2.5.0, which we upgraded to in Kids v4.9.0 (https://github.com/bcc-code/bcc-media-app/commit/999a416691ddc66e37e5d49895b2c7405cd8ea90#diff-e125d55a387d4b24048735f9ca6508c4e860f5ca1f3242edfd9df27e7d8a7af0R1392), released Sep 11, 2023. From that point on, the anonymousId would always be a UUID and it would be saved for the lifetime of that install.

Traits anonymousId vs anonymousId It's hard to follow their source code for anonymousId on android especially, but as far as I can tell, the "Traits anonymousid" and "anonymousId" is supposed to be the exact same thing. I have no idea why they want to send it duplicated, but I guess it doesnt matter.

Edit: v4.4.8-v4.9.0 there was some inconsistencies between anonymousId and context traits anonymousId. See this chart which is unique ids per android app version: https://metabase.bcc.media/question/756-android-anonymousid-vs-context-traits-anonymous-id

Image

iOS has always been the same in both:

Image