Documentation
Everything you need to integrate SnapConsent into your website
Quick Start
Installation
Add to your website
Add this script tag before the closing </head> tag on every page:
<script src="https://cdn.snapconsent.com/v1/consent.js"
data-site-id="YOUR_SITE_ID"
async></script>
Replace YOUR_SITE_ID with your actual site ID from the dashboard.
Google Tag Manager
For GTM integration, add a Custom HTML tag with:
- Create a new Custom HTML tag
- Paste the SnapConsent script
- Set trigger to "All Pages"
- Enable Google Consent Mode v2 in settings
API Reference
JavaScript API
Programmatically control the consent banner
snapconsent.show()
snapconsent.hide()
snapconsent.getConsent()
Events
Listen to consent events
consent_given
consent_updated
consent_declined
Configuration Options
Option | Type | Description |
---|---|---|
position | string | Banner position: bottom, top, center |
theme | string | Color theme: light, dark, auto |
language | string | Default language: en, es, fr, de |
autoShow | boolean | Auto-show banner for EU visitors |