How CCPA mode differs from GDPR
The guard runs in both regimes. Before a choice, CCPA mode lets every category through; once a visitor opts out, the guard deletes the cookies outside the functional category and refuses new ones, so an analytics script cannot write back what the opt-out removed.
Choosing the regime
Set the regulation in your site’s settings in the dashboard: Auto (Recommended), GDPR, or US State Laws (CCPA). With Auto, the default, the regime is picked in the visitor’s browser from their timezone:- A timezone starting with
America/gets CCPA. - Every other timezone gets GDPR.
Global Privacy Control (GPC)
GPC is a browser-level signal that tells websites the user does not want their data sold or shared. Under the CCPA regulations, businesses must treat it as a valid opt-out request. When the browser sends GPC and the visitor has not made a choice on your site yet, Katla records the signal as their choice straight away:- CCPA mode: an opt-out of sale and sharing, recorded with
consentType: 'optedOut'. The banner confirms it: “Your Global Privacy Control signal has been honored.” - GDPR mode: a Reject All. “Do not sell or share” has no meaning there, but “no non-essential cookies” does.
Checking GPC programmatically
.well-known/gpc.json
To declare that your site honours GPC, deploy a .well-known/gpc.json file on your domain:
The banner in CCPA mode
- Title: “Your Privacy Choices”
- Description: tells visitors that personal information is collected, and that they can opt out of its sale or sharing
- “Do Not Sell or Share My Personal Information”: the primary button. Records an opt-out.
- “Close”: records a refusal, keeping functional cookies only. It is not a silent dismiss: a visitor who has seen the notice and closed it is treated as not wanting their information sold or shared, which is the reading that cannot hurt them.
- “Cookie Preferences”: opens the preferences, where the marketing category is labelled “Sale/Sharing of Personal Information” and an “Opt Out of All” button is available.
What an opt-out does
- Stores
opted_outin the_katla_consentcookie, which lasts 365 days. - Records
consentType: 'optedOut',regulation: 'ccpa'and the categories['functional']. - Deletes cookies outside the functional category, and the guard refuses new ones.
- Keeps scripts marked with
data-katla-categoryheld back.
KatlaConsent.withdrawConsent() is an opt-out in CCPA mode, and a Reject All in GDPR mode.
Consent records
Every choice is sent to the consent API with its type, categories, regulation and time. The server stores it with a truncated IP address and the visitor’s country, and keeps the latest decision for each visitor. The types you will see in CCPA mode:optedOut: the visitor opted out, or their browser sent GPCrejected: the visitor pressed Closepartialandall: the visitor turned some or all categories on in the preferences
Google Consent Mode interaction
Before a choice, the Consent Mode default is denied for all four signals in both regimes, withwait_for_update: 500.
When a visitor opts out, all four are updated to denied:
Analytics is denied as well, because an opt-out leaves only functional cookies allowed and the guard refuses analytics cookies. Telling Google otherwise would have Google tags try to write cookies the opt-out forbids. A returning visitor who opted out starts from the same four denials.
Privacy policy link
SetprivacyPolicyUrl in your widget settings to display a “Privacy Policy” link in the consent banner and preferences modal: