Overview
Optional content allows different information to be presented to customers based on their attributes or their behaviors. These sections can be a powerful personalization technique and allow for varied content without the creation of additional segments or campaigns.
Create optional content
To create optional content:
- Navigate to Campaigns via the main navigation.
- Create a new campaign or edit an existing campaign.
- Add or edit an email touchpoint.
- Select the element, column, or section you'd like to make optional.
- In the Details pane of the sidebar, set the conditional that determines if the content is shown under the Scripting section. Examples can be found here.
- Select the Save option at the upper right.
Optional content examples
The following examples serve as an introduction to how optional content can be used. More advanced logic is possible through the use of custom liquid, and the reference material can be found on the Liquid website. That said, it's recommended that you reach out to your customer success manager before proceeding with advanced personalization.
Birthday month
This example is based on a default Customers field. To create an optional section that only appears if it's the customer's birthday month:
1) In the Setup field for the section create a variable called current_month using:
{% assign current_month = now | date: “%m” %}
2) Next, use the variable in the Condition field to determine if the current_month is the same as the customer's birthday month using:
customer.dob_month == current_month
3) You could also create a different section for customers whose birthday isn't the current month by using the following statement in the Condition field instead.
customer.dob_month != current_month
VIP status
This example is based on a custom customer field. To create an optional section that only appears if the customer is considered a VIP:
1) Create a custom True/False customer field called VIP.
2) Next, reference the VIP attribute in the Condition field of the section to determine if the customer has the VIP value using:
customer.vip == true
3) You could also create a different section for customers who aren't considered VIPs by using:
customer.vip != false
Rating system
This example is based on a custom product field and is specifically applied to an image element. To create an optional section that only appears when a product is associated with a certain rating:
1) Create a custom product field called Rating using the Number field type. For this example, the rating system is from 1 to 5 stars.
2) Add an additional image element in the dynamic product grid of your touchpoint. Position and resize accordingly. For this example, the rating will be shown as a collection of stars.
3) Set the Image URL of the additional image element. In this case, it will be {{star_image}}.
4) Upload the images that represent your ratings to an accessible source.
5) Add the liquid shown below to the setup block of the dynamic grid, ensuring to replace the generic example titles and links with references to your images instead.
{% assign rating = product.rating %} {% if rating == 3 %} {% assign star_image = 'https://url_to_my_asset/3_star_image.gif' %} {% elsif rating == 4 %} {% assign star_image = 'https://url_to_my_asset/4_star_image.gif' %} {% elsif rating == 5 %} {% assign star_image = 'https://url_to_my_asset/5_star_image.gif' %} {% else %} {% assign star_image = 'https://url_to_my_asset/less_than_2_star_image.gif' %} {% endif %}
6) Edit, Save, and Go Live with the campaign as usual.