Page tree
Skip to end of metadata
Go to start of metadata

With Dynamic Message Content enabled, placeholders that you insert into a message will be replaced in real-time with the corresponding values for the receiving visitor.

Interaction Studio Classic Only

Please note, the contents of this article are intended for customers using Interaction Studio (formerly Evergage Classic). Do not adjust your beacon version to downgrade or upgrade.

This Article Explains

This article details how to enable dynamic message content.

Sections in this Article

Enable Dynamic Campaign Content

  1. Log into Interaction Studio as an administrator
  2. Select Settings > General Setup
  3. Select Advanced Options
  4. Select Enable Dynamic Campaign Content
  5. With this feature enabled, the  button will be available when editing a message

Insert Dynamic User Content

Once you enable dynamic campaign content, you can insert it directly into a message. 

  1. Create or edit a campaign
  2. Add or edit a message
  3. Double click the Message text area to add dynamic content (the handles around the message text area should not be visible and the container should be orange on hover)
  4. Click 
  5. Available user attributes will drop down 
  6. Selecting any of them will insert content into your message in the following format:


Add a Fallback Value

If a user doesn't have a value for this field and it returns null or an empty string, the message text won't be shown. But you can add a fallback value as add a second parameter in the event that there isn't a user value.

Modify the dynamic attribute, adding a second parameter in the following syntax

#field(${user.userName}, "DEFAULT_TEXT") 

You can change the second parameter ("DEFAULT_TEXT") to whatever you want the default text to be. For example, you can insert the word "Visitor" so the campaign will show a message with the qualified visitor's userName. If there is no value for the userName attribute, the message will display "Visitor" instead. 

#field(${user.userName}, "Visitor")

You can also create a dynamic message with custom field content, using the following syntax:


Alternate syntax must be used if MY_CUSTOM_FIELD contains a space:


Replace MY_CUSTOM_FIELD with the field name you have defined and are trying to call. It is important to add "attributes" between "user" and right before your custom field name for the message to display properly.

Dynamic Catalog Content

If you use the Interaction Studio Catalog with your site, you can use Interaction Studio campaigns to promote items. On a B2C site, items can be products, categories, brands, or styles. On a content site, items can be articles, blogs, authors, or keywords. In most cases, the items that a particular message promotes can be configured in Message Settings on the Promoted Content tab.

However, in some cases, the Promoted Content tab will not provide the configurability needed for very specific or advanced requirements and you need to use advanced dynamic message content (ADMC) syntax instead, which is added in the message HTML, accessible selecting the Message Source Code tab. For more information, please see Use Advanced Dynamic Message Content .

Basic Promoted Content

For most basic requirements, the Promoted Content tab in Message Settings can be used to configure promote messages. In the example at the right, the most popular product for the last seven days in the category the user has spent the most time viewing will be promoted in the message.

  1. Click  to access Message Settings
  2. Select Promoted Content
  3. Select Dynamic
  4. Select options as needed
  5. Click OK

Using the rules you configure on the Promoted Content tab, Interaction Studio will display a list of up to ten of the top products in the visitor's favorite category sorted by the number of times they have been viewed globally. This list can be accessed within the HTML content of the message using the ${items} variable. Using the #foreach loop, Interaction Studio will generate a list item until the maximum list of items has been reached. Be aware that if the defined minimum number of items are not returned, the message will not display. If no minimum or maximum is defined, Interaction Studio will return up to ten items that meet the rules you have configured either in the Promoted Content tab or ADMC code in the message HTML.

For example:

These are the most popular products in your favorite category:
<!-- #foreach ( $product in $items )-->
   <li><a href=”${product.url}”>${}</a></li>
<!-- #end -->    

If you only want to promote a specific number of items in your message, you can use an array syntax instead. For example, use the following syntax to promote only the top three products (notice that the first item is referenced with an index value of 0, not 1):

These are the most popular products in your favorite category:
   <li><a href=”${items[0].url}”>${items[0].name}</a></li>
   <li><a href=”${items[1].url}”>${items[1].name}</a></li>
   <li><a href=”${items[2].url}”>${items[2].name}</a></li>

When the message displays, all Items that are referenced in the message will be marked as promoted for campaign attribution purposes.


Formatting Numbers

Typically, prices are the only numbers you need formatted. There are two options you can use to format them using the message HTML.

Option 1

The simpler option formats the price with the default dataset currency symbol using the default dataset locale:


If the default dataset currency is US dollars and the default dataset locale is US, the formatted currency would look like:


And for Euros with a French locale:

1 234,50 €

Option 2

The other option is to format the number only using a fixed number of digits after the decimal point. Then, the currency symbol or word can be added as part of the message. For example:

$tools.formatNumber(${item.price}, 0) ¥

Which would display as:

1,234 ¥