---
title: "Preference Based Dynamic Content"
slug: "preference-based-dynamic-content"
updated: 2026-06-08T21:38:56Z
published: 2026-06-08T21:38:56Z
canonical: "docs.xtremepush.com/preference-based-dynamic-content"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preference Based Dynamic Content

Create dynamic cmapiagn content using user consent preferences

You can create dynamic content that displays different information to users based on their specific consent preferences. This is ideal in scenarios where you need to tailor messages within a single campaign to users with varying consent preferences.

> [!TIP]
> To enable this feature for your project, please contact your account manager. You must also have consent management enabled on your project.

## Overview

When you create a campaign, use the consent preference icon shown in the image below to create preference-based dynamic content.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/710a3e447c765fdc98357e47347c466d191470cddc15cd58fb73145f1e8db59f-Screenshot_2026-02-23_at_16.16.02(1).png)

Preference icon used to create preference-based dynamic content

You can then use Twig to set conditional rules for your content. If a user meets the criteria you specify, they see the conditional content. If the user does not meet the criteria, the content is either hidden or alternative content is displayed, depending on your configuration. See [use cases](/documentation/docs/preference-based-dynamic-content#use-cases) below for more information on adding dynamic preference based content.

The location of the preference icon varies depending on the campaign:

- For single stage campaigns across all channels except email, go to **Message Text** in the **Content** tab as shown in the image below.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/c3357f1c02bd8caafd556b908fd44ec71b175014d6c21890db0ca5b55d3a94c2-Screenshot_2026-02-23_at_14.35.39(1).png)

Preference icon in single stage campaigns (except email)
- For single stage email campaigns and multistage campaigns with an email action, open the email builder and select **Dynamic Content** as shown in the image below. Then click **Consent Preferences**.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/31d8cf8ce5df7d8c559724dde63af19faf481b8fab582329b37c36db05ffedb0-Screenshot_2026-02-23_at_14.37.10(1).png)

Adding preferences in email campaigns

> [!NOTE]
> Preview for email campaigns
> 
> For email campaigns, you can preview how the preference based dynamic content appears in the **Preview** tab. Select the user for whom the message will render in the **User Profile** tab.
> 
> You can also use the **Custom Data** tab within the **Preview** tab to change preference values to 0, 1, or null to see how the message renders for different preferences.

- For multistage campaigns for all message actions except email, go to the **Message** section as shown in the image below.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/6685763c19d0f76f9cecdd693047f04669380e10fa638481860ffa960e6682db-Screenshot_2026-02-23_at_14.43.42(1).png)

Preference icon in multistage campaigns

## Use Cases

## Discount promotions for marketing subscribers

In this example, you want to include a promotion in your monthly email for users subscribed to email promotions. The email content of your campaign would look like this:

```twig
Thank you for being a valued customer. This is our monthly update for October.

{% if user.preferences['promotions']['email'] %}
🎉 Exclusive 20% discount just for you! Claim here.
{% endif %}
```

The general email message is sent to all users:

```plaintext
Thank you for being a valued customer. This is our monthly update for October.
```

The message displayed to users whose `promotions` preference is set to `true`:

```plaintext
Thank you for being a valued customer. This is our monthly update for October.

🎉 Exclusive 20% discount just for you! Claim here.
```

## Conditional content for different subscribers

This example shows how to display newsletter content to subscribers while prompting non-subscribers to sign up.

```twig
{% if user.preferences['newsletter']['email'] %}
Here’s this week’s full newsletter content.
{% else %}
You’re currently not subscribed to our newsletter.
Click here to manage your preferences.
{% endif %}
```

If a user is subscribed to the newsletter, the following message is displayed:

```plaintext
Here’s this week’s full newsletter content.
```

If they are not subscribed, the following message is displayed:

```plaintext
You’re currently not subscribed to our newsletter.
Click here to manage your preferences.
```

## Send a summary of user preferences

This example shows how to send a summary of current preferences to your users.

```twig
Hi, here is a summary of your current communication settings: 

Email Promotions: {{ user.preferences['promotions']['email'] ? 'Yes' : 'No' }} 
SMS Offers: {{ user.preferences['offer']['sms'] ? 'Yes' : 'No' }}
```

Based on individual user preferences, the message displays either a yes or no for each category. For example, if a user is subscribed to email promotions but opted out of SMS offers, their message would appear as follows:

```plaintext
Hi, here is a summary of your current communication settings:

Email Promotions: Yes
SMS Offers: No
```
