segmentio / analytics_flutter

The hassle-free way to add Segment analytics to your Flutter app.
MIT License
26 stars 33 forks source link

New ajs_anonymous_id #46

Closed QoLTech closed 4 months ago

QoLTech commented 6 months ago

We've noticed that for users that have this package, we have a different ajs_anonymous_id than what used to be created and stored as a cookie in the browser using the standard Segment.js library.

Our users flow from our marketing website that doesn't use Flutter to our web app that does use Flutter.

Old functionality with Segment.js - When a user visits our marketing site, there is an ajs_anonymous_id cookie set and then when they convert over to our website, Segment.js uses the previously set ajs_anonymous_id in the calls on our Flutter web application. This anonymousId is attached to all of our events.

New functionality with this analytics_flutter - When a user visits our marketing site, there is an ajs_anonymous_id cookie set and then when they convert to our website, analytics_flutter ignores it completely and generates a brand new one when we createClient.

We need these to match to identify which users converted from the website to our application. What can we do here?

Digging in further, I can see that your /store/web.dart uses LocalStorage instead of the browser which explains that part of it. Is it possible to update /store/web.dart to search for a ajs_anonymous_id before grabbing it from analytics-flutter-userInfo.json?