amplitude / amplitude/Amplitude-TypeScript

identityStorage prop not being respected

Abierto
#603 6 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
180
Forks
68
Merge medio
3 d 1 h
PR fusionados (30 d)
29

Descripción

## 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.