Optional content lets you present information 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
- Go to Activations > Overview.
- Create or edit a campaign.
- Add or edit an email touchpoint.
- Select the element, column, or section you want to make optional.
- Set the condition under Details > Scripting that determines whether the content is shown.
- Click Save.
Optional content examples
The following examples serve as an introduction to how you can use optional content. More advanced logic is possible through the use of custom Shopify liquid. Contact your customer success manager before proceeding with advanced personalization.
Birthday month
The following example is based on a default Customers field and only displays if it is the customer's birthday month.
- Select a Section in your email content.
- Click Setup in the Scripting section of the Details tab.
- Create a variable called
current_month
, then click Save.{% assign current_month = now | date: “%m” %}
- Click Condition, enter the following code snippet to determine if the
current_month
is the same as the customer's birthday month, then click Save.customer.dob_month == current_month
- (Optional) Create a different section for customers whose birthday is not the current month by using the following code snippet in Condition instead:
customer.dob_month != current_month
VIP status
The following example is based on a custom customer field and only displays if the customer is considered a VIP.
- Create a custom True/False customer field called VIP.
- Reference the VIP attribute in Condition to determine if the customer has the VIP value.
customer.vip == true
- (Optional) Create a different section for customers who are not considered VIPs.
customer.vip != false
Rating system
The following example is based on a custom product field and displays when a product is associated with a certain rating.
- Create a custom product field called Rating using the Number Field Type. For this example, the rating system is from 1 to 5 stars.
- Add an additional image element to the dynamic product grid of your touchpoint. Position and resize accordingly. For this example, the rating is shown as a collection of stars.
- Set the Image URL of the additional image element. In this case, it is {{star_image}}.
- Upload the images that represent your ratings to an accessible source.
- Add the Liquid from the following code snippet to the Setup block of the dynamic grid (in the Element Scripting section of the Details tab). Replace the generic example titles and links with references to your images.
{% 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 %}
- Save and Go Live with the campaign.
Article is closed for comments.