Spaces:
Configuration error

README / frontend /src /utils /handle-capture-consent.ts
gauravanu001's picture
upload
2d63f96 verified
Raw History Blame Contribute Delete
382 Bytes
import posthog from "posthog-js";
/**
* Handle user consent for tracking
* @param consent Whether the user consents to tracking
*/
export const handleCaptureConsent = (consent: boolean) => {
if (consent && !posthog.has_opted_in_capturing()) {
posthog.opt_in_capturing();
}
if (!consent && !posthog.has_opted_out_capturing()) {
posthog.opt_out_capturing();
}
};