Skip to main content
The Katla widget collects cookie consent from your visitors and blocks non-consented cookies from being set.

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>:
Replace {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

  1. The script installs a cookie guard that intercepts document.cookie writes.
  2. If the visitor hasn’t given consent yet, the widget appears.
  3. The visitor chooses their preferences (accept all, reject all, or select categories).
  4. A _katla_consent cookie is stored for 365 days with their choice.
  5. 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.