Tags

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

WhatDashboard
Cookies componentPartner or company settings: Enable cookies for all sites
Theme config (full JSON)Partner → Themes → edit theme → Managed Cookie Consent
Multi add cookie backend urlSuperadmin → Sites → select sites → Add Cookie Backend URL
Site consent, Backend URL, optional overrideSite → 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

  1. Partner → Themes → edit the site's theme. Paste valid JSON in JSON configuration for cookies.
  2. Save. Plate validates runtime, ui.banner, and ui.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:

  1. The c15t stylesheet
  2. <script id="C15T_CONFIG" type="application/json"> with the merged config
  3. The c15t JavaScript module

Nothing renders yet, because consent is still off for every site.

3. Add the Backend URL

  1. Open the → Superadmin Settings. Go to the sites overview and select the sites that need a cookies backend URL.
  2. Click the option in the selection menu Add Cookie Backend URL
  3. 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 as runtime.backendURL.

In dashboard Site Settings → Privacy Settings

  1. 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

  1. Open partner settings or company settings.
  2. 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:

NameTypeRequiredDescription
runtimeobjectYesRuntime options. The key is required; most properties inside it are optional.
uiobjectYesBanner and dialog copy.

Required under ui:

NameTypeRequiredDescription
banner.idstringYesBanner element id
banner.ariaLabelstringYesAccessible name for the banner
banner.copy.descriptionstringYesBanner body copy
banner.copy.acceptAllstringYesAccept-all label
banner.copy.rejectAllstringYesReject-all label
banner.copy.customizestringYesOpen preferences label
dialog.idstringYesDialog element id
dialog.copy.titlestringYesDialog title
dialog.copy.acceptAllstringYesAccept-all label
dialog.copy.savestringYesSave label
dialog.copy.closestringYesClose label

Optional runtime properties:

NameTypeRequiredDescription
enabledbooleanNoTurns the runtime on or off
mode"hosted" or "offline"NoHosted mode uses backendURL
backendURLstring or nullNo in schema; required in the site UI while consent is onConsent backend. Set on the site with Backend URL
consentCategoriesarray of category namesNoAllowed values below
overridesobjectNocountry, region, language, gpc
i18n.detectBrowserLanguagebooleanNoDetect browser language
debugbooleanNoDebug mode

Allowed category names: necessary, functionality, experience, measurement, marketing.

Optional ui properties:

  • triggerHash (string)
  • dialog.copy.categories: per category title and description
  • consentGate: per category message and action

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

ProblemWhat to check
Tag renders nothingCookies component is off, or Managed Cookie Consent is off on the site
Privacy settings has no consent sectionCookies component is off on the partner or the company
Site level switch is disabledTheme has no c15t_config
Liquid error C15T config is not set for site or themeConsent is on, and both theme and site config are empty
Theme JSON is rejectedRequired ui.banner or ui.dialog copy is missing, or the JSON has keys outside the schema
Banner runs without a backendMerged config has no runtime.backendURL. Set Backend URL on the site

Copyright © 2025