DEVELOPER DOCUMENTATION · QUICKSTART

5-Minute Quickstart Integration

Integrate the zero-dependency ConsentPlix® client script in under 5 minutes to intercept unauthorized trackers, serve localized 22 Indian language notices, and record cryptographically signed consent receipts.

STEP 01RUNTIME: < 12KB GZIPPED

Add Client Script to HTML Head

Paste this snippet into your root <head> tag before any analytics, ad pixels, or tag manager containers. Replace data-cp-site with your token from the ConsentPlix Governance Console.

<!-- Place in <head> before any Google Analytics, Meta Pixel, or marketing tags -->
<script
  src="https://cdn.consentplex.com/v2/cp.min.js"
  data-cp-site="cp_live_9f83a1b2c3d4e5f6"
  data-cp-locale="auto"
  data-cp-theme="light"
  async
></script>
STEP 02AUTOMATIC SYNC

Configure Google Consent Mode v2 Signals

If your application utilizes Google Tag Manager or Google Analytics 4, define default denied states. ConsentPlix automatically issues gtag('consent', 'update') upon affirmative user choices.

// Optional: Push Google Consent Mode v2 default states
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

gtag('consent', 'default', {
  'ad_storage': 'denied',
  'analytics_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'wait_for_update': 500
});
STEP 03 (OPTIONAL)HEADLESS PRO

Headless DOM Attributes Integration

Want full design ownership without using the pre-styled widget modal? Style your banner directly in TailwindCSS, CSS Modules, or Webflow using pure HTML data attributes.

<!-- Markup for custom headless banner (No JS styling required) -->
<div data-cp-banner>
  <p data-cp-notice>We process your data under DPDP Act 2023.</p>
  <button data-cp-accept>Accept All</button>
  <button data-cp-reject>Reject Non-Essential</button>
  <button data-cp-preferences>Customize</button>
</div>

Script Configuration Attributes

AttributeTypeDefaultDescription
data-cp-sitestringrequiredYour domain production API identifier
data-cp-localestring"auto"Language code (e.g. "hi", "ta", "auto" for geo-detection)
data-cp-themestring"light"Pre-built UI appearance: "light", "dark", or "headless"

Ready to test verification receipts?

Explore our HMAC-SHA256 signature verification guide.