Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
Consent DB allows you to log, store, and query consent records in real time. When enabled, every consent event is recorded with the user's UUID, consent string, IP address, and optional identity mappings.
Consent DB is only available to Enterprise accounts. Please contact support@uniconsent.com to enable it.
The Consent DB uses a data layer pattern similar to Google Tag Manager's dataLayer. You can push data to window._unicData at any time — before or after the CMP script loads.
<script>
window._unicData = window._unicData || [];
</script>
Link user identities (e.g. after login) to the consent UUID. These IDs will be included in all subsequent consent log events.
window._unicData = window._unicData || [];
_unicData.push({
user_ids: {
auth_uid: 'user_12345',
email_hash: 'sha256_of_email'
}
});
You can push multiple times — user IDs are merged:
_unicData.push({ user_ids: { auth_uid: 'user_12345' } });
_unicData.push({ user_ids: { loyalty_id: 'LY9876' } });
// Result: { auth_uid: 'user_12345', loyalty_id: 'LY9876' }
To immediately send an identity event linking user IDs to the consent UUID without waiting for a consent action:
_unicData.push({
event: 'send_identity',
user_ids: {
auth_uid: 'user_12345'
}
});
| ID Type | Description |
|---|---|
auth_uid | Authenticated user ID from your login system |
email_hash | SHA-256 hash of the email address |
customer_id | Your internal customer or account ID |
crm_id | CRM system ID |
email | Plain email address |
phone | Plain phone number |
phone_hash | SHA-256 hash of the phone number |
We recommend using auth_uid or email_hash as the primary identifier. Use hashed IDs instead of plain email or phone when possible — hashed IDs are still searchable in the dashboard while reducing PII exposure.
You can also define custom ID types in the dashboard under Consent Logs > Search > Settings (gear icon). Custom types must be lowercase alphanumeric with underscores, up to 64 characters (e.g. loyalty_id, subscriber_id).
You can retrieve the consent UUID from the user's local storage key __unid, or via the JavaScript API:
__unicapi('getConsentId', 2, (consentId) => {
console.log(consentId);
});
Consent DB is supported across all UniConsent SDKs. Set user identities before launching the CMP — they will be automatically linked to consent records.
UniConsent.instance
.setAppId('your_app_id')
.setUserIds({'auth_uid': 'user_12345', 'email_hash': 'sha256_of_email'})
.launchCMP(context);
<UniConsentProvider
licenseId="your_app_id"
userIds={{ auth_uid: 'user_12345', email_hash: 'sha256_of_email' }}
>
{children}
</UniConsentProvider>
Map<String, String> ids = new HashMap<>();
ids.put("auth_uid", "user_12345");
ids.put("email_hash", "sha256_of_email");
UniConsent.getInstance()
.setAppId("your_app_id")
.setUserIds(ids)
.launchCMP(activity);
UniConsent.shared.setUserIds(["auth_uid": "user_12345", "email_hash": "sha256_of_email"])
UniConsent.shared.launchCMP(rootVC: viewController)
When Consent DB is enabled, a Consent Logs page appears in the sidebar under Consent Data. The dashboard provides:
auth_uid)Enter the consent UUID in the UUID search field to find all consent records for a specific device or browser.
Select an ID type (e.g. auth_uid) and enter the ID value to find all consent records across devices linked to that identity.
Contact us: support@uniconsent.com