amplitude / amplitude/Amplitude-TypeScript

identityStorage prop not being respected

Đang mở
#603 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
180
Fork
68
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
29

Mô tả

## Expected Behavior

- When I set `identityStorage` in the `init` config to `none`, `AMP` cookies wont be stored on browser.

## Current Behavior

When I set `identityStorage` to `none` for an existing user (who has been tracked previously) I can see that the `AMP` cookies are still being set in the browser. When I do this on incognito though, the cookies are not being set (and it uses in memory storage)

Also, the [current recommendation](https://github.com/amplitude/Amplitude-TypeScript/issues/448#issuecomment-1610270679) for updating `internalStorage` on cookie consent is to re-call the `init` function, but when using `@amplitude/analytics-browser` with the Amplitude generated event class file, you can only call `ampli.load` once (which calls the init fn), after that it throws the error:
> ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?

## Possible Solution

- `internalStorage: none` should be respected in all cases.
- Create an amplitude function to update the `internalStorage`, without having to call `init` again. eg.
```
this.amplitude.setInternalStorage('none')
```

## Environment
- JS SDK Version: 2.3.2
- Installation Method: yarn
- Browser and Version: Chrome 118

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.