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.
- 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
Before You Get Started
<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.
<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>
.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.
// 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
// 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