to stop data collection and clear cookies in the browser when the user revokes consent which is previously granted
491 accepted a boolean parameter in call to window.clarity('consent') to indicate whether the user accepted or revoked consent
if false is passed as the parameter, i.e. window.clarity('consent', false), the existing cookies are cleared in the browser and the data collection stops.
however, a new session is started after 250ms and the new cookies are created and the data collection resumed.
How?
by introducing the second boolean parameter, a new session creation can be prevented
calling window.clarity('consent', false, false) will clear the browser cookies and stop the data collection, and will not start a new session inline with the user's intention of revoking consent.
Why?
491 accepted a boolean parameter in call to
window.clarity('consent')
to indicate whether the user accepted or revoked consentfalse
is passed as the parameter, i.e.window.clarity('consent', false)
, the existing cookies are cleared in the browser and the data collection stops.How?
window.clarity('consent', false, false)
will clear the browser cookies and stop the data collection, and will not start a new session inline with the user's intention of revoking consent.