amplitude / amplitude/Amplitude-TypeScript

Ability to add custom identity storage provider in @amplitude/analytics-browser@v2.0.0

未关闭
#448 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
180
派生
68
平均合并
3 天 1 小时
30 天内合并 PR
29

描述

## 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 a `custom` option to `identityStorage` 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 custom `Storage` instance (https://github.com/MystenLabs/sui/blob/main/apps/core/src/utils/persistableStorage.ts) and using that for the `cookieStorageProvider` 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。