Complete guide to implementing GDPR-compliant cookie consent management on your website
Register your domain in the ArtaConsent Dashboard and copy your Domain ID.
Place this script in the <head> section of your HTML:
<script
src="https://artaconsent.artatol.net/embed/YOUR_DOMAIN_ID"
async
></script>Replace YOUR_DOMAIN_ID with your actual domain ID.
The consent banner will automatically appear. For automatic deletion, you MUST configure all tracking items in the dashboard with correct names, categories, and storage types.
Script loads your configuration
The embed script fetches your domain's configuration including banner settings, tracking items, and consent categories.
Consent banner appears
If user hasn't given consent yet, the banner shows up according to your configuration (blocking/non-blocking mode).
User makes choice
User can accept all, reject all, or customize their preferences by category (necessary, functional, analytics, marketing).
Automatic tracking item management
⚠️ ONLY if tracking items are configured: SDK automatically deletes cookies, localStorage, and sessionStorage items that user rejected. Consent is recorded and stored.
Google Consent Mode v2 integration
If enabled, SDK automatically updates Google's consent signals (ad_storage, analytics_storage, etc.) based on user choice.
Cookie & Storage Deletion
⚠️ ONLY if tracking items are properly configured in dashboard: Automatically deletes cookies, localStorage, and sessionStorage items when user revokes consent for a category.
Consent Banner Display
Shows banner on first visit or when user hasn't given consent. Remembers user's choice across visits.
Settings Button
Displays floating cookie settings button (if enabled) allowing users to change their preferences anytime.
Google Consent Mode v2
Updates GCM signals (ad_storage, analytics_storage, etc.) automatically based on user consent.
Consent Recording
Stores consent records with timestamp, visitor ID, and chosen preferences for compliance auditing.
Multi-language Support
Detects browser language and shows banner in configured languages (auto-fallback to default).
Blocking Mode
Prevents page scroll and interaction until user makes a choice (if enabled in configuration).
You must check consent before loading third-party scripts (analytics, ads, etc.):
// Listen for consent changes
window.addEventListener('artaconsent:change', (event) => {
const consent = event.detail;
// Load analytics only if user accepted
if (consent.analytics) {
loadGoogleAnalytics();
}
// Load ads only if user accepted
if (consent.marketing) {
loadGoogleAds();
}
});
// Check initial consent state
const consent = window.ArtaConsent?.getConsent();
if (consent?.analytics) {
loadGoogleAnalytics();
}Automatic deletion ONLY works if tracking items are properly configured:
✅ Properly configured → SDK deletes automatically, zero code needed
❌ Not configured → You MUST manually delete items based on consent
Before going live, verify:
Use scanner as a starting point, then manually review and add missing tracking items:
⚠️ Important: Website owner is ultimately responsible for maintaining accurate tracking item inventory. ArtaConsent scanner is a tool to assist discovery, but cannot guarantee 100% detection due to the limitations above. Regular manual audits are recommended, especially after adding new features or third-party integrations.
const consent = window.ArtaConsent?.getConsent();
// Returns: { necessary: true, functional: false, analytics: true, marketing: false }window.ArtaConsent?.updateConsent({
necessary: true,
functional: true,
analytics: false,
marketing: false
});window.addEventListener('artaconsent:change', (event) => {
console.log('Consent updated:', event.detail);
// event.detail = { necessary: true, functional: true, analytics: false, marketing: false }
});// Open cookie settings dialog manually window.ArtaConsent?.showSettings();