OptinStack

OptinStack Documentation

Consent Management Platform SDK — privacy-compliant consent banners with script blocking, Google Consent Mode v2, and GPC support.

OptinStack is a lightweight, privacy-first Consent Management Platform (CMP) SDK. It renders a consent banner and preferences dialog inside a Shadow DOM, manages user consent state, blocks and unblocks third-party scripts and iframes, syncs consent records to a server, and integrates with Google Consent Mode v2 and Global Privacy Control (GPC).

Key Features

Quick Start

Add the OptinStack script to your page — the server injects your project configuration and serves the runtime bundle:

<script src="https://api.optinstack.com/banner/{siteId}.js" defer></script>

Once loaded, the SDK is available at window.OptinStack:

window.OptinStack = window.OptinStack || [];
window.OptinStack.push(function (os) {
  console.log('Consent state:', os.consent.get());
});

The callback queue pattern ensures your code runs after the SDK initializes, even if your script loads before the OptinStack bundle.

On this page