Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
You can load your third-party JavaScript tags only when the visitor's consent allows them. Choose the method that fits where your tags are:
| Your tags are | Use |
|---|---|
| In your page code | UnicScript attributes on the tags, or the Consent Ready API (unicReady and unicUpdate) in your own code |
| In Google Tag Manager | Google tags: Consent Mode. Other tags: a unic_data trigger with a consent condition (Method 3) |
| Not in your code, and you do not want to change it | The Tags Loader in your dashboard |
For tags in your page code, change the tag's type to text/unicscript and add the purpose, category or vendor it needs. See UnicScript.
Run your own code when consent allows it. If you installed UniConsent with the single tag, unicReady runs your code once consent is final, and unicUpdate runs it again after every change. See the Consent Ready API and the JavaScript API.
Google tags read Google Consent Mode, so they can load on the All Pages trigger. See Consent Mode for Google Tag Manager.
For other tags, use the unic_data event, which UniConsent pushes to the data layer with the visitor's consent:
UNIC_IS_LOAD. Under Format Value, turn on Convert true to 1 and Convert false to 0.
unic_data with the condition UNIC_IS_LOAD equals 1.
UNIC_IS_LOAD is true where IAB TCF applies only when the visitor allows storage or any custom vendor: it is false before a choice and after a reject. It is always true where IAB TCF does not apply. Consent category choices and a US opt-out do not change it, so for those also add a condition on the matching variable: UNIC_EP_1 to UNIC_EP_4 for consent categories, or UNIC_P_1 to UNIC_P_10 for purposes.
For a custom vendor, add the vendor in the CMP to get its ID, then also check its consent: for example customVendors.1 equals true for vendor 1.
unic_data is pushed at page load and again after each consent choice or change, so a trigger on it can fire more than once on a page. All its variables are listed in the JavaScript API.