> For the complete documentation index, see [llms.txt](https://community.commandersact.com/customer-success/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community.commandersact.com/customer-success/expand-your-uses/consent-management/cmp-customisation-dynamic-and-contextual.md).

# CMP customisation (dynamic & contextual)

This guide explains how to transform your consent banner into a highly personalised communication medium by injecting dynamic data from your DataLayer via the TMS.

### 1. Business value: Reduce the distance between you and the user

By displaying familiar or local data on the consent banner, you break the perception of a generic message and automatically increase engagement.

* **Local relevance**: Mentioning the nearest store or the user's city creates a sense of proximity and reassurance.
* **Opt-in maximisation**: A user who understands that consent is used to improve their specific experience (e.g. local weather, in-store stock) is more likely to accept.
* **Brand consistency**: Align the CMP message with the current browsing context for a smooth and less disruptive experience.

### 2. Implementation methodology

#### Step A: Identification of key variables (DataLayer)

Determine which data on your site can enrich the CMP message.

* **Examples**: user\_city, favourite\_store\_name, current\_category, cart\_amount.

### Step B: Capture data in the TMS

Use your TMS to extract these values and store them in Commanders Act variables.

1. Create a ‘DataLayer’ type variable (e.g. dl\_store\_city).
2. Ensure that this data is available when the CMP is triggered.

#### Step C: Dynamic injection into the CMP template

Modify the HTML/JS content of your banner to include ‘placeholders’ (dynamic text areas).

* **Action**: Use the CMP script to replace generic text with the value of the TMS variable.
* **Example wording**: ‘To show you offers from our store in {{dl\_store\_city}}, we need your consent.’

#### Step D: Visual customisation (images & logos)

The TMS can also modify the URL of an image or the colour of the banner depending on a segment or page.

* **Example**: Display a ‘Running’ visual on sports pages and a ‘Lifestyle’ visual on the rest of the site.

#### **Step E: Rendering test**

Check that if the data is missing from the DataLayer, a consistent ‘Fallback’ (default) message is displayed so that no empty areas are left.

### 3. Typical use cases

1. **The ‘Local’ CMP**: The site detects the user's favourite store. The TMS retrieves the information and the CMP displays: *‘Hello! Accept cookies to see real-time stock levels for your \[Store\_Name] store.’*
2. **Customisation by Product Universe**: On a women's product page, the CMP displays a feminine fashion image. On a men's product page, the visual changes. This visual consistency reduces the rate of closure without selection.
3. **Shopping Cart Reassurance**: If the user has items in their shopping cart, the banner can specify: *‘By accepting cookies, we will save your shopping cart for your next visit.’*

### 4. Additional resources

To further develop your strategy and discover concrete examples of compliant design and wording, we invite you to consult our comprehensive guide.

{% file src="/files/HdMcm9wbgF0GQD6zvnN2" %}

### Need help making your banner dynamic?

Our experts can help you map your DataLayer variables to your banner template for seamless customisation. **Contact your dedicated consultant or our support team:** <support@commandersact.com>
