render_plate_consent_ui
Last updated: · Published:
Use {% render_plate_consent_ui %} to render Plate managed cookie consent (c15t) on a site: stylesheet, JSON config, and JavaScript.
Where to find what you need
| What | Dashboard |
|---|---|
| Cookies component | Partner or company settings: Enable cookies for all sites |
| Theme config (full JSON) | Partner → Themes → edit theme → Managed Cookie Consent |
| Multi add cookie backend url | Superadmin → Sites → select sites → Add Cookie Backend URL |
| Site consent, Backend URL, optional override | Site → Privacy settings |
Note: The Cookies component is only available on the site's privacy settings when the component is enabled on the partner or the company.
Set up the feature
Complete these steps in order. The liquid tag alone does not show a banner.
1. Add the theme config
- Partner → Themes → edit the site's theme. Paste valid JSON in JSON configuration for cookies.
- Save. Plate validates
runtime,ui.banner, andui.dialog, including required copy fields.
2. Add the tag to the theme
Place the tag once in the main layout so every page includes it (in <head> or just before </body>):
{% render_plate_consent_ui %}
The tag takes no arguments. It writes:
- The c15t stylesheet
<script id="C15T_CONFIG" type="application/json">with the merged config- The c15t JavaScript module
Nothing renders yet, because consent is still off for every site.
3. Add the Backend URL
- Open the → Superadmin Settings. Go to the sites overview and select the sites that need a cookies backend URL.
- Click the option in the selection menu Add Cookie Backend URL
- Fill in Backend URL (the hosted c15t endpoint, for example
https://consent.example.com). The field is required while Managed Cookie Consent is on. Plate stores it asruntime.backendURL.
In dashboard Site Settings → Privacy Settings
- Optional: add site JSON. It can be a partial override. Site values override theme values.
Add marketing and analytics tags in Google Tag Manager, not in this JSON and not in custom head scripts. The consent config decides whether tags may run. GTM runs them. Use custom scripts in the c15t config only when GTM cannot manage the script.
4. Enable the Cookies component
- Open partner settings or company settings.
- Turn on Enable cookies for all sites and save.
⚠️ This turns Managed Cookie Consent on for all existing sites of that partner or company right away. From this point, the stylesheet, config and c15t script are in the HTML of every site that uses a theme with the tag (see When does the banner appear?). It also adds the Managed Cookie Consent section to each site's Privacy settings.
Turning the component off sets those sites back to off. It will trigger a new prerender for a post. This means that the cookie banner is removed from the post cache. You can check if a component is enabled on company or partner level in Superadmin → Components
📝 A site can still turn Managed Cookie Consent off in Site → Privacy settings. Turn this off when a site has their own cookie implementation. Turning this on/off doesn't affect the code for the site's custom cookie settings.
5. Verify
- Managed Cookie Consent on: the HTML includes the stylesheet,
#C15T_CONFIG, and the c15t bundle. - Managed Cookie Consent off: the tag renders nothing.
- Enabled sites have a cookie backend URL
- Consent on and both theme and site config empty: Liquid error
C15T config is not set for site or theme.
Schema
Theme config (full document)
Required at the root:
| Name | Type | Required | Description |
|---|---|---|---|
runtime | object | Yes | Runtime options. The key is required; most properties inside it are optional. |
ui | object | Yes | Banner and dialog copy. |
Required under ui:
| Name | Type | Required | Description |
|---|---|---|---|
banner.id | string | Yes | Banner element id |
banner.ariaLabel | string | Yes | Accessible name for the banner |
banner.copy.description | string | Yes | Banner body copy |
banner.copy.acceptAll | string | Yes | Accept-all label |
banner.copy.rejectAll | string | Yes | Reject-all label |
banner.copy.customize | string | Yes | Open preferences label |
dialog.id | string | Yes | Dialog element id |
dialog.copy.title | string | Yes | Dialog title |
dialog.copy.acceptAll | string | Yes | Accept-all label |
dialog.copy.save | string | Yes | Save label |
dialog.copy.close | string | Yes | Close label |
Optional runtime properties:
| Name | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Turns the runtime on or off |
mode | "hosted" or "offline" | No | Hosted mode uses backendURL |
backendURL | string or null | No in schema; required in the site UI while consent is on | Consent backend. Set on the site with Backend URL |
consentCategories | array of category names | No | Allowed values below |
overrides | object | No | country, region, language, gpc |
i18n.detectBrowserLanguage | boolean | No | Detect browser language |
debug | boolean | No | Debug mode |
Allowed category names: necessary, functionality, experience, measurement, marketing.
Optional ui properties:
triggerHash(string)dialog.copy.categories: per categorytitleanddescriptionconsentGate: per categorymessageandaction
Site config
The site does not need to repeat the full schema. A fragment is valid when every key exists in the schema. Plate merges the fragment onto the theme config and validates the merged result.
Example: minimum valid theme config
{
"runtime": {
"enabled": true,
"mode": "hosted",
"backendURL": "https://consent.example.com"
},
"ui": {
"banner": {
"id": "cookie-banner",
"ariaLabel": "Cookie banner",
"copy": {
"description": "We use cookies to run the site and remember your preferences.",
"acceptAll": "Accept all",
"rejectAll": "Reject all",
"customize": "Customize"
}
},
"dialog": {
"id": "cookie-dialog",
"copy": {
"title": "Cookie settings",
"acceptAll": "Accept all",
"save": "Save",
"close": "Close",
"categories": {
"necessary": {
"title": "Necessary",
"description": "Required for the site to function."
},
"measurement": {
"title": "Measurement",
"description": "Helps us understand how the site is used."
},
"marketing": {
"title": "Marketing",
"description": "Used for relevant advertising."
}
}
}
}
}
}
Troubleshooting
| Problem | What to check |
|---|---|
| Tag renders nothing | Cookies component is off, or Managed Cookie Consent is off on the site |
| Privacy settings has no consent section | Cookies component is off on the partner or the company |
| Site level switch is disabled | Theme has no c15t_config |
Liquid error C15T config is not set for site or theme | Consent is on, and both theme and site config are empty |
| Theme JSON is rejected | Required ui.banner or ui.dialog copy is missing, or the JSON has keys outside the schema |
| Banner runs without a backend | Merged config has no runtime.backendURL. Set Backend URL on the site |