clarity
clarity copied to clipboard
how to stop clarity to collect data.
Is there a public method or a setting that can be set to false to stop collecting the data for clarity. we would need this to enable / disable clarity based on end user cookie consent.
Hi @balu4k I believe what you're looking for got merged here: https://github.com/microsoft/clarity/pull/66. I don't think it is in any docs right now, but this could point you in the right direction!
Thanks, will take a look at it.
Hello !!!!! Any news about that ?
We implemented clarity in our system, in order to be GDPR compatible, if a user rejects cookies after have accepted them, we have to tell clarity to stop creating new cookies / OR / to stop working at all :)
How can we do that without refreshing the instance of our application, so that we dont have a bad UX
Thanks ;)
Old question but I'll answer here for anyone that's still looking for clues like I was recently.
Hi @balu4k I believe what you're looking for got merged here: #66. I don't think it is in any docs right now, but this could point you in the right direction!
This answer + some experimentation did help me find a solution. In my experience calling window.clarity('stop')
will do the trick, as in, there will be no more POST request to https://a.clarity.ms/collect
.
Thanks to @dwootton :)
Old question but I'll answer here for anyone that's still looking for clues like I was recently.
Hi @balu4k I believe what you're looking for got merged here: #66. I don't think it is in any docs right now, but this could point you in the right direction!
This answer + some experimentation did help me find a solution. In my experience calling
window.clarity('stop')
will do the trick, as in, there will be no more POST request tohttps://a.clarity.ms/collect
.Thanks to @dwootton :)
How I should use this window.clarity('stop')
??
Please, provide me to stop this fckng POST 204 https://l.clarity.ms/collect
Simply execute window.clarity('stop')
whenever you want to stop the data collection, such as after your user has clicked on a button to refuse the use of Clarity, or on page load (you'll need to check that window.clarity
is defined first, in this case).
You only need to do it once, and there won't be any collect POST request afterwards.
Hii I am currently implementing clarity consent in my angular project as window.clarity('consent',false) showing me error with clarity is not function so if any one have idea about to remove cookie if user want to stop the data sharing once it accepted the cookie and then stop the cookie using general method implemented by me for disable cookie . So any one have idea what is next method .. Thank you in advance
Hello @SouchetJulie, @dwootton!
I am trying to do something similar here #535, but I had no luck. Any idea what the problem might be?
@SouchetJulie don't we need to remove the cookies also (as stated here - https://learn.microsoft.com/en-us/clarity/setup-and-installation/cookie-consent#erase-cookies)? window.clarity('stop')
would just stop calling the /collect call but I think we also need to remove the cookies if user rejects cookies (after accepting first)?
PS: unfortunately the window.clarity('consent', false)
is not working. It did not remove cookies in my system. If anyone else know any other way to remove cookies... kindly help!
window.clarity('consent', false) should remove cookies now (as of 0.7.26).
if you want to stop clarity from running, window.clarity('stop') will work as previously mentioned.
It in fact does not work. We use that version in our project, and I had to open this bug #567