-
Notifications
You must be signed in to change notification settings - Fork 38
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
Ability to add custom identity storage provider in @amplitude/analytics-browser@v2.0.0 #448
Comments
Hi @williamrobertson13, thank you for choosing Amplitude. We like hearing from our customers so we really appreciate sharing this with us. I'm more than happy to find the best path forward for you. Before anything else, I'd like to hear more.
Can you elaborate on this point more? I'd also like to explore opportunities on how to improve our deferred initialization logic, even if end up moving forward with a different solution for you. |
Hey @kevinpagtakhan! Thanks for the quick response. So to elaborate on the problem with deferred initialization - a lot of folks don't accept or reject consent to use tracking cookies when prompted with consent banners on websites. With the current solution of deferred initialization, a user could go to a site -> do all sorts of actions without ever accepting/rejecting consent -> leave the site and Amplitude won't ever initialize and log events. As one alternative solution, I suppose maybe you could add a |
hey @williamrobertson13 you can set identityStorage to None on init, like this: This stores everything in memoryStorage, which is wiped when the user abandons the website. You can reinitialize like this once the user consents to cookies: |
Hey, is it correct to call |
I'm wondering about the same thing as @RubenZx ,
|
I share the same interest. From what some of our testing has shown, custom plugins do not work after re-initialization. |
Summary
The
cookieStorageProvider
property was removed in v2.0.0 of the Browser SDK, so this blocks us from being able to specify a custom storage provider for GDPR compliance purposes. It would be amazing if the SDK provided this type of functionality out of the box (e.g.switchIdentityStorage
) or added acustom
option toidentityStorage
so folks can provide custom storage providers again.Motivations
For GDPR compliance, we would like to track users using memory storage and then switch to cookies only after users have provided their consent to use tracking cookies. We were able to do this in
@amplitude/analytics-browser@v1.0.0
by creating a customStorage
instance (https://github.com/MystenLabs/sui/blob/main/apps/core/src/utils/persistableStorage.ts) and using that for thecookieStorageProvider
property. We're aware of the default recommended solution of deferring the initialization of Amplitude until users have provided consent, but that isn't quite the same and we miss out on potentially useful insights.The text was updated successfully, but these errors were encountered: