Skip to main content

Developer Quickstart Guide

Deploy enterprise consent management, real-time pixel suppression, and cryptographic lawsuit defense in under 5 minutes.


Step 01: Embed the Real-Time Kernel​

Insert the following <script> tag as the first script inside your website's <head> tag. Positioning it before Google Tag Manager, Meta Pixels, or TikTok tags ensures 100% pre-DOM interception.

<!-- Consent Shield Real-Time Defense Kernel -->
<script
src="https://consentshieldai.com/shield.js"
data-site-id="CS-LIVE-PROD"
data-gcm-v2="true"
data-cipa-protect="true"
data-respect-gpc="true"
async>
</script>
PERFORMANCE IMPACT: ZERO OVERHEAD

shield.js is distributed via global Cloudflare edge caching (~3.2 KB brotli compressed). It executes synchronously in <1.4ms to install pre-DOM fetch and XHR intercepts without impacting Google Core Web Vitals (LCP/CLS).


Step 02: Configuration Attributes Reference​

Configure behavioral switches directly on the script tag using data attributes:

AttributeTypeDefaultRequiredPurpose & Statutory Impact
data-site-idstring—YesYour tenant identifier from the App Console.
data-gcm-v2booleantrueNoAutomatically dispatches gtag('consent', 'update', ...) signals.
data-cipa-protectbooleantrueNoBlocks keystroke loggers & pixels before explicit consent.
data-respect-gpcbooleantrueNoAutomatically honors Sec-GPC / navigator.globalPrivacyControl.
data-themestringautoNoModal palette (dark, light, or auto).

When data-gcm-v2="true" is enabled, Consent Shield initializes default denied states and updates signals upon user selection:

// Automatically executed by shield.js
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});

// Real-time synchronization upon consent
window.addEventListener('consent_shield_update', (e) => {
console.log('Consent updated:', e.detail.categories);
});

Ready to verify your site?

Run a free multi-page scan across all trackers, cookies, and California wiretap vulnerabilities.