Skip to content

Prefer ajs_anonymous_id from cookies to LocalStorage #47

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

Conversation

QoLTech
Copy link

@QoLTech QoLTech commented Dec 17, 2023

Addresses the issue I'm having here.

If the file we're trying to grab from LocalStorage is userInfo, also try to grab the browser cookies and parse out the "ajs_anonymous_id". If it's not null, replace LocalStorage.anonymousId with the value from the cookie. This allows us to keep our anonymousId tracking consistent across Analytics.js and analytics_flutter.

Your _readFromStorage is generic and I'm introducing changes specific to an individual file, so this probably isn't ideal, but it at least gives you a visualization what I'm trying to do.

@QoLTech QoLTech force-pushed the prefer-cookies-to-local-storage-for-anonymous-id branch 2 times, most recently from 9515c99 to f73fe72 Compare December 17, 2023 21:12
@QoLTech QoLTech closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant