# Docs — integrate consent in minutes — Cookie Panda

**Source:** https://cookiepanda.app/docs  
**Summary:** Cookie Panda developer docs: drop-in web snippet, native SDKs for iOS, Android, Flutter and Connected TV, the IAB TCF & GPP consent APIs and DSAR intake.  
**Publisher:** Cookie Panda

---

Docs

## Integrate consent in minutes

A drop-in snippet for the web, native SDKs everywhere your users are, and the standard consent APIs you already know. Everything you need to evaluate and integrate Cookie Panda — no account required.

**On this page:**  [Quickstart](page:/docs#quickstart) · [Install](page:/docs#install) · [Configuration](page:/docs#configuration) · [Reopening the banner](page:/docs#reopen) · [Desktop, mobile & custom banners](page:/docs#banner-design) · [API & MCP](page:/docs#api) · [Frameworks & signals](page:/docs#frameworks) · [Consent API](page:/docs#consent-api) · [Data subject requests](page:/docs#dsar)

## Quickstart {#quickstart}

Add one async script tag to your site and Cookie Panda handles consent end to end. Drop it in your `<head>` ahead of any analytics or advertising tags so trackers stay blocked until the visitor decides.

```html
<!-- Add to your <head>, before any tracking scripts -->
<script
  src="https://sdk.cookiepanda.app/cookiepanda.min.js"
  data-cp-token="cp_xxx"
  data-cp-api="https://edge.cookiepanda.app"
  async
></script>
```

### What happens automatically {#what-happens-automatically}

- Geo-detects the visitor and applies the right jurisdiction (GDPR, CCPA/CPRA, LGPD and more).
- Renders your consent banner using the copy, colours and layout configured in the dashboard.
- Blocks cookies and tracking scripts before consent, then unblocks the moment a visitor opts in.
- Emits Google Consent Mode v2 signals and the IAB TC and GPP strings as choices change.

## Install {#install}

Cookie Panda ships native SDKs for every surface, all sharing one consent record. Pick your platform below, then follow the platform guide for the full setup.

### Web — script tag ([guide](page:/platforms/web)) {#web-script-tag-guide}

```html
<script
  src="https://sdk.cookiepanda.app/cookiepanda.min.js"
  data-cp-token="cp_xxx"
  data-cp-api="https://edge.cookiepanda.app"
  async
></script>
```

### iOS — Swift Package Manager ([guide](page:/platforms/ios)) {#ios-swift-package-manager-guide}

```swift
// Package.swift
dependencies: [
  .package(
    url: "https://github.com/cookiepanda/cookiepanda-ios.git",
    from: "1.0.0"
  )
]
```

### Android — Gradle ([guide](page:/platforms/android)) {#android-gradle-guide}

```kotlin
// build.gradle.kts (app)
dependencies {
  implementation("app.cookiepanda:sdk:1.0.0")
}
```

### Flutter — pub ([guide](page:/platforms/flutter)) {#flutter-pub-guide}

```bash
flutter pub add cookie_panda
```

### Connected TV {#connected-tv}

Native consent SDKs and TV-optimised banners for Apple tvOS, Android TV, Roku and Amazon Fire TV — remote-friendly and IFA-aware, sharing the same consent record as web and mobile. Guides: [tvOS](page:/platforms/tvos) · [Android TV](page:/platforms/androidtv) · [Roku](page:/platforms/roku)

## Configuration {#configuration}

The web loader needs one data attribute; a few optional ones override dashboard settings per page. Everything else — banner copy, colours, layout and theme — is managed visually in the dashboard, so you rarely need to touch code again after install.

- **`data-cp-token`** (required) — your public site token (`cp_…`). Identifies the site so the right configuration loads. Safe to expose in client-side code.
- **`data-cp-api`** (optional) — consent edge endpoint. Defaults to `https://edge.cookiepanda.app`; override only for a custom domain.
- **`data-cp-launcher`** (optional) — `icon`, `auto` or `none`: overrides the dashboard's reopen-button setting for this page. See [Reopening the banner](page:/docs#reopen).
- **`data-cp-theme`** (optional) — `system`, `site`, `light` or `dark`: overrides the dashboard's colour scheme.
- **`data-cp-locale`** (optional) — force a language instead of the visitor's browser language.

Banner text, languages, colours, layout and light / dark / system theme are all edited in the dashboard and served to the SDK at runtime — no redeploy needed when you tweak the banner.

## Reopening the banner {#reopening-the-banner}

Visitors must be able to change their mind as easily as they decided. After a choice, the dashboard's **Reopen button** setting decides what stays on the page:

- **Floating icon** (default) — a small round button in a corner of every page. Pick bottom left or right, and optionally show a "Cookie settings" label.
- **Auto** — the floating icon appears only on pages that have no Cookie settings link.
- **Link only** — no icon at all. Your own link reopens the banner.

Add a reopen link anywhere — no JavaScript needed, and links your CMS adds after the page loads work too:

```html
<a href="#cookie-settings">Cookie settings</a>
<a href="#cookie-settings" data-cp-open="preferences">Manage cookies</a>
<a href="#privacy-choices" data-cp-open="privacy-choices">Your privacy choices</a>
```

**WordPress, Shopify, Webflow, Wix, Squarespace, Framer:** in your footer menu, add a custom link with the label *Cookie settings* and the URL `#cookie-settings`. A page opened with `#cookie-settings` in its address opens the banner as well.

From your own code, use the command queue — it works before and after the SDK has loaded:

```js
window.cookiepanda = window.cookiepanda || [];
cookiepanda.push(["show"]);             // reopen the banner
cookiepanda.push(["showPreferences"]);  // open the per-purpose choices
cookiepanda.push(["on", "consent", (e) => console.log(e.categories)]);
```

Events: `ready`, `show`, `hide`, `consent` and `change`. Each is also dispatched on `document` as `cookiepanda:<event>` for Google Tag Manager:

```js
document.addEventListener("cookiepanda:consent", (e) => {
  console.log(e.detail.categories); // { necessary, analytics, advertising, preferences }
});
```

## Desktop, mobile & custom banners {#desktop-mobile-custom-banners}

**Separate designs per device.** In the Banner Designer, switch *Editing* to **Mobile** to give phones their own layout (including a bottom sheet or full-screen layout), stacked buttons, text size, maximum height and collapsed disclosures. Anything you don't change follows the desktop design. The SDK picks the design by screen width and switches live when a phone rotates.

**Custom banner (Enterprise).** Build the first layer from your own HTML and CSS. Mark where each part goes and Cookie Panda supplies the behaviour and the required disclosure text, in every language:

```html
<div data-cp-banner class="my-banner">
  <p data-cp-text="message"></p>            <!-- filled with the required disclosure -->
  <a data-cp-link="vendors" href="#">Our <span data-cp-slot="vendor-count"></span> partners</a>
  <button data-cp-action="preferences">Options</button>
  <button data-cp-action="reject-all">Reject all</button>
  <button data-cp-action="accept-all">Accept all</button>
</div>
```

Your markup renders in a Shadow DOM, so its CSS can't affect your site, and target phones with `:host([data-cp-device="mobile"])`. Scripts and inline event handlers are removed. If a required element is missing, visitors see the standard banner instead and the dashboard tells you why. No Cookie Panda logo is shown on a custom banner.

## API & MCP {#api-mcp}

Everything in the Banner Designer can also be set from code. Create an API key in **Settings → API keys** (pick *Banner design only* to limit what it can touch), then send it as `Authorization: Bearer cp_apikey_…`.

```bash
# Change just what you need — the same checks as the Designer run on every save
curl -X PATCH https://dashboard.cookiepanda.app/api/v1/websites/123/banner \
  -H "Authorization: Bearer $CP_KEY" -H "Content-Type: application/json" \
  -d '{"devices": {"mobile": {"layout": "sheet", "buttons": "stacked"}},
       "launcher": {"mode": "auto", "position": "bottom-right"}}'

# Add ?dry_run=true to see the result and any compliance findings without saving
```

**Connect an AI assistant.** Cookie Panda runs a remote MCP server, so Claude, Cursor and other MCP clients can design and update banners for you — apply templates, set phone and desktop designs, configure the reopen button, manage saved designs and read scan activity:

```bash
claude mcp add --transport http cookiepanda https://dashboard.cookiepanda.app/api/v1/mcp \
  --header "Authorization: Bearer cp_apikey_…"
```

Every change made through the API or MCP goes through the same validation, plan limits and audit log as the dashboard.

## Frameworks & signals {#frameworks-signals}

Cookie Panda applies the right privacy framework per visitor and emits the standard consent signals the ad-tech and analytics ecosystem expects.

### Regulations covered {#regulations-covered}

- **GDPR** — EU — prior consent, granular purposes, easy withdrawal
- **UK GDPR** — United Kingdom post-Brexit regime
- **CCPA / CPRA** — California — opt-out of sale / sharing
- **US state laws** — Virginia, Colorado, Connecticut, Utah, Texas and more
- **LGPD** — Brazil — consent and data-subject rights
- **PIPL** — China — separate consent for sensitive data
- **COPPA** — US — protections for users under 13

### Standards & signals {#standards-signals}

- **IAB TCF v2.3** — Registered CMP, TC strings via the `__tcfapi` locator
- **Google Consent Mode v2** — Emitted automatically — ad\_storage, analytics\_storage and more
- **Google Additional Consent** — AC string for Google's non-TCF ad partners
- **IAB GPP** — Global Privacy Platform — US national + state section strings
- **GPC** — Global Privacy Control browser signal honored automatically

[Full compliance overview →](page:/compliance)

## Consent API {#consent-api}

Cookie Panda registers the standard CMP interfaces, so the tools and tags you already use can read consent the way they expect.

- `window.__tcfapi` — the IAB TCF v2.3 CMP API for TC strings and per-purpose consent.
- `window.__gpp` — the IAB Global Privacy Platform API for US national and state strings.
- `window.CookiePanda` — `categories()`, `hasDecision()`, `show()`, `showPreferences()`, `on()` / `off()` for events, and the methods below. See [Reopening the banner](page:/docs#reopen) for links that need no code.
- `getAdParams()` — one call returns ad-server-ready signals (TC string, GPP, Google AC, plus derived `npa`/`ltd`/`rdp`) for GAM, IMA, Prebid and OpenRTB.
- `knownAge` / `setAge()` — profile-aware COPPA: pass a known age to skip the gate and auto-block advertising & analytics for children.

```js
// The IAB TCF v2.3 CMP API is available on window.__tcfapi
window.__tcfapi("getTCData", 2, (tcData, success) => {
  if (!success) return;

  // Standard TC string + per-purpose consent
  console.log(tcData.tcString);
  console.log(tcData.purpose.consents); // { "1": true, "2": false, ... }
});

// Reopen the preferences UI at any time (e.g. a "Cookie settings" link)
window.CookiePanda?.showPreferences();
```

```js
// Ad-server-ready signals from the live consent state
const p = window.CookiePanda.getAdParams();
// → { gdpr, gdpr_consent, addtl_consent, gpp, gpp_sid,
//     us_privacy, npa, ltd, rdp }

// Drop straight into a Google Ad Manager / IMA tag, Prebid or OpenRTB:
// &gdpr=${p.gdpr}&gdpr_consent=${p.gdpr_consent}
// &gpp=${p.gpp}&gpp_sid=${p.gpp_sid.join(",")}&npa=${p.npa}&ltd=${p.ltd}
```

```js
// Profile-aware COPPA: pass a known age and no gate is shown.
// Under 13 → consent is locked to essential-only, ads/analytics blocked.
window.cookiePanda = { token: "cp_xxx", knownAge: 8 }; // or child: true

// On a profile switch (kid <-> adult), re-apply live — no reload:
window.CookiePanda.setAge(8);   // child  → blocked
window.CookiePanda.setAge(34);  // adult  → normal banner
```

## Data subject requests {#data-subject-requests}

Privacy laws give people the right to access, delete or opt out of the sale of their data — and you have to give them a way to ask.

Every site gets a public, no-login data-subject-request (DSAR) intake form. Link it from your privacy policy and visitors can file access, deletion and opt-out requests without an account. Submissions land in a dashboard workflow with SLA timers, so requests never go overdue.
