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

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: [email protected]envelope

Last updated