amplitude / amplitude/Amplitude-TypeScript

Still sets cookies even though optOut:true

Open
#1,078 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
180
Forks
68
Avg merge
3d 1h
Merged PRs (30d)
29

Description

## Expected Behavior
Cookies are not set

## Current Behavior
Cookies e.g. `AMP_bd878e3198` and `AMP_MKTG_bd878e3198` are set

## Possible Solution
- Library should not set cookies if `optOut: true` is set in init
- https://amplitude.com/docs/get-started/cookies-and-consent-management should cover how to manage consent with this library rather than some other library

## Steps to Reproduce

```ts
import { init } from "@amplitude/analytics-browser";
// ...
init(apiKey, undefined, {
optOut: true,
});
```

## Environment
- JS SDK Version: `@amplitude/analytics-browser` `2.17.4`
- Installation Method: pnpm
- Browser and Version: Chrome 136

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.