-
Notifications
You must be signed in to change notification settings - Fork 261
Add CMPs #1009
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
base: master
Are you sure you want to change the base?
Add CMPs #1009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for 9 new Consent Management Platform (CMP) integrations to Clarity's consent tracking system, adds an "Unknown" consent source, and makes adjustments to consent fallback behavior and cookie clearing logic.
- Adds enum values for CMPs: MyAgilePrivacy, UserCentrics, Cookiebot, Axeptio, Cookiehub, CookieYes, WebTofee, WPConsent, and SeersAI (values 150-158)
- Introduces
ConsentSource.Unknown(value 255) and updates the fallback fromImplicittoUnknowningetConsentData() - Changes cookie expiration parameter from
-Number.MAX_VALUEto0in theclear()function
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/clarity-js/types/data.d.ts | Adds 9 new CMP enum values (150-158), adds Unknown enum value (255), and includes a SharePoint reference URL in comments |
| packages/clarity-js/src/data/metadata.ts | Updates default consent source fallback from Implicit to Unknown, changes cookie expiration values from -Number.MAX_VALUE to 0 |
| export function clear(all: boolean = false): void { | ||
| // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time | ||
| setCookie(Constant.SessionKey, Constant.Empty, -Number.MAX_VALUE); | ||
| setCookie(Constant.SessionKey, Constant.Empty, 0); |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the cookie expiration from -Number.MAX_VALUE to 0 may not properly clear the cookie in all browsers. The value 0 creates a cookie that expires "0 days from now", which could be interpreted differently by browsers. Using a negative value like -1 is the more standard approach to ensure cookies are immediately expired and deleted. Consider using -1 instead of 0 for more reliable cookie deletion across all browsers.
| // Clear user cookie as well if all flag is set | ||
| if (all) { | ||
| setCookie(Constant.CookieKey, Constant.Empty, -Number.MAX_VALUE); | ||
| setCookie(Constant.CookieKey, Constant.Empty, 0); |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the cookie expiration from -Number.MAX_VALUE to 0 may not properly clear the cookie in all browsers. The value 0 creates a cookie that expires "0 days from now", which could be interpreted differently by browsers. Using a negative value like -1 is the more standard approach to ensure cookies are immediately expired and deleted. Consider using -1 instead of 0 for more reliable cookie deletion across all browsers.
34d843c to
3f91f50
Compare
No description provided.