Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
Consent Logging (Consent DB) records every consent event from your users, allowing you to query and audit consent records by UUID or user identity. This guide walks you through enabling and using the feature.
Once published, the CMP will automatically start sending consent events to the Consent DB.
To associate consent records with your users (e.g. after login), add the following code to your page:
<script>
window._unicData = window._unicData || [];
_unicData.push({
user_ids: {
auth_uid: 'your_user_id'
}
});
</script>
This code can be placed anywhere on the page — before or after the CMP script loads. The CMP will pick up the user IDs and include them in consent events.
You can include multiple identity types:
_unicData.push({
user_ids: {
auth_uid: 'user_12345',
email_hash: 'sha256_hash_of_email',
customer_id: 'CUST-9876'
}
});
On websites, you can also pass the address as email. It is converted to email_hash (SHA-256 of the trimmed, lowercase address) in the browser, and the address itself is not stored:
_unicData.push({ user_ids: { email: 'name@example.com' } });
auth_uid) and enter the value to find records across devicesEach record shows what it holds:
| Type | Records |
|---|---|
| IAB TCF EU | The IAB TCF consent string |
| GPP TCF CA | The IAB TCF Canada choice, as a GPP string |
| CCPA | The US Privacy string |
| GPP CCPA | The CCPA choice, as a GPP string, when IAB GPP is enabled |
| GPP US States | The US State Privacy choice, as a GPP string |
| Google AC | Google Additional Consent |
| Category | The cookie category choices |
| Custom vendors | The choices for vendors you added |
| Custom | The custom purpose choices |
| Age | The user's answer to the age check, such as over 18 |
GPP strings are recorded in full, with the GPP header, so any GPP decoder can read them.
If you use identity types beyond the system defaults, you can add custom ones:
loyalty_id)Custom ID types will appear in the search dropdown alongside the system defaults.
<!-- UniConsent CMP tag (async) -->
<script async src='https://cmp.uniconsent.com/v2/YOUR_PROJECT_ID/cmp.js'></script>
<!-- Set user identity (works before CMP loads) -->
<script>
window._unicData = window._unicData || [];
// After user login, push their identity
function onUserLogin(userId, emailHash) {
_unicData.push({
user_ids: {
auth_uid: userId,
email_hash: emailHash
}
});
}
</script>
enable_consentdb enabled_unicData.push() are picked upContact us: support@uniconsent.com
Privacy laws, consent and compliance updates, a few emails a month.