Welcome
Developer guides for the OptinStack consent runtime, JavaScript API, and platform integrations.
OptinStack is a Consent Management Platform (CMP) runtime for websites. It renders a consent banner and preferences dialog inside a Shadow DOM, manages visitor consent state, blocks and unblocks third-party scripts and iframes, and records consent updates for reporting.
This site documents the browser runtime, JavaScript API, consent events, and integration patterns for developers adding OptinStack to a site. Product setup, privacy and consent guidance, and platform walkthroughs live on optinstack.com.
Key topics
Install
Add the ordered OptinStack bootstrap and runtime tags to your site.
JavaScript API
Read and update consent state through window.OptinStack.
Banner control
Open preferences, reset consent, custom flows, and iframe placeholder messaging.
Events
Subscribe to consent changes, blocking events, and reporting errors.
Consent cookie
Understand stored consent state and sharing across subdomains.
Google Consent Mode
How OptinStack drives gtag Consent Mode v2 and dataLayer events.
Quick start
Add the OptinStack two-tag install to your page. Bootstrap loads project configuration; the runtime tag loads the consent kernel:
<script src="https://api.optinstack.com/v1/cdn/bootstrap.js?projectId={projectId}"></script>
<script src="https://api.optinstack.com/v1/js/runtime/stable/optinstack.js" data-optinstack-site="{projectId}"></script>Once loaded, the API is available at window.OptinStack:
await window.OptinStack.ready;
console.log(window.OptinStack.choices);Replace {projectId} with your project ID from the dashboard. See Getting started for
installation details.
Was this helpful?