Variable syntax for content and links

Who can use this feature?

When customizing experience steps, you can personalize content, links, and redirect URLs with dynamic user data. For example, you may design the experience with variables for the user's name, title, company name, or other custom properties you've stored about the person.

Variables also include the ability to provide backup values in case the data for the selected variable doesn't exist for a particular user.

Where variable syntax is supported

Variable syntax is supported almost anywhere you can customize or enter text for an experience, including:

  1. Experience step rich text
  2. Experience step button text
  3. Experience step button action redirect URLs
  4. Checklist rich text components
  5. Checklist trigger button text
  6. Checklist item experience redirect URLs
  7. Links defined within rich text

Supply data for user variables

You can use a variable to select any user data property that your application supplies through the identify SDK method. These custom user properties are the same properties that are available when defining user segments. To view a full list of the properties that your application supplies, navigate to the 2-Deliver section of the builder. Open the segment selector and review the Properties available to filter. 

When selecting a user data property with a variable, ensure that you preface the variable with user.. For example, to select the companyName user data property, define the variable like {{ user.companyName }}.

Use variables

Use a variable in any experience step, checklist, button, link, or redirect URL with the following syntax

{{ user.firstName }} 
{{ user.companyName }} 
{{ user.permissionLevel }} 

For any variable, you can add a default filter to provide a placeholder if there is no variable available to pull in:

{{ user.firstName|default:'Friend' }} 

You can also chain together many variables as backup values to each other. If the previous variable is not available to pull in then it will resort to the next one:

{{ user.firstName|user.lastName|user.username|default:'Unknown User' }} 

While we recommend keeping syntax consistent, it's okay to include or omit additional spaces. All of the following examples are okay to use:

{{user.firstName}} 
{{ user.firstName | default: 'Friend' }} 
{{user.firstName| default:'Friend' }} 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request