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

Setting storage to 'none' still sets some local storage values #614

Closed
ordishg opened this issue Jan 21, 2025 · 3 comments · Fixed by amplitude/amplitude-docs#483
Closed
Labels
bug Something isn't working

Comments

@ordishg
Copy link

ordishg commented Jan 21, 2025

Expected Behavior

When the storage option is set to 'none', amplitude should not set any cookies or local storage.

Current Behavior

Amplitude still sets the amplitude_unsent_* and amplitude_unsent_identify_* values.

If this is expected behaviour, then it would be helpful for this to be documented on the storage option.

Steps to Reproduce

  1. Initialise Amplitude with the option storage: 'none'
  2. Visit the page with Amplitude running on it
  3. Check local storage
  4. Find that there are local storage values set by amplitude

Environment

  • JS SDK Version: 8.21.9
  • Installation Method: yarn
  • Browser and Version: Firefox 133.0.3 (64-bit)
@ordishg ordishg added the bug Something isn't working label Jan 21, 2025
@Mercy811
Copy link
Contributor

Hi @ordishg, config.storage is for metadata (identity info) only https://github.com/amplitude/Amplitude-JavaScript/blob/a9ff3247829bba9fccb60dcf83337809e83f1c04/src/metadata-storage.js. Unsent events are always saved in local storage and it's not configurable. If you'd like to not save unsent events, you can migrate to Browser 2.0 which supports setting config.storageProvider.

@ordishg
Copy link
Author

ordishg commented Jan 27, 2025

Hi @Mercy811, thanks for clarifying. It seems to me like setting saveEvents to false should avoid saving unsent events to local storage, even without migrating to Browser 2.0. Am I misunderstanding what that config option does?

@Mercy811
Copy link
Contributor

saveEvents should work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants