TrustArc

Integration Studio for TrustArc Cookie Consent Manager

Complete guide to implementing integrations with TrustArc Cookie Consent Manager

Overview

The TrustArc Integration Studio simplifies integration with third-party script tags by loading them according to user consent preferences and tag categorization. It ensures scripts and content are only activated when the appropriate consent is given.

Key Benefits:
  • Automatic loading of third-party scripts based on user consent
  • Visual placeholders when content is blocked preventing layout shifts
  • Easy configuration through a simplified API
  • Support for major  platforms like Google Tag Manager, Facebook Pixel, and more
Important Legal & Privacy Notice: All integrations and consent category mappings should be reviewed with your privacy team or outside counsel. The customer is solely responsible for ensuring proper categorization and compliance with applicable privacy laws and regulations.

Before You Get Started

Important: The TrustArc Cookie Consent Manager and Autoblock scripts must be loaded in the <head> of your page before the Integration Studio script. This ensures that consent is detected and enforced correctly for all integrations.
Make sure to use the correct parameters in the cookie consent manager script.
Required Script Order
<head>
    ...
    <!-- TrustArc Cookie Consent Manager -->
    <!-- Adjust the parameters according to your setup -->
    <script async src="https://consent.trustarc.com/notice?domain=yourdomain.com"></script>
    
    <!-- Integration Studio Script (must come after the above) -->
    <!-- This script is auto-generated by the Integration Wizard. -->
    <!-- Feel free to modify it as needed. -->
    <script>
    (function() {
        // Create script element
        var s = document.createElement('script');
        
        // Set script source
        s.src = 'https://consent.trustarc.com/asset/integration-builder-v1.0.0.min.js';
        
        // Handle successful script load
        s.onload = function() {

            // Initialize the Integration Builder here
            // This is an example configuration
            var builder = new IntegrationBuilder({
                "consent_config": "consent_model"
                })
                .TrustArcVisualComponents({
                    load_banner: true, // Load the banner container
                    load_teconsent: true, // Add Cookie Preferences link
                })
                .build();

        };
        
        // Handle script load errors
        s.onerror = function() {
            console.error('Failed to load the Integration Studio script.');
        };
        
        // Add script to document
        document.head.appendChild(s);
    })();
    </script>

    ...
</head>
Tip: For best performance, use the minified version of the Integration Studio script, as it is smaller and loads faster. If you need to debug issues, use the unminified version by removing .min from the script filename.

Basic Usage Pattern

Only a single script is needed to configure all your integrations. You can easily add multiple integrations by chaining them together in the same code snippet.

Single Integration Setup
// Initialize the Integration Studio with a single integration
const builder = new IntegrationBuilder({
    consent_config: "consent_model",  // Cookie name used by TrustArc
    logging: true                      // Enable console logging
})
.TrustArcEventGeneration()
.build();  // Always call build() at the end
Multiple Integrations in One Script
// Add multiple integrations to the same builder instance
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcEventGeneration()         // Fire dataLayer events
.TrustArcPageReload()              // Reload page on consent changes
.GoogleTagManager({                // Load GTM with consent
    category: 2,
    gtm_id: "GTM-XXXXXXX"
})
.FacebookPixel({                   // Load Facebook Pixel
    category: 4,
    pixel_id: "123456789"
})
.build();  // Single build() call configures all integrations

Global Settings

Configure the core behavior of your integrations

Global settings apply to all integrations in your builder instance. These settings control fundamental behaviors for logging and consent behavior.

Configuration Options

Property Type Default Description
consent_config string "consent_model" Setting used to define the opt-out experience. For legacy settings, use notice_behaviorcookie
optout_setting string "" Setting for implied consent, opt-out experience by default (setting above). This can only be used when defining the consent experience using the TrustArc's Cookies (notice_behavior) that defines the region's experience. Check the documentation to review the allowed values(e.g., us, eu, na)
logging boolean false Verbose logging to console for debugging purposes
Complete Global Configuration
const builder = new IntegrationBuilder({
    consent_config: "consent_model",     // TrustArc cookie name
    optout_setting: "opt-out",               // Default location for implied consent
    logging: true,                        // Enable debug logging
});
Important: The consent_config name must match the cookie name configured in your TrustArc Cookie Consent Manager. The default value works for most standard implementations.

Event Generation Integration

Automatically emit consent-related events when user preferences change.

Event Generation is a built-in integration that automatically emits consent-related events whenever a user's consent preferences change. These events can be used to trigger tag management systems (like Google Tag Manager) or custom scripts, ensuring your site responds immediately to consent updates.

No Parameters Required: This integration does not require any configuration or parameters. Simply enable it to start emitting consent events.

How It Works

  • Listens for changes in user consent (e.g., when a user accepts or rejects cookies).
  • Pushes events to window.dataLayer in the format "GDPR Pref Allows {category}" where {category} is the bucket/category ID.
  • Can be used to trigger tag managers, analytics, or custom tags in response to consent changes.
Sample Usage
// Enable Event Generation integration
const builder = new IntegrationBuilder({
    consent_config: "consent_model"
})
.TrustArcEventGeneration()
.build();

// Events are automatically pushed to window.dataLayer in the format:
// "GDPR Pref Allows 1" (for category 1)
// "GDPR Pref Allows 2" (for category 2)
// etc.

// Example dataLayer event structure:
window.dataLayer = window.dataLayer || [];
// When user consents to category 2 (Performance):
// window.dataLayer.push({event: "GDPR Pref Allows 2"});

Page Reload Integration

Automatically refresh the page when users update their consent preferences

Page Reload is an integration that automatically refreshes the page after a user interacts with the consent banner or preferences manager. This ensures that all scripts and tags are properly reloaded according to the new consent settings, providing a clean slate for consent-aware functionality.

When to Use: This integration is especially useful when you have scripts that, once loaded, make extensive changes to the page (such as modifying the DOM, setting cookies, or injecting resources) that are difficult to fully reverse or track. In such cases, the safest and most reliable approach is to reload the page after consent changes to ensure a clean state and proper enforcement of user preferences.

Configuration Options

Property Type Default Description
timeout number 500 Delay in milliseconds before the page reloads after user interaction with consent controls
strict_consent_only boolean false If true, only triggers reload when users choose more restrictive privacy settings (e.g., from Accept All to Reject All)

Basic Usage

Simple Page Reload Setup
// Enable Page Reload with default settings
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcPageReload()
.build();

// This will reload the page 500ms after any consent change

Custom Configuration

Customized Page Reload Settings
// Page reload with custom timeout and strict mode
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcPageReload({
    timeout: 1000,                // Wait 1 second before reload
    strict_consent_only: true     // Only reload on restrictive changes
})
.build();

How It Works

  • Monitors user interactions with the TrustArc consent banner and preference manager
  • Waits for the specified timeout period to allow consent preferences to be saved
  • Automatically triggers a page reload using window.location.reload()
  • In strict mode, only reloads when users become more privacy-conscious (rejecting previously accepted categories)
Important Considerations:
  • Page reload will interrupt any ongoing user actions or form submissions
  • Consider the user experience impact, especially on complex single-page applications
  • The timeout should be long enough to allow consent preferences to be properly saved
  • Use strict mode to avoid unnecessary reloads when users are not changing their consent preferences in a restrictive manner

CCM Visual Components Integration

Load TrustArc Cookie Consent Manager visual elements

CCM Visual Components integration loads the HTML elements for the TrustArc Cookie Consent Manager, including the banner container, cookie preferences link, and IRM (Individual Rights Management) link. This integration works alongside the TrustArc script you must load in your HTML file.

This is especially useful for customers who have difficulty injecting elements directly into their pages, as this integration dynamically injects the required DOM elements for you.

Prerequisites: You must also load the TrustArc script in your HTML file for this integration to work properly. This integration only creates the necessary DOM elements and containers.

Configuration Options

Property Type Default Description
version radio "advanced" CCM version to use: "pro" or "advanced"
load_banner boolean false Load the banner container (div#consent-banner for Pro, div#consent_blackbar for Advanced)
load_teconsent boolean false Show the "Cookie Preferences" link in the banner
teconsent_parent string body Parent element where the "Cookie Preferences" link will be placed
load_irmlink boolean false Load the IRM container for "Do Not Sell My Personal Information" link (Advanced version only)
irmc string "" IRM container element ID. This is defined in the parameter irmc in the cookie consent manager script. Example irmc="irmlink"
irmlink_parent string body Parent element where the IRM link will be placed

Visual Components Setup

Full Visual Components Setup
// Complete visual components configuration
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcVisualComponents({
    version: "advanced",              // Use Advanced CCM version
    load_banner: true,                // Create banner container
    load_teconsent: true,             // Add Cookie Preferences link
    teconsent_parent: "#footer",      // Place link in footer
    load_irmlink: true,               // Add IRM container (Advanced only)
    irmc: "irmlink",                  // IRM container ID
    irmlink_parent: "#footer"         // Place IRM link in footer
})
.build();

Version Differences

Pro vs Advanced:
  • Pro Version: Creates div#consent-banner for the banner container
  • Advanced Version: Creates div#consent_blackbar for the banner container
  • IRM Features: Only available in Advanced version (requires Technical Account Manager enablement)

Cookie Preferences Link

When enabled, the integration creates a "Cookie Preferences" link that users can click to manage their consent:

Cookie Preferences Configuration
// Add Cookie Preferences link to a specific location
const builder = new IntegrationBuilder({
    consent_config: "consent_model"
})
.TrustArcVisualComponents({
    load_teconsent: true,
    teconsent_parent: "#privacy-links"  // Place in specific element
})
.build();

// The link will be inserted into the specified parent element

IRM (Individual Rights Management)

For Advanced CCM users, the IRM feature provides "Do Not Sell My Personal Information" functionality:

IRM Configuration
// Enable IRM features (Advanced version only)
const builder = new IntegrationBuilder({
    consent_config: "consent_model"
})
.TrustArcVisualComponents({
    version: "advanced",
    load_irmlink: true,
    irmc: "irmlink",       // Custom container ID
    irmlink_parent: "#footer"   // Place in compliance section
})
.build();
Important Notes:
  • This integration only creates DOM elements - you must still load the TrustArc script separately
  • IRM features are only available in Advanced version and require enablement by your Technical Account Manager
  • Parent element selectors should be valid CSS selectors (e.g., "#footer", ".privacy-section")
  • If parent elements don't exist, links will default to the body element

Custom Consent Hooks Integration

Execute custom JavaScript code triggered by consent events

Custom Consent Hooks integration allows you to execute custom JavaScript code based on user consent choices. You can run code when the CCM is initialized, when the user grants consent, or when the user revokes consent. This provides maximum flexibility for custom implementations and advanced use cases.

Multiple Instances: You can have multiple custom code integrations by duplicating this integration and changing the name field value. Each instance can have different event handlers for different purposes.

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - the script will only execute if user has granted consent for this category
name string No Custom integration name for identification (default: "custom-code")
on_initialize function No JavaScript code to execute when the integration is initialized
on_grant function No JavaScript code to execute when the user grants consent
on_revoke function No JavaScript code to execute when the user revokes consent

Event Handler Parameters

Each event handler function receives two parameters:

  • consent: Object containing the current consent state and category information
  • firstLoad: Boolean indicating if this is the first time the handler is being called

Basic Usage

Simple Custom Code Setup
// Basic custom code integration
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcCustomCode({
    category: 2,                                      // Performance category
    name: "analytics-tracker",
    on_grant: (consent, firstLoad) => {
        console.log('Analytics consent granted:', consent);
        // Load your analytics script here
    },
    on_revoke: (consent, firstLoad) => {
        console.log('Analytics consent revoked:', consent);
        // Clean up analytics cookies/data here
    }
})
.build();

Advanced Example: Dynamic Script Loading

Dynamic Script Loading with Custom Code
// Advanced custom code for dynamic script loading
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.TrustArcCustomCode({
    category: 4,                                      // Marketing category
    name: "marketing-scripts",
    on_initialize: (consent, firstLoad) => {
        console.log('Marketing integration initialized');
        // Set up event listeners or prepare resources
    },
    on_grant: (consent, firstLoad) => {
        // Dynamically load marketing scripts
        const script = document.createElement('script');
        script.src = 'https://example.com/marketing-script.js';
        script.id = 'marketing-script';
        document.head.appendChild(script);
        
        // Set marketing cookies
        document.cookie = 'marketing_consent=true; path=/';
    },
    on_revoke: (consent, firstLoad) => {
        // Remove marketing scripts
        const script = document.getElementById('marketing-script');
        if (script) script.remove();
        
        // Clear marketing cookies
        document.cookie = 'marketing_consent=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/';
        
        // Clear any tracking data
        if (window.marketingTracker) {
            window.marketingTracker.disable();
        }
    }
})
.build();

Event Execution Flow

Understanding Event Flow:
  • on_initialize: Called once when the integration is set up (if consent allows)
  • on_grant: Called when user grants consent for the specified category
  • on_revoke: Called when user revokes consent for the specified category
  • firstLoad parameter: Helps distinguish between initial load and subsequent consent changes
Important Considerations:
  • Always wrap your custom code in try-catch blocks to handle errors gracefully
  • Use the firstLoad parameter to avoid duplicate operations
  • Clean up properly in the on_revoke handler to respect user privacy
  • Test your custom code thoroughly across different consent scenarios
  • Remember that on_initialize is only called once if consent is already granted

Google Tag Manager Integration

Load Google Tag Manager script dynamically based on user consent

Google Tag Manager integration allows you to load the Google Tag Manager script dynamically according to the GTM categorization in the Cookie Consent Manager. This ensures that GTM only loads when users have given appropriate consent for the category you specify.

Important: If you are loading the CCM script via Google Tag Manager, neither the Integration Studio nor the CCM will work. The CCM script must be loaded directly in the page <head> before the Integration Studio script. Loading CCM via GTM will prevent both proper consent detection and the CCM from functioning.

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - GTM will only load if user has granted consent for this category
container_id string Yes Your unique Google Tag Manager Container ID (e.g., "GTM-XXXXXX")

Basic Usage

Simple GTM Setup
// Load Google Tag Manager with consent
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.GoogleTagManager({
    category: 2,                    // Performance category (Analytics)
    container_id: "GTM-XXXXXX"     // Your GTM Container ID
})
.build();

How It Works

  • Monitors user consent for the specified category
  • Dynamically loads the GTM script when consent is granted
  • Injects both the GTM script and the noscript fallback
  • Respects consent revocation by not loading GTM if consent is withdrawn
Important Considerations:
  • GTM will not load without a valid Container ID
  • If CCM is loaded via GTM, ensure GTM is set to category 1 (Essential)
  • Consider the timing of dataLayer events and GTM loading
  • Test consent scenarios thoroughly to ensure proper tag firing
  • Monitor GTM Preview mode to verify consent-based tag behavior

Google Consent Mode (GTag) Integration

Manage Consent Types for Google Services using GTag

Google Consent Mode (GTag) is specifically designed to implement Google's Consent Mode using the JavaScript gtag implementation. This integration serves as a bridge between TrustArc's consent management and Google's consent types

Google Consent Mode Focus: Unlike other integrations that simply load scripts based on consent, this integration specifically manages Google's Consent Mode API calls using gtag('consent', 'default') and gtag('consent', 'update') to ensure Google services respect user privacy choices at the platform level.

General Configuration Options

Property Type Required Description
ga_measurement_id string Yes Your Google Analytics Measurement ID (e.g., "G-XXXXXXXXXX"). If not provided, the gtag script won't load but events will still be sent.
ads_data_redaction boolean No Enable ads data redaction (default: true). Required for Google Ads and Analytics compliance with privacy regulations.
wait_for_update number No Time in milliseconds to wait for consent updates before loading tags (default: 500ms)
enable_tcf_support boolean No Enable TCF (Transparency and Consent Framework) support for handling TCF signals

Google Consent Types Mapping

Each Google consent type must be mapped to a TrustArc category number. These mappings determine when Google services can collect and use data based on user consent:

Consent Type Type Required Description
ad_personalization number Yes Controls personalized advertising - determines if Google can show personalized ads
ad_storage number Yes Controls advertising storage - enables storage of advertising cookies and identifiers
ad_user_data number Yes Controls sharing of user data with Google for advertising purposes
analytics_storage number Yes Controls analytics storage - enables storage of analytics cookies and identifiers
functionality_storage number Yes Controls functional storage - enables storage for site functionality
personalization_storage number Yes Controls personalization storage - enables storage for content personalization
security_storage number Yes Controls security storage - enables storage for security purposes
Category Mapping Guidance: Map each Google consent type to the appropriate TrustArc consent category number according to your organization's Cookie Consent Manager (CCM) bucketing. Refer to your CCM configuration to determine which category number corresponds to each Google consent type.

Basic Usage

Google Consent Mode Configuration
// Configure Google Consent Mode with TrustArc categories
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.GoogleGTag({
    ga_measurement_id: "G-XXXXXXXXXX",
    ads_data_redaction: true,
    ad_personalization: 3,      // Marketing category
    ad_storage: 3,              // Marketing category  
    ad_user_data: 3,            // Marketing category
    analytics_storage: 2,       // Functional category
    functionality_storage: 2,   // Functional category
    personalization_storage: 3, // Marketing category
    security_storage: 1,        // Required category
    wait_for_update: 500,
    enable_tcf_support: false
})
.build();

How It Works

  • Loads the Google gtag library and establishes the global gtag function, which internally pushes commands to window.dataLayer
  • Calls gtag('consent', 'default', ...) to establish initial consent states before any Google tags fire - this pushes default consent settings to the dataLayer
  • Maps each TrustArc consent category to corresponding Google consent types (ad_storage, analytics_storage, etc.)
  • Monitors TrustArc consent changes and calls gtag('consent', 'update', ...) to update Google's consent state via dataLayer updates
  • Google Analytics, Google Ads, and other Google services listen to these dataLayer consent signals and adjust their behavior accordingly
  • Provides late consent initialization detection to warn if Google tags fire before consent is established
Important Considerations:
  • Initialize this integration before any Google tags to ensure consent signals are set properly
  • Console warnings will appear if tags fire before consent is initialized
  • Enable TCF support only if you're using the Transparency and Consent Framework

Facebook Pixel Integration

Load Facebook Pixel based on user consent

Facebook Pixel integration allows you to load the Facebook Pixel tracking script only when the user has granted consent for the specified category.

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - Facebook Pixel will only load if user has granted consent for this category
pixel_id string Yes Your Facebook Pixel ID (e.g., "123456789")

Basic Usage

Simple Facebook Pixel Setup
// Load Facebook Pixel with consent
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.FacebookPixel({
    category: 4,                // Marketing/Advertising category
    pixel_id: "123456789"      // Your Facebook Pixel ID
})
.build();

How It Works

  • Monitors user consent for the specified category
  • Dynamically loads the Facebook Pixel script when consent is granted
  • Initializes the Pixel and fires the default PageView event
  • Does not load or track if consent is not granted
Important Considerations:
  • Facebook Pixel will not load or track users unless consent is granted for the specified category
  • Always use your actual Pixel ID
  • Test your implementation using Facebook Pixel Helper and in different consent scenarios
  • Review Facebook's privacy and compliance documentation for additional requirements

Microsoft UET Integration

Load Microsoft Universal Event Tracking (UET) based on user consent

Microsoft UET integration enables you to load the Microsoft Universal Event Tracking script only when the user has granted consent for the specified category. This helps ensure compliance with privacy requirements for advertising and analytics tracking.

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - UET will only load if user has granted consent for this category
tag_id string Yes Your Microsoft UET Tag ID (e.g., "12345678")

Basic Usage

Simple Microsoft UET Setup
// Load Microsoft UET with consent
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.MicrosoftUET({
    category: 4,                // Marketing/Advertising category
    tag_id: "12345678"         // Your UET Tag ID
})
.build();

How It Works

  • Monitors user consent for the specified category
  • Dynamically loads the Microsoft UET script when consent is granted
  • Initializes the UET tag and starts tracking page views and conversions
  • Does not load or track if consent is not granted
Important Considerations:
  • UET will not load or track users unless consent is granted for the specified category
  • Always use your actual UET Tag ID
  • Test your implementation using Microsoft UET Tag Helper and in different consent scenarios
  • Review Microsoft's privacy and compliance documentation for additional requirements

Microsoft Clarity Integration

Load Microsoft Clarity analytics and manage consent signals based on user consent

Microsoft Clarity integration enables you to load the Microsoft Clarity user behavior analytics script and manage consent signals based on user preferences. This integration uses the consentv2 API to communicate ad_storage and analytics_storage choices to Clarity, ensuring tracking complies with consent settings from TrustArc's Cookie Consent Manager (CCM).

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - The Clarity script will only load if the user has granted consent for this category.
clarity_project_id string Yes Your unique Microsoft Clarity Project ID (e.g., "clarity123").
ad_storage number Yes CCM category mapping for advertising-related storage consent.
analytics_storage number Yes CCM category mapping for analytics-related storage consent.

Basic Usage

Simple Microsoft Clarity Setup
// Load Microsoft Clarity with consent
const builder = new IntegrationBuilder({
    consent_config: "notice_behavior",
    logging: true
})
.MicrosoftClarity({
    category: 2,                        // Main category to load Clarity script
    clarity_project_id: "clarity123",   // Your Clarity Project ID
    ad_storage: 3,                      // Map to Advertising consent category
    analytics_storage: 2                // Map to Analytics consent category
})
.build();

How It Works

  • Monitors user consent for the specified primary category.
  • Dynamically loads the Clarity tracking script only after the user grants consent for that category.
  • Uses the consentv2 API to pass the user's consent decision to Clarity.
  • Maps TrustArc CCM categories to Clarity's ad_storage and analytics_storage consent types to send a "granted" or "denied" signal.
  • When consent is denied, Clarity operates in a limited mode and does not set any cookies.
Important Considerations:
  • The Clarity script will not load without a valid clarity_project_id.
  • Ensure your TrustArc categories for ad_storage and analytics_storage are mapped correctly according to your organization's privacy policies.
  • Starting October 31, 2025, Clarity will enforce consent signal requirements for users in the European Economic Area (EEA), the UK, and Switzerland.
  • Review Microsoft's privacy and compliance documentation for any additional requirements.

Amazon Advertising Consent Solution (ACS)

Amazon ACS based on user consent

The Amazon Advertising Consent Solution (ACS) integration enables you to manage Amazon ad consent in compliance with user preferences, leveraging TrustArc's consent categories. This integration loads the Amazon ACS script only when the user has granted consent for the specified category, and dynamically updates consent settings as user choices change.

Basic Usage

Simple Amazon ACS Setup
const builder = new IntegrationBuilder({
                consent_config: "consent_model",
                logging: true
            })
            .AmazonACS({
                category: 3,                // Consent category required for Amazon ACS
                ad_storage: 3,              // Consent category mapping for ad_storage
                user_data: 3,               // Consent category mapping for user_data
                ip_address: "",             // Optional: override IP address. Can be omitted from the config
                optout_setting: "opt-out"      // Optional: implied location for consent. Can be omitted from the config
            })
            .build();
            

Configuration Options

Property Type Required Description
category number Yes Consent category required to load Amazon ACS. The script loads only if the user has granted consent for this category.
ad_storage number Yes CCM category mapping for ad storage consent.
user_data number Yes CCM category mapping for user data consent.
ip_address string No Override the detected IP address for consent (must be a valid IPv4 address).
optout_setting string No Specify a default location for implied consent (e.g., "us").

How It Works

  • Loads the Amazon ACS script only if the user has granted consent for the specified category.
  • Maps TrustArc consent categories to Amazon's adStorage and userData consent types.
  • Automatically updates Amazon consent settings if the user changes their consent preferences.
  • Supports IP address override and implied location for advanced use cases.

MixPanel Integration

Load MixPanel analytics based on user consent

MixPanel integration allows you to load the MixPanel analytics script only when the user has granted consent for the specified category. This ensures that analytics tracking is performed in compliance with user privacy preferences.

Configuration Options

Property Type Required Description
category number Yes CCM category mapping - MixPanel will only load if user has granted consent for this category
token string Yes Your MixPanel project token (e.g., "abc123xyz")

Basic Usage

Simple MixPanel Setup
// Load MixPanel with consent
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.MixPanel({
    category: 2,                // Analytics category
    token: "abc123xyz"         // Your MixPanel project token
})
.build();

How It Works

  • Monitors user consent for the specified category
  • Dynamically loads the MixPanel script when consent is granted
  • Initializes MixPanel with your project token and starts tracking events
  • Does not load or track if consent is not granted
Important Considerations:
  • MixPanel will not load or track users unless consent is granted for the specified category
  • Always use your actual MixPanel project token
  • Test your implementation using MixPanel's debug tools and in different consent scenarios
  • Review MixPanel's privacy and compliance documentation for additional requirements

Shopify Integration

Synchronize TrustArc consent with Shopify's Consent Tracking API

Shopify integration automatically initializes Shopify's consent-tracking-api and maps consent states from TrustArc Cookie Consent Manager to Shopify's customerPrivacy API. This ensures Shopify analytics and marketing scripts only run when the user has granted the appropriate consent.

Configuration Options

Property Type Required Description
analytics number No Map to Analytics consent
marketing number No Map to Marketing consent
preferences number No Map to Preferences consent
sale_of_data number No Map to Sale of Data consent

Basic Usage

Shopify Consent Sync Example
// Integrate Shopify Consent Tracking with TrustArc Consent Manager
const builder = new IntegrationBuilder({
    consent_config: "consent_model", // TrustArc cookie name
    logging: true
})
.Shopify({
    analytics: 2,         // Map TrustArc Analytics consent (category 2)
    marketing: 3,         // Map TrustArc Marketing consent (category 3)
    preferences: 3,       // Map TrustArc Preferences consent (category 3)
    sale_of_data: 3,      // Map TrustArc Sale of Data consent (if applicable)
})
.build();

How It Works

  • Initializes Shopify's consent-tracking-api automatically when Shopify is detected on the page.
  • Maps consent states from TrustArc Cookie Consent Manager to Shopify's customerPrivacy API.
  • On consent changes, updates Shopify's consent using window.Shopify.customerPrivacy.setTrackingConsent with the mapped values.
  • Handles both immediate and delayed Shopify script loading, ensuring the Consent Tracking API is always initialized before setting consent.
  • Supports custom mapping for analytics, marketing, preferences, and sale_of_data consent types.
Note: The Shopify integration will only function if the Shopify scripts are present on the page. Ensure your Shopify theme includes the required Shopify JavaScript objects.

YouTube & Vimeo Video Integrations

Consent-aware video embedding with placeholder support

YouTube and Vimeo integrations provide wrappers for video embeds that will render the video only if the user has granted consent for the specified category. If consent is denied, a customizable placeholder is shown instead. Both integrations work the same way and support the same options for privacy compliance and a consistent user experience.

Configuration Options (Common)

Property Type Default Description
category number Consent category required to show the video
consent_title string "Consent Required" Title shown in the placeholder when consent is denied
consent_message string "Please update your cookie preferences to view this content" Message shown in the placeholder when consent is denied
auto_thumbnail boolean false Automatically fetch and use the best thumbnail for the video
border_radius number 0 Border radius (in px) for the video/placeholder
background_opacity number 5 Background opacity for the placeholder (0-10)
background_style string "pattern" Background style for the placeholder. Options: "pattern" (default), "solid", "blur", "dots", "lines".
autoblock_placeholder boolean false Enable autoblock placeholder for blocked iframes
ask_for_consent boolean false If true, shows a consent prompt overlay (instead of just a placeholder) allowing the user to grant consent directly from the video block.

YouTube & Vimeo Script Data Attributes

Attribute Type Description
data-youtube-video / data-vimeo-video string Video ID for YouTube or Vimeo.
data-title string Optional. Title for the video or placeholder.
data-consent-title string Optional. Title shown in the placeholder when consent is denied.
data-consent-message string Optional. Message shown in the placeholder when consent is denied.
data-thumbnail string Optional. URL to a thumbnail image for the placeholder.
data-video-query-parameters string (JSON) Optional. JSON string of query parameters for the video iframe (e.g. {"autoplay":1}).
data-border-radius number Optional. Border radius for the video/placeholder (in px).
data-width number Optional. Width of the video (in px).
data-height number Optional. Height of the video (in px).

HTML Implementation

Tip: The parameters data-title, data-consent-title, data-consent-message, and data-thumbnail are optional. You can customize them per video, and any value set here will override the default integration setting for that video.
See the placeholder for YouTube and Vimeo
YouTube Video Wrapper Example
<!-- YouTube video wrapper -->
<div 
  data-youtube-video="YOUR_VIDEO_ID" 
  data-width="560" 
  data-height="315" 
  data-title="Optional title" 
  data-consent-title="Optional consent title" 
  data-consent-message="Optional custom message" 
  data-thumbnail="URL to thumbnail image" 
  data-video-query-parameters='{"autoplay":1,"controls":0}' 
  data-border-radius="8">
</div>
Vimeo Video Wrapper Example
<!-- Vimeo video wrapper -->
<div 
  data-vimeo-video="YOUR_VIDEO_ID" 
  data-width="560" 
  data-height="315" 
  data-title="Optional title" 
  data-consent-title="Optional consent title" 
  data-consent-message="Optional custom message" 
  data-thumbnail="URL to thumbnail image" 
  data-video-query-parameters='{"autoplay":1,"controls":0}' 
  data-border-radius="8">
</div>

Builder Usage

YouTube Integration Setup
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
    // Configure YouTube video integration
.YouTube({
    category: 4, // Consent category required to show video
    auto_thumbnail: true, // Automatically fetch thumbnail
    border_radius: 8, // px, optional
    consent_message: "Please accept cookies to watch this YouTube video.",
    autoblock_placeholder: true, // Enable autoblock placeholder for blocked iframes
    ask_for_consent: true // Show consent prompt overlay (optional)
})
    // Configure Vimeo video integration
.Vimeo({
    category: 4, // Consent category required to show video
    auto_thumbnail: true, // Automatically fetch thumbnail
    border_radius: 8, // px, optional
    consent_message: "Please accept cookies to watch this Vimeo video.",
    autoblock_placeholder: true, // Enable autoblock placeholder for blocked iframes
    ask_for_consent: true // Show consent prompt overlay (optional)
})

.build();

How It Works

  • Scans for div[data-youtube-video] or div[data-vimeo-video] wrappers and manages their rendering.
  • If consent is granted, replaces the wrapper with a YouTube or Vimeo iframe using privacy-enhanced settings.
  • If consent is denied, shows a placeholder with a play button, title, and customizable message.
  • Supports auto-generated thumbnails, custom consent messages, and autoblock placeholder for blocked iframes.
  • All parameters can be set via HTML data-* attributes or via the builder config.
Warning: If you enable auto_thumbnail: true, thumbnails are fetched from YouTube or Vimeo before consent is granted. These requests may include ETags or tracking headers, which can pose a privacy risk by exposing user information to the video platform prior to consent.
Tip: To avoid third-party requests before consent, use the data-thumbnail="URL to thumbnail image" attribute to specify a thumbnail hosted on your own webserver or CDN.

Third Party Content Integration

Consent management for embedded social, forms, and other third-party content

Third Party Content integration provides a flexible way to manage consent for any embedded content that is not covered by a dedicated integration. This includes social media feeds, marketing forms, analytics widgets, and other third-party embeds. The integration automatically discovers containers with data-consent-category attributes and handles consent management for each independently.

Configuration Options

Property Type Required Description
show_title_on_hover boolean No Show content title only on hover (default: false)
consent_title string No Default consent title for placeholders (default: "Consent Required")
consent_message string No Default consent message for placeholders (default: "Please accept cookies to view this content")
background_opacity number No Background opacity for placeholders (1-10, default: 5)
background_style string No Background style for the placeholder. Options: "pattern" (default), "solid", "blur", "dots", "lines".
border_radius number No Border radius for content/placeholder (in px, default: 0)
autoblock_placeholder boolean No Enable autoblock placeholder for blocked iframes (default: false)
ask_for_consent boolean No If true, shows a consent prompt overlay (instead of just a placeholder) allowing the user to grant consent directly from the content block.
content_type string No Force a default content type for all blocks. Accepts "video", "social", "form", "image", or "maps". Can be overridden per block with data-content-type.

Script Data Attributes

Attribute Type Description
data-consent-category number Consent category required to show the content block.
data-title string Optional. Title for the content block or placeholder.
data-consent-title string Optional. Title shown in the placeholder when consent is denied.
data-consent-message string Optional. Message shown in the placeholder when consent is denied.
data-thumbnail string Optional. URL to a thumbnail image for the placeholder.
data-content-type string Optional. Content type for the block. Accepts video, social, form, image, maps.
data-width number Optional. Width of the content block (in px).
data-height number Optional. Height of the content block (in px).

HTML Implementation

Third Party Content Wrapper Example
<!-- Example: Twitter feed with consent -->
<div 
  data-consent-category="3" 
  data-consent-message="Please accept cookies to view this content" 
  data-title="Twitter Feed" 
  data-content-type="social" 
  data-width="600" 
  data-height="400">
<template>
    <!-- Embedded third-party content here (e.g., Twitter widget, Marketo form, etc.) -->
    <!-- Example: Twitter Timeline Embed -->
    <a class="twitter-timeline" 
         data-width="600" 
         data-height="400" 
         href="https://twitter.com/TwitterDev?ref_src=twsrc%5Etfw">
        Tweets by TwitterDev
    </a>
    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</template>
</div>
Tip: The data-title, data-consent-title, data-consent-message, and data-thumbnail attributes are optional and can be customized per content block. Any value set here will override the integration defaults for that content.
See the placeholder for Third Party Content

Builder Usage

Third Party Content Integration Setup
const builder = new IntegrationBuilder({
    consent_config: "consent_model",
    logging: true
})
.ThirdPartyContent({
    show_title_on_hover: false, // Show title only on hover
    consent_title: "Consent Required", // Default title
    consent_message: "Please accept cookies to view this content", // Default message
    background_opacity: 5, // Placeholder background opacity
    border_radius: 0, // Border radius in px
    autoblock_placeholder: true, // Enable autoblock placeholder for blocked iframes
    ask_for_consent: true // Show consent prompt overlay (optional)
})
.build();

How It Works

  • Scans for div[data-consent-category] wrappers and manages their rendering based on user consent for the specified category.
  • If consent is granted, renders the embedded content from the <template> inside the wrapper.
  • If consent is denied, shows a customizable placeholder with a title, message, and optional thumbnail.
  • Supports per-content customization via data-* attributes, which override integration defaults.
  • Works with any type of third-party content: social feeds, forms, widgets, analytics, and more.
  • Automatically detects and manages content type for better placeholder visuals (can be overridden with data-content-type).
Important Considerations:
  • Always place the actual third-party embed code inside a <template> tag within the wrapper. The integration will only render this content if consent is granted.
  • Use data-consent-category to specify which consent category is required for each content block.
  • Test your implementation with different consent scenarios to ensure proper blocking and unblocking of content.

JavaScript Integration

Consent-based loading for custom scripts (category and vendor-based)

JavaScript Integration manages the loading and execution of custom JavaScript code (inline or external) based on user consent. It supports both category-based and vendor-based consent, allowing you to block or enable scripts until the user has granted the appropriate permissions. This is ideal for custom tags, marketing pixels, analytics, or any third-party scripts not covered by a dedicated integration.

Script Data Attributes

Attribute Type Description
data-consent-category number CCM category number for category-based consent (e.g. 2 for Analytics, 3 for Marketing).
data-consent-vendor string Vendor domain for vendor-specific consent (e.g. googletagmanager.com).
data-src string External script URL to load when consent is granted.
data-script-name string Optional name/description for logging purposes.
type string Must be text/plain to prevent execution until consent is granted.

HTML Implementation

Tip: Use type="text/plain" to prevent scripts from executing before consent. Use data-consent-category for category-based consent, or data-consent-vendor for vendor-based consent. data-src is used for external scripts.
Category-based External Script
<!-- External script with category consent -->
<script data-consent-category="3" data-src="https://example.com/script.js" type="text/plain"></script>
Category-based Inline Script
<!-- Inline script with category consent -->
<script data-consent-category="3" type="text/plain">
  console.log('This script requires category consent');
  // Your JavaScript code here
</script>
Vendor-based External Script
<!-- External script with vendor consent -->
<script data-consent-vendor="googletagmanager.com" data-src="https://www.googletagmanager.com/gtag/js?id=GA_ID" type="text/plain"></script>
Vendor-based Inline Script
<!-- Inline script with vendor consent -->
<script data-consent-vendor="connect.facebook.net" type="text/plain">
  fbq('init', 'YOUR_PIXEL_ID');
  fbq('track', 'PageView');
</script>

Builder Usage

JavaScript Integration Setup
const builder = new IntegrationBuilder({
    logging: true
})
.JavaScript()
.build();

How It Works

  • Scans for <script> tags with data-consent-category or data-consent-vendor attributes.
  • Prevents execution of scripts until the user has granted the required consent.
  • Supports both inline and external scripts (via data-src).
  • Integrates with TrustArc Privacy Manager API for vendor consent.
  • Prevents duplicate script execution and manages vendor-specific consent independently.
  • Provides logging and warnings for scripts that are not properly configured for consent management.
  • Automatically discovers and manages new scripts added to the DOM after initialization.
Important Considerations:
  • Always use type="text/plain" for scripts that require consent. The integration will convert and execute them only after consent is granted.
  • For external scripts, use data-src instead of src to prevent premature loading.
  • Scripts that are already executed cannot be "un-executed" if consent is later withdrawn. A page reload is the only safe option to remove trackers and third-party scripts after they have been loaded, when a user changes preferences to a stricter option.
  • Use data-consent-category for category-based consent (e.g., Analytics, Marketing) and data-consent-vendor for vendor-specific consent (e.g., Google, Facebook).
  • Test your implementation with different consent scenarios and check the console for integration warnings about unadjusted scripts.

Integration Examples

Live HTML examples showing placeholder behavior for each integration

YouTube Example

Vimeo Example

Third Party Content Example

Release History

Below is a list of all Integration Studio releases. For detailed highlights and release notes, please see the Release Notes section in the Integration Studio Wizard.

Latest Release: Full version | Minified version
Version Date Script Files
1.2.0 2025-10-06 Full (unminified) version
Minified version
1.1.0 2025-07-03 Full (unminified) version
Minified version
1.0.0 2025-06-27 Full (unminified) version
Minified version
Tip: For best performance, use the minified version of the Integration Studio script, as it is smaller and loads faster. If you need to debug issues, use the unminified version by removing .min from the script filename.
Note: Using the latest script URL will always load the most recent release, which is useful for quickly getting new features and fixes. For long-term stability and predictable behavior, you may prefer to use a specific versioned script.
Example: Load Latest Version
<script src="https://consent.trustarc.com/asset/integration-builder-latest.min.js"></script>
Example: Load v1.0.0 (Specific Version)
<script src="https://consent.trustarc.com/asset/integration-builder-v1.0.0.min.js"></script>