Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
UniConsent CMP provides multiple ways to customise the appearance of your consent banner to match your website's design.
The simplest way to customise your banner is through the dashboard project settings:
For advanced styling, add custom CSS in your project settings under the Custom CSS field. This CSS is applied directly to the consent banner.
Change the accept button color:
.unic-btn-accept {
background-color: #2563eb !important;
border-radius: 8px !important;
}
Change the banner background:
.unic-bar {
background-color: #1a1a2e !important;
}
Change the font size:
.unic-bar-text {
font-size: 13px !important;
}
Hide the privacy badge icon:
.unic-icon {
display: none !important;
}
Instead, use a manual trigger button on your page:
<button onclick='__unicapi("openunic");return false;'>Consent Settings</button>
UniConsent offers 10 banner templates:
| Template | Style |
|---|---|
| 0 | Default full-width bar |
| 1 | Push down bar |
| 2 | Mini bar |
| 3 | Mini left corner |
| 4 | Super mini left corner |
| 5 | Floating card |
| 6 | Compact inline bar |
| 7 | Clean stacked card |
| 8 | Bottom sheet panel |
| 9 | Dark compact bar |
Set the template in your project settings under the Template section, or configure it via the barmode parameter.
If you want to build your own consent banner and only use UniConsent for consent storage, vendor list, and compliance, enable API-Only Mode and use the JavaScript API to control consent from your own UI.
In your project dashboard settings:
The CMP tag will still load in the background, handling consent storage, IAB TCF signals, and Google Consent Mode, but the default banner will not appear.
Create your own consent banner HTML. The banner is hidden by default and only shown when the CMP is ready and the user has not yet consented.
<div id="my-consent-banner" style="display:none; position:fixed; bottom:0; left:0; right:0; background:#fff; padding:16px; box-shadow:0 -2px 10px rgba(0,0,0,0.1); z-index:9999;">
<div style="display:flex; align-items:center; justify-content:space-between; max-width:1200px; margin:0 auto;">
<p style="margin:0; font-size:14px;">We use cookies and similar technologies.</p>
<div>
<button onclick="__unicapi('openOptions')">Preferences</button>
<button onclick="__unicapi('openCookiesList')">Cookie List</button>
<button onclick="__unicapi('rejectAll')">Reject All</button>
<button onclick="__unicapi('agreeAll')">Accept All</button>
</div>
</div>
</div>
Add this script after the CMP tag. It polls the dataLayer for the unic_data event to determine if the user has already consented. If no consent is found, the custom banner is shown. Once the user makes a choice, the banner is hidden.
<script>
;(function initConsentBanner() {
var banner = document.getElementById('my-consent-banner')
var resolved = false
function checkConsent() {
if (resolved) return
if (window['dataLayer']) {
for (var i = 0; i < window['dataLayer'].length; i++) {
if (window['dataLayer'][i]['event'] === 'unic_data') {
// User has already consented - keep banner hidden
resolved = true
return
}
}
}
// CMP loaded but no consent yet - show the banner
if (typeof window.__unicapi === 'function' && !resolved) {
banner.style.display = 'block'
}
if (!resolved) {
setTimeout(checkConsent, 200)
}
}
// Listen for new consent actions to hide the banner
var origPush = (window['dataLayer'] = window['dataLayer'] || []).push
window['dataLayer'].push = function () {
var result = origPush.apply(this, arguments)
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] && arguments[i]['event'] === 'unic_data') {
banner.style.display = 'none'
resolved = true
}
}
return result
}
checkConsent()
})()
</script>
| Method | Description |
|---|---|
__unicapi('agreeAll') | Accept all consent purposes |
__unicapi('rejectAll') | Reject all consent purposes |
__unicapi('openunic') | Open the full consent banner (first layer) |
__unicapi('openOptions') | Open the second layer (detailed preferences) |
__unicapi('openVendorList') | Open the vendor list |
__unicapi('openCookiesList') | Open the cookies list |
This approach gives you full control over the first layer design while UniConsent handles consent storage, vendor list management, IAB TCF compliance, and Google Consent Mode signals.
See the full JavaScript API reference for more details.
If you have existing CSS rules on your page that target .unic class selectors, these styles are automatically applied to the consent banner. No additional configuration is needed.
!important when overriding default styles.?uniconsent_test=1&uniconsent_reset=1 to your page URL.