Skip to content
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

__anon_id purpose #345

Open
Siot opened this issue Nov 24, 2022 · 1 comment
Open

__anon_id purpose #345

Siot opened this issue Nov 24, 2022 · 1 comment

Comments

@Siot
Copy link

Siot commented Nov 24, 2022

Hi @DavidWells and thank you for this project.

We are currently integrating this tool in a project. But to acomplish legal requirements (RGPD) we need to explain, and offer opt-in/out, any data stored in the browser. Then,

whats the purpose of __anon_id stored in localStorage?
why is setted once Analytics is initialized? (even with all plugins disabled)

We have used a plain basic config:

{ app: 'gestio-emocional', debug: false, plugins: { // google-analytics... // google-analytics-v3... }, }

Our first strike is to initialize Analytics ASAP and enable plugins after user consent, but maybe we have to delay Analytics initialization after user consent.

Thank you.

@dobesv
Copy link
Contributor

dobesv commented Nov 30, 2022

It's a good question, I'm not sure if any of the plugins make use of this currently. In our app we have our own custom analytics backend so that __anon_id acts as a session identifier we can use to track a user's activity prior to login. If they do login later we can link the activity from that anonymous ID to that user assuming it was them all along.

My guess is that it was replicated over from the segmentio analytics library that this is based on but it's potential has not yet been realized.

You can disable the use of localStorage by the library by passing storage: null as an option to the analytics constructor if I'm not mistaken. If you don't need the __anon_id or want to use analytics.storage to store persistent data that should do the trick.

Also I'm trying to propose something more smart & useful here:
#346

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

No branches or pull requests

2 participants