Custom Integrations
Connect Cookiewise with your existing tools and workflows.
JavaScript API
Cookiewise exposes a global JavaScript API on pages where the consent script is loaded. Use it to react to consent changes in your own code:
// Listen for consent changes
window.addEventListener('cookieConsent', function(e) {
const preferences = e.detail;
console.log('Analytics allowed:', preferences.analytics);
console.log('Marketing allowed:', preferences.marketing);
});
// Check current consent status
const consent = JSON.parse(
localStorage.getItem('cookiewise-consent') || '{}'
);
Google Tag Manager
Cookiewise integrates with GTM through consent mode. When a user updates their preferences, Cookiewise automatically updates the GTM consent state:
analytics_storage— Maps to the Analytics categoryad_storage— Maps to the Marketing categoryfunctionality_storage— Maps to the Functional category
Webhooks
Configure webhooks to receive real-time notifications when consent events occur. See the Webhooks documentation for setup details.
Server-Side Integration
Use the Cookiewise REST API to check consent status server-side:
GET /api/consent/check?website_id=YOUR_ID&visitor_id=VISITOR_ID
Response:
{
"hasConsent": true,
"preferences": {
"necessary": true,
"functional": true,
"analytics": false,
"marketing": false
}
}
WordPress Plugin
For WordPress sites, simply add the Cookiewise script tag to your theme's header.php or use a plugin like Insert Headers and Footers to add the script without editing theme files.
Shopify Integration
Add the Cookiewise script to your Shopify store via Online Store → Themes → Edit Code → theme.liquid. Place the script tag immediately after the opening <head> tag.