Version: 1.0
Last Updated April 27, 2026
|
Overview
This guide covers how to implement unified consent management across multiple domains using authenticated user context. Key points include:
• Server-Side Signature Generation: Provides a Node.js example for creating an authMac signature using a secret key and a user ID (userId).
• Frontend User Context: Instructions on adding the generated user context (ccmUserId, ccmAuthMac, ccmKeyId) to the page template before loading the main Consent Management (CCM) script. FAQs:
• Authentication: Users must be logged in and identified by a consistent, privacy-compliant ID (e.g., internal ID, hashed username) for unified consent to work. It does not work for unauthenticated users.
• Synchronization: Consent is synchronized immediately on a user's first visit to a new domain and within 24 hours for updates to existing preferences. • Instance Configuration: All grouped instances must have matching categories for synchronization to work. |
Implementation Steps
1 |
Backend: Generate Signature Server-Side |
// Node.js example
constcrypto=require('crypto');
functiongenerateAuthMac(secretKey, userId) {
consthmac = crypto.createHmac('sha256', Buffer.from(secretKey,'base64'));
hmac.update(userId);
returnhmac.digest('base64');
}
// In your page rendering logic
app.get('/', (req, res) => {
constuserId = req.user.uuid; // your authenticated user identifier
// CCM_SECRET_KEY and CCM_KEY_ID provided by TrustArc
constauthMac =generateAuthMac(CCM_SECRET_KEY, userId);
// Pass to template
res.render('index', {
ccmUserId: userId,
ccmAuthMac: authMac,
ccmKeyId: CCM_KEY_ID
});
});
|
* Adapt to your backend technology/framework.
2 |
Frontend: Add User Context |
<!-- In your page template (e.g., index.ejs, index.pug, etc.) -->
<scripttype="text/javascript">
// User context generated server-side
window.truste = window.truste || {};
window.truste.eu = window.truste.eu || {};
window.truste.eu.user = {
id: '<%= ccmUserId %>', // From your server
authMac: '<%= ccmAuthMac %>', // Generated server-side
authSecretId: '<%= ccmKeyId %>' // From environment config
};
</script>
<!-- Then load CCM script as usual -->
<scriptsrc="https://consent.trustarc.com/notice?domain=yourdomain.com&js=bb¬iceType=bb"
type="text/javascript"></script>
|
3 |
Testing |
To test the implementation, do the following steps:
|
① Consent on Website A
While authenticated as user X, consent on website A.
|
→ |
② Visit Website B
Visit website B while authenticated as the same user.
|
→ |
③ Verify Sync
Verify that no banner appears and preferences are synced.
|
Frequently Asked Questions (FAQ)
👥 General Questions
Do users need to log in for this to work?
Yes. You must identify the user with a consistent
user_id (like email or internal user ID). Anonymous users will still see consent banners on each domain/device.What user identifier should I use?
Use any consistent, privacy-compliant identifier:
✓ Internal user ID
✓ Hashed username
✗ Do not use: IP addresses, session IDs, or temporary identifiers
✓ Internal user ID
✓ Hashed username
✗ Do not use: IP addresses, session IDs, or temporary identifiers
Can I use this with unauthenticated users?
No. The feature requires a user identifier to link consent across domains/devices. For unauthenticated users, consent remains instance-specific.
⚙ Instance Configuration
What if my instances have different categories?
All grouped instances must currently have matching categories. If categories do not match, consent cannot be synchronized.
What happens if I change categories on one instance after grouping?
Consent synchronization may fail or produce unexpected results. Ensure category changes are made across ALL grouped instances simultaneously.
↻ Consent Synchronization
How fast is consent synchronized?
Immediate: when a user first visits a new domain/device (if consent exists).
24 hours: for updates to existing consent.
24 hours: for updates to existing consent.
What if a user changes their preferences?
The change is stored immediately. Other devices/domains will see the update within 24 hours. You can trigger a manual sync by clearing the
consent_sync cookie.Does the banner show on every device?
Possibly on the FIRST visit per device (permitted), but if the user has already consented on another device and the same
user_id is provided, the banner should not appear.How long is consent stored?
Based on your CCM configuration (1-13 months).
🔒 Security & Privacy
Can someone forge a signature?
Not without access to your secret key. The signature MUST be generated server-side, and the secret key must never be exposed.
When using the Unified Consent feature to share consent across browsers, apps, and websites, is it necessary to update our default Banner disclosure?
Yes, we recommend updating your banner verbiage and/or your privacy policy to include details about the Unified Consent feature.
Are there any countries/regions for which the Known User functionality is not recommended?
The purpose of this functionality is to provide a better user experience (UX) and reduce the number of times consent is requested. We recommend checking with your legal team regarding any specific country or region restrictions, as this functionality is primarily designed to comply with regulations such as CCPA/CPRA.