Developers

Implement cookie consent without giving up control.

Add CookieHub directly to your site or through your tag manager, react to consent changes in code and pass visitor choices to the tools your stack already uses.

Direct or tag-manager setupJavaScript API & eventsConsent signals & integrations
index.htmlExample data
<script src="https://cdn.cookiehub.eu/c2/abcd1234.js">
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var cpm = {};
window.cookiehub.load(cpm);
});
</script>
hasConsented()Example
NecessaryAlways on
PreferencesAllowed
AnalyticsAllowed
MarketingAllowed
Consent updatedonAllow('marketing')
Built for developers

Consent that fits into your stack.

Use CookieHub with the way your site is already built, while keeping control over consent-dependent code and integrations.

  • Flexible implementation

    Add CookieHub directly, through Google Tag Manager or through supported platforms.

  • Runtime consent control

    Read consent state and react when visitor preferences change.

  • Connected consent signals

    Pass visitor choices to supported advertising, analytics and platform integrations.

Implementation

Install CookieHub the way your site is built.

Add CookieHub using the method that fits your setup — direct HTML, Google Tag Manager or a supported framework or CMS.

Paste into the <head> of every page.Example data
<script src="https://cdn.cookiehub.eu/c2/abcd1234.js">
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var cpm = {};
window.cookiehub.load(cpm);
});
</script>
JavaScript API

Read consent. React when it changes.

Use CookieHub’s JavaScript API to check consent state, respond to preference changes and control your consent experience from your own code.

  • Check consent statehasAnswered() and hasConsented(category)
  • Listen for consent changesonStatusChange and cookiehub_onStatusChange
  • React when categories are allowed or revokedonAllow and onRevoke callbacks
  • Open consent settings from your own UIopenSettings() and openDialog()
consent.jsExample
document.addEventListener(
'cookiehub_onStatusChange',
({ detail }) => {
updateServices(detail.status)
}
)
if (window.cookiehub.hasConsented('analytics')) {
loadAnalytics()
}
// open settings from your own UI
settingsLink.onclick = () => window.cookiehub.openSettings()
hasAnswered()hasConsented()openDialog()openSettings()
Consent signals

Send visitor choices to the tools that need them.

Connect CookieHub with the advertising, analytics and platform services that depend on visitor consent.

  1. Visitor choice
  2. CookieHub
  3. Consent signal
  4. Connected tools
See how each framework works, or browse every supported platform.Consent frameworksAll integrations
Data layer

Make consent part of your tag workflow.

Use CookieHub events and data-layer updates to coordinate tags and downstream services when consent state changes.

dataLayer eventsExample data
GTM triggerExample data
TypeCustom Event
Event namecookiehub_consent_update
FiresAnalytics & marketing tags

Use cookiehub_consent_update or cookiehub_modified as a firing trigger, not both on the same tag, as that can make it fire twice.

Management API · Enterprise

Automate consent management across your portfolio.

For larger implementations, manage domains and configuration programmatically and bring CookieHub into your deployment workflow.

  • Domain provisioningCreate and manage CookieHub domains programmatically.
  • Configuration synchronizationKeep consent configuration aligned across a larger portfolio.
  • CI/CD workflowsConnect CookieHub management to deployment and operational workflows.
Explore Management APIAvailable on Enterprise plans.
Management API · RESTEnterprise
Example requestIllustrative · not a real endpoint
GET /v1/{resource}
Authorization: Bearer <API_KEY>
Accept: application/json
200 OK · application/jsonExample response
RESTful API · JSON · API key from your CookieHub dashboard
Developer workflow

From install to production in four steps.

  1. 01

    Add CookieHub

    Install directly or through your tag manager.

  2. 02

    Configure consent

    Set categories, regions and consent behaviour.

  3. 03

    Connect your stack

    Wire consent state into APIs, tags and supported integrations.

  4. 04

    Verify and ship

    Confirm signals and consent-dependent behaviour before release.

Built for teams shipping consent into production.

Google Certified CMP PartnerISO 27001 certifiedIAB Europe TCF registered CMP
FAQ

Developer questions, answered.

Add the CookieHub HTML tag with your domain code to the head of every page. Use only one implementation method per site. Installation guide

Yes. Once CookieHub has loaded, the window.cookiehub object provides methods such as hasAnswered() and hasConsented(category). JavaScript API

Yes. Use the onStatusChange, onAllow and onRevoke callbacks, or listen for CookieHub’s status-change events, to update your code without a page reload.

Yes. The CookieHub CMP template runs on the Consent Initialization trigger and pushes data layer events you can use as triggers. Google Tag Manager

Through supported frameworks and integrations such as Google Consent Mode, Microsoft UET Consent Mode and IAB TCF, and through the JavaScript API for anything else. Consent frameworks

Yes. Initialise CookieHub once at the app root and gate scripts by consent category. For server-rendered frameworks, initialise on the client.

A REST API for backend configuration and automation, such as working with domains and fetching consent log data. It is separate from the JavaScript API, which runs in the browser. Management API

No. The Management API is available to Enterprise customers. View pricing

For developers

Build consent into your stack.

Implement CookieHub your way, connect visitor choices to your tools and keep control from development through production.

  • 14-day trial
  • No card required