Last updated: 2026-04-06
Reference
Consent Integration¶
Dxtra Tag Manager integrates with consent management platforms (CMPs) to ensure tags only execute when appropriate consent has been obtained.
Understanding Consent Integration¶
Consent integration enables:
- Automatic Consent Validation: Tags only execute with valid consent
- CMP Check Event: Built-in event for consent-based rule triggering
- Real-Time Updates: Consent changes immediately affect tag behavior
- Consent Categories: Map tags to specific consent purposes
CMP Check Event¶
Use the CMP Check event to trigger rules based on consent status:
Text Only
Rule: "Marketing Pixel with Consent"
Event: CMP Check
Conditions:
- Consent Purpose: "marketing" equals "true"
Actions:
- Fire marketing pixel
CMP Check Event Properties¶
| Property | Description |
|---|---|
purpose_analytics | Analytics consent status |
purpose_marketing | Marketing consent status |
purpose_personalization | Personalization consent status |
purpose_advertising | Advertising consent status |
Consent Categories¶
Map tag types to appropriate consent categories:
| Tag Type | Consent Category | Legal Basis |
|---|---|---|
| First-party analytics | analytics | Legitimate interest |
| Third-party analytics | analytics | Consent |
| Marketing pixels | marketing | Consent |
| Personalization | personalization | Consent |
| Advertising | advertising | Consent |
| Essential functionality | None required | Legitimate interest |
Configuring Consent Requirements¶
Rule-Level Consent¶
Add consent conditions to rules:
JavaScript
// Rule configuration
Event: "Page Loaded"
Conditions:
- Data Container: "CMP"
- Key: "analytics_consent"
- Operator: "Equals"
- Value: "true"
Actions:
- Execute analytics tag
Using Environment Variables¶
Configure consent requirements per environment:
JavaScript
// Access consent status in actions
const analyticsConsent = '{{CMP.analytics}}' === 'true';
const marketingConsent = '{{CMP.marketing}}' === 'true';
if (analyticsConsent) {
// Fire analytics
}
if (marketingConsent) {
// Fire marketing tags
}
TCF v2.0 Integration¶
Dxtra integrates with IAB TCF v2.0 compliant CMPs:
JavaScript
// Access TCF consent data
if (window.__tcfapi) {
__tcfapi('getTCData', 2, function(tcData, success) {
if (success && tcData.gdprApplies) {
// Purpose consents
const purpose1 = tcData.purpose.consents[1]; // Store/access device
const purpose7 = tcData.purpose.consents[7]; // Measurement
// Vendor consents (if needed)
const vendorConsent = tcData.vendor.consents[YOUR_VENDOR_ID];
}
});
}
TCF Purpose Mapping¶
| TCF Purpose | Description | Typical Use |
|---|---|---|
| Purpose 1 | Store/access device info | Essential tracking |
| Purpose 7 | Measure ad performance | Analytics |
| Purpose 8 | Measure content performance | Content analytics |
| Purpose 9 | Apply market research | Surveys, research |
| Purpose 10 | Develop/improve products | Product analytics |
USP API Integration (CCPA)¶
For California Consumer Privacy Act compliance:
JavaScript
// Check US Privacy String
if (window.__uspapi) {
__uspapi('getUSPData', 1, function(uspData, success) {
if (success) {
const uspString = uspData.uspString;
// Format: 1YNN (Version, Notice, Opt-out, LSPA)
const optedOut = uspString.charAt(2) === 'Y';
if (optedOut) {
// Honor opt-out preference
}
}
});
}
Consent-Aware Tag Examples¶
Analytics with Consent Check¶
JavaScript
// Action: Analytics Initialization
(function() {
// Check consent before initializing
const analyticsConsent = '{{CMP.analytics}}' === 'true';
if (!analyticsConsent) {
console.log('Analytics blocked - no consent');
return;
}
// Initialize analytics
gtag('config', 'GA_MEASUREMENT_ID');
})();
Marketing Pixel with Consent¶
JavaScript
// Action: Marketing Pixel
(function() {
const marketingConsent = '{{CMP.marketing}}' === 'true';
if (!marketingConsent) {
return; // Skip without consent
}
// Fire marketing pixel
fbq('track', 'PageView');
})();
Handling Consent Changes¶
Real-Time Consent Updates¶
When consent changes, Dxtra can:
- Stop running tags that no longer have consent
- Start new tags that now have consent
- Update tag behavior based on new consent level
JavaScript
// Listen for consent changes
if (window.__tcfapi) {
__tcfapi('addEventListener', 2, function(tcData, success) {
if (success && tcData.eventStatus === 'useractioncomplete') {
// User updated consent preferences
// Tag Manager automatically re-evaluates rules
}
});
}
Best Practices¶
Consent Configuration¶
- Set consent requirements at the rule level, not tag level
- Use the CMP Check event for consent-dependent tags
- Test consent flows in development environment first
- Document consent mapping for compliance audits
Tag Organization¶
- Group consent-requiring tags in separate rule groups
- Use meaningful names indicating consent requirements
- Create exception rules for consent-free fallbacks
Testing¶
- Test with consent granted: Verify tags fire correctly
- Test with consent denied: Verify tags are blocked
- Test consent change: Verify real-time updates work
- Test edge cases: Partial consent, expired consent
Troubleshooting¶
Tags Not Firing After Consent¶
- Check CMP integration: Verify CMP is sending consent signals
- Verify condition syntax: Ensure consent condition matches CMP format
- Enable debug mode: Use
#dxtra-debugto see consent status - Check timing: Ensure CMP loads before Tag Manager evaluates rules
Tags Firing Without Consent¶
- Review rule conditions: Ensure consent check is required
- Check exception rules: Look for rules that bypass consent
- Verify CMP status: Confirm CMP is functioning correctly
Support¶
- Privacy Documentation: Consent integration reference
- CMP Setup Guides: Platform-specific CMP integration
- Support Email: support@dxtra.ai (include "Consent Integration" in subject)
Continue to Privacy Features for comprehensive privacy and compliance features.