Prerequisites
- A verified domain in Katla
- At least one completed scan
Installation
Add the script tag to your website, either in the<head> or before </body>:
{siteId} with your site ID. You can find the full embed code by running katla install example.com or in your site settings.
Script parameters
You can customize the script behavior with query parameters:How it works
- The script installs a cookie guard that intercepts
document.cookiewrites. - If the visitor hasn’t given consent yet, the widget appears.
- The visitor chooses their preferences (accept all, reject all, or select categories).
- A
_katla_consentcookie is stored for 365 days with their choice. - Non-consented cookies are blocked and any existing disallowed cookies are removed.
Functional cookies are always allowed and cannot be rejected.
Customization
You can customize the widget appearance in your site settings. Available options:
Both light and dark mode colors can be configured independently.
When Regulation is set to
auto, the widget detects the visitor’s region at runtime using timezone and GPC signals. See the CCPA guide and DMA guide for details.
When Google Consent Mode is enabled, the widget script automatically signals consent state to Google Analytics and Google Ads tags. See the Google Consent Mode guide for details.
Other embed formats
Besides the JavaScript widget, Katla provides additional endpoints for your site:Example
Widget example
A Vite multipage example that loads the hosted widget and embeds the policy page.