Consent Management Platform (CMP) Integration
Consent Management Platforms (CMPs) are essential for websites to comply with privacy regulations like GDPR. htag works seamlessly with various CMPs to ensure that user consent is properly collected and respected before loading ads.
How htag Works with CMPs
Section titled “How htag Works with CMPs”You can configure htag to wait for the CMP to load and collect user consent before initializing the ad loading process. This is controlled by the awaitTcLoaded setting in your tag configuration.
When you enable awaitTcLoaded, htag will wait for the CMP to load and initialize, and check for the existence of the Transparency and Consent Framework (TCF) API.
When htag discovers a CMP, its delivery gate waits for a final TCF decision (tcloaded or useractioncomplete under GDPR) and for the CMP layer to stop being visible. On a first visit, this can wait for the visitor to answer. The existing 120-second hold is shared across delivery gates while no final decision exists, including when the layer is hidden, the consent subscription fails, or GDPR applicability is still undetermined. Later auction and render gates do not restart an expired hold; a final TCF decision restores normal placement and render layer checks. A rejected choice is still a final decision; the consent signals determine which bidders may proceed. Tags with requireAdnzConsent additionally require consent for Audienzz before startup.
htag also checks for a CMP immediately before a Prebid auction, so a CMP that arrived after initial tag configuration can still be connected to Prebid’s consent module. The additional auction guard reuses a completed delivery gate, including an unanswered-ping or terminal-error fallback. Regular placement and render gates still check the CMP layer. Amazon APS starts after the same auction guard and runs in parallel with Prebid.
Supported CMPs
Section titled “Supported CMPs”htag is compatible with any CMP that implements the IAB Transparency and Consent Framework (TCF) v2.0 standard.
Configuration
Section titled “Configuration”Configure CMP integration through the Adconsole interface. Simply enable or disable the awaitTcLoaded setting for your tag.
Install your CMP’s TCF stub before header.js, including when the main CMP script loads through Google Tag Manager. The initial search for a CMP is bounded and shared across placements; a CMP that appears only after an auction has started cannot protect that auction retroactively. The stub must come from the CMP integration and must queue calls until the main CMP takes over.
Example Implementation
Section titled “Example Implementation”<!-- First, load your CMP --><script src="https://your-cmp-provider.com/cmp.js"></script>
<!-- Then, load htag --><script defer="defer" async="async" src="https://adnz.co/header.js?id=YOUR_TAG_ID"></script>Related Concepts
Section titled “Related Concepts”- Integration: Learn about basic htag integration