This is not legal advice. Consult a lawyer for your specific use case.
FastStats supports normal analytics, anonymous cookieless analytics, and fully
disabled collection. Choose an initial mode with consent and change it at
runtime with setConsentMode.
With granted consent, the SDK keeps an anonymous identifier in localStorage
and session state in browser storage. This allows it to recognize returning
visitors and measure sessions. Anonymous mode stores no anonymous identifier,
so visitors cannot be recognized across reloads.
React also exports useOptIn and useOptOut as shortcuts for setting
"granted" and "denied".
Switching to "denied" stops collection and discards data buffered by active
extensions. Switching back starts tracking again. Moving between "anonymous"
and "granted" rotates the page and identity context so the two modes do not
share an anonymous identifier.