clarity icon indicating copy to clipboard operation
clarity copied to clipboard

how to stop clarity to collect data.

Open balu4k opened this issue 4 years ago • 8 comments

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.

balu4k avatar Dec 16 '20 00:12 balu4k

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!

dwootton avatar Dec 17 '20 16:12 dwootton

Thanks, will take a look at it.

balu4k avatar Dec 17 '20 18:12 balu4k

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 ;)

mmonteiroc avatar Mar 11 '22 07:03 mmonteiroc

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 :)

SouchetJulie avatar Jul 22 '22 09:07 SouchetJulie

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 :)

How I should use this window.clarity('stop') ?? Please, provide me to stop this fckng POST 204 https://l.clarity.ms/collect

teosoph avatar Aug 06 '22 22:08 teosoph

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.

SouchetJulie avatar Aug 07 '22 12:08 SouchetJulie

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

HemangDholu avatar Jan 30 '24 09:01 HemangDholu

Hello @SouchetJulie, @dwootton!

I am trying to do something similar here #535, but I had no luck. Any idea what the problem might be?

M7m00d avatar Feb 18 '24 12:02 M7m00d

@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!

nik32 avatar Mar 16 '24 08:03 nik32

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.

ender336 avatar Apr 03 '24 17:04 ender336

It in fact does not work. We use that version in our project, and I had to open this bug #567

mmonteiroc avatar Apr 04 '24 06:04 mmonteiroc