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

When you enable and  use Dynamic Message Content , you can insert placeholders into a message that will be replaced in real-time with the corresponding values for the receiving visitor. You configure this on the  Promoted Content  tab in  Message Settings . 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. 

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 section details the variables used for advanced dynamic messages.

Sections in this Article

NOTE! - based on the example here, the following syntax can be used in custom JS:

/* #set ($currentUsersEmail = $tools.user.emailAddress) */

var usersEmailAddress = "$currentUsersEmail";

// or more directly
var userEmailAddress = "${user.emailAddress}";


${}                           => ID <String>
${user.userName}                     => Name <String>
${user.userNameOrAnonLocation}       => Name OR 'user from City, State' <String>
${user.accountType}                  => Account Type <String>
${user.emailAddress}                 => Email Address <String>

--User Location--

${user.location.postalCode}          => Zip Code <String>
${}                => City <String>
${user.location.metro}               => Metro Area <String>
${user.location.metroCode}           => Metro Code <Integer>
${user.location.region}              => State/Region <String>
${user.location.stateProvinceCode}   => State/Region Code <String> (shorthand)
${}             => Country <String>
${user.location.countryCode}         => Country Code <String> (shorthand)
${user.location.organization}        => Organization <String>
${user.location.industry}            => Industry <String>
${user.location.naicsCode}           => North American Industry Classification System Code <Integer>

--User Custom--

${user.attributes._________}         => Custom Attribute (Use dropdown in editor for specific ID)


Things that count as items:

  • Products
  • Articles
  • Blogs
  • Tags
  • Categories


Must have intended item query selected in message settings

${item}                              => Item Object <Object>
${items}                             => Array of Item Objects <Array>
${items[0]}...${items[9]}            => Item In Array <Object>
${page.item}                         => Current Page Item Object <Object>
${page.category}                     => Current Page Category <Object>
                                        OR Category of Current Page Item <Object>

${}                         => Name <String>
${}                           => ID <String> OR <Integer>
${item.url}                          => URL <String>
${item.imageUrl}                     => Image URL <String>
${item.description}                  => Description <String>
#field(${item.rating}, '0')			 => Average Rating <Integer>
#field(${item.numRatings}, '0')		 => Number of Ratings <Integer>
${item.categories}                   => Categories Objects <Array>
${item.tags}                         => All tag Objects <Array>

--Item Custom--

${item.attributes.xxxxx.value}         => Value of the attribute named "xxxxx" on the item

--Products only--

${item.price}                        => Price <Integer> // NOTE: Unformatted, see utilities below.
${item.priceDescription}             => Price Description <String>
${item.listPrice}                    => List Price <Float> // NOTE: Unformatted, see utilities below.
${item.inventoryCount}               => Inventory Count <Integer>
${item.brands}                       => Brand tag objects <Array>
${item.classes}                      => Class tag objects <Array>
${item.styles}                       => Style tag objects <Array>
${item.genders}                      => Gender tag objects <Array>

--Blog & Article Only--

${item.subTitle}                     => Subtitle <String>

--Promotion Only--

$tools.bandit.imageToServe(${item}) => Fetches the imageUrl for the proper content zone and dimension as dictated by the message's dynamic content

Advanced-- Build item query in message

--Query Type: global/user interchangeable--

${}                   => Query Global Statistics
${tools.user...}                     => Query User Statistics

${}          => Query Products
${}          => Query Articles
${}             => Query Blogs
${}        => Query Categories
${}            => Query Brands
${}            => Query Styles
${}           => Query Authors
${}          => Query Keywords

--Query: default array length min 1 max 5--

${}      => Top Viewed By Count <Array>
${}       => Top Viewed By Time <Array>
${}      => Top Added To Cart By Count <Array>
${}      => Top Added To Cart By Currency Value <Array>
${}  => Top Purchased By Count <Array>

// NOTE: Make sure to either iterate over these or return one by index. Otherwise, the Campaign will fail in a way where an error message won't be shown in the Evergage Tools extension.

// -- Good
#set($bestProduct = ${[0]})
#foreach ($product in ${})

// -- Bad
#set ($bestProduct = ${})

--Global only--

${}  => Most Recent Published <Array>

--User only--

${tools.user.products.viewed()}           => Most Recently Viewed <Array>
${tools.user.orders.currentItems()}       => Products In Cart <Array> // NOTE: Interaction Studio does not currently track cart removals.
${tools.user.orders.currentValue()}       => Total Value In Cart <Float> // NOTE: Unformatted, see utilities.
${tools.user.get('Engagement', 'none')}	  => User's Engagement Score

Item Options

ex. ${tools.user.products.viewCount(${itemOptions...})
ex. ${itemOptions.optionOne().optionTwo().optionThree()}


${itemOptions.minItems(<Integer>)}    Minimum Returned Or Message Hidden
${itemOptions.maxItems(<Integer>)}    Maximum Returned (MAX: 10)



--Look Back Period--


++Time Object++


--Conditional Options--






++Sort Options++






--Mark As Promoted--

${itemOptions.promote()}               Default: OFF


--If/Else Statements--

<!-- #if ($user.attributes.firstName) -->
	<div>Hello $user.attributes.firstName</div>
<!-- #else -->
	<div>You don't have a first name at all</div>
<!-- #end -->

--Set Variables--

#set (${variableName} = $...)


#foreach (${variableName} in <Array>)

--Format Price--

$tools.formatNumber(<Float>, <Int Number of Fractional Digits>)