Forum Discussion

kaylaborcovan's avatar
kaylaborcovan
Copper Contributor
Jun 21, 2023

Clarification on window.clarity("consent")

The documentation on granting consent to Clarity is a little vague to me https://learn.microsoft.com/en-us/clarity/setup-and-installation/cookie-consent

Is window.clarity('consent') only supposed to fire when consent has changed? Or is it supposed to fire on every page load?

At first I thought maybe it was supposed to be fired on every page. But then I hunted and found this GitHub thread that mentions the call to window.clarity('stop'); https://github.com/microsoft/clarity/issues/75 and that was useful. So now I'm thinking they just need to be fired appropriately when consent changes, and subsequent page loads will use cookies correctly.


But I'm also wondering if a user grants consent and then later revokes it, do we need to also delete the _clck and _clsk cookies from the browser? Or does Clarity respect the "stop" call and no longer looks at those cookies even though they are still present in the browser?

1 Reply