Personalization syntax personalization-syntax
Personalization in Journey Optimizer is based on the templating syntax called Handlebars.
For a complete description of the Handlebars syntax, refer to HandlebarsJS documentation.
It uses a template and an input object to generate HTML or other text formats. Handlebars templates look like regular text with embedded Handlebars expressions.
Simple expression sample:
{{profile.person.name}}
where:
profile
is a namespace.person.name
is a token composed by attributes. The attributes structure is defined in an Adobe Experience Platform XDM Schema. Learn more.
Syntax general rules general-rules
Identifiers may be any unicode character except for the following:
Whitespace ! " # % & ' ( ) * + , . / ; < = > @ [ \ ] ^ ` { | } ~
The syntax is case sensitive.
The words true, false, null and undefined are only allowed in the first part of a path expression.
In Handlebars, the values returned by the {{expression}} are HTML-escaped. If the expression contains &
, then the returned HTML-escaped output is generated as &
. If you don’t want Handlebars to escape a value, use the “triple-stash”.
Regarding literal functions arguments, the templating language parser does not support single unescaped backslash (\
) symbol. This character must be escaped with an additionnal backslash (\
) symbol. Example :
{%= regexGroup("abc@xyz.com","@(\\w+)", 1)%}
Profile
This namespace allows you to reference all the attributes defined in the profile schema described in Adobe Experience Platform Data Model (XDM) documentation.
The attributes need to be defined in the schema before being referenced in a Journey Optimizer personalization block.
Sample references:
{{profile.person.name.fullName}}
{{profile.person.name.firstName}}
{{profile.person.gender}}
{{profile.personalEmail.address}}
{{profile.mobilePhone.number}}
{{profile.homeAddress.city}}
{{profile.faxPhone.number}}
Audiences perso-segments
Learn how to leverage profile attributes in conditions in this section.
Offers offers-syntax
This namespace allows you to reference existing offers decisions.
To reference an offer you need to declare a path with the different information that define an offer.
This path has the following structure:
offers.Type.[Placement Id].[Activity Id].Attribute
where:
offers
identifies the path expression belonging to offer namespaceType
determines the type of offer representation. Possible values are:image
,html
andtext
Placement Id
andActivity Id
are placement and activity identifiersAttributes
are offer specific attributes which depend on the offer type. Example:deliveryUrl
for images
For more information on Decisions API and on Offers Representation, refer to this page
All the references are validated against Offers Schema with a validation mechanism described in this page
Sample references:
-
Location where the image is hosted:
offers.image.[offers:xcore:offer-placement:126f767d74b0da80].[xcore:offer-activity:125e2c6889798fd9].deliveryUrl
-
Target URL when you click on the image:
offers.image.[offers:xcore:offer-placement:126f767d74b0da80].[xcore:offer-activity:125e2c6889798fd9].linkUrl
-
Text content of the offer coming from the decisioning engine:
offers.text.[offers:xcore:offer-placement:126f767d74b0da80].[xcore:offer-activity:125e2c6889798fd9].content
-
HTML content of the offer coming from the decisioning engine:
offers.html.[offers:xcore:offer-placement:126f767d74b0da80].[xcore:offer-activity:125e2c6889798fd9].content
Helpers helpers-all
A Handlebars helper is a simple identifier that may be followed by parameters.
Each parameter is a Handlebars expression. These helpers can be accessed from any context in a template.
These block helpers are identified by a # preceding the helper name and require a matching closing /, of the same name.
Blocks are expressions that have a block opening ({{# }}) and closing ({{/}}).
Literal types literal-types
Adobe Journey Optimizer supports the following literal types:
Examples:
"prospect"
, "jobs"
, "articles"
Examples:
-201
, 0
, 412
Note: You cannot directly access properties of items within an array.
Examples:
[1, 4, 7]
, ["US", "FR"]
URL Personalization perso-urls
Personalized URLs take recipients to specific pages of a website, or to a personalized microsite, depending on the profile attributes. In Adobe Journey Optimizer, you can add personalization to URLs in your message content. URL personalization can be applied to text and images, and use profile data or contextual data.
Journey Optimizer allows you to personalize one or several URLs in your message by adding personalization fields to them. To personalize a URL, follow the steps below:
-
Create a link in your message content. Learn more
-
From the personalization icon, select the attributes. The personalization icon is only available for these types of links: External link, Unsubscription link and Opt-Out.
Sample personalized URLs
https://www.adobe.com/users/{{profile.person.name.lastName}}
https://www.adobe.com/users?uid={{profile.person.name.firstName}}
https://www.adobe.com/usera?uid={{context.journey.technicalProperties.journeyUID}}
https://www.adobe.com/users?uid={{profile.person.crmid}}&token={{context.token}}