Personalize journey messages with dynamic links and variables

There are two kinds of dynamic content that you can add to your brand’s text messages: dynamic links and variables (macros).

  • Dynamic links let you personalize text messages with personalized links to pages on your website. 
  • Variables let you personalize text messages with details like subscriber name, product details like name and price, discount codes, and more. Variables also support default values, which use generic, inclusive terms when personalized details (like name) aren’t available, like “friend" instead of the subscriber's first name.

Note: Some variables and dynamic link types can only be used with certain journey types and may require that you already share product data with Attentive. For example:

  • Variables can’t be used with messages in welcome journeys. This helps ensure that welcome messages are always sent in a timely manner when a subscriber opts in to receive messages from you.
  • The {{triggerEvent.product.priceDropPct}} variable can be used in Price Drop journeys.
  • Dynamic links to recommended products can only be used if you’re sharing your product data with Attentive.

Note: When you send a preview text message, dynamic links and variables aren’t resolved in the sent test text message. For example, if you include the {{subscriber.firstName}} variable, you’ll also see {{subscriber.firstName}} in the test message. You can use preview options to preview how variables will appear to your subscribers.

Add a dynamic link or variable to a message

Follow these steps to add a dynamic link or variable to a message:

  1. In a campaign text message or send text message step in a journey, move your cursor to where you want to add a dynamic link or variable, then click  Personalization button .
  2. In the Insert variable popup, click Variable.
  3. Select a Category
    • Click Subscriber to view dynamic links and variables associated with subscribers. 
    • Click Product to view dynamic links and variables associated with product data. 
  4. Click the link or variable you want to use.
  5. (Optional) Add a Default value (also called a fallback). For example, if your {{subscriber.firstName}} variable has “friend” as the default value, a message will say “friend” if the subscriber’s first name is unavailable.
  6. Click Insert.

Notes:

  • Some dynamic elements are only available in certain journeys and require that you share product data with Attentive.
  • If you don’t add a default value and data isn’t available for a subscriber, a message won’t be sent to that subscriber.

Dynamic link and variable object names

You can add dynamic links and variables to a message by using the personalization button in the message editor. Dynamic links or variables added to a message use the object names listed below. If you add a dynamic link or variable by typing it out, be sure to use the current object name.

Dynamic links

{{subscriber.cartLink}}

Link to the subscriber's cart. Previously: {cartLink}

Note: The {{subscriber.cartLink}} dynamic link works best for brands on Shopify. If your brand isn’t on Shopify, you can still use this dynamic link, but your subscribers may not see their saved shopping cart when they click the link., For example, they may not see their saved cart if they open the link on a different device or in a different browser from when they originally added items to their cart. See Use Cart URL personalizations in journey messages for more information.

{{subscriber.signupOffer.link}}

Link that automatically applies the discount code at checkout. Previously: {couponLink}

{{subscriber.signupOffer.couponScreenLink}}

Link that directs the subscriber to the Attentive-hosted offer screen where they can copy the discount code and be taken back to their last browsed page. Previously: {couponScreenLink}

{{offer.link}}

Link that automatically applies the discount code at checkout. Previously: {couponLink}

{{triggerEvent.product.link}}

Link to a product page. Previously: {productLink}

{{triggerEvent.checkout.checkoutLink}}

Link to checkout page. Previously: {checkoutLink}

Note: To include UTM parameters in dynamic links for messages in custom event journeys, make sure the custom event payload sent to Attentive already contains these parameters.

Dynamic variables

{{offer.code}}

Offer code (e.g., ATTV-OLCHY8). Previously: {coupon}

{{offer.value}}

Offer value (e.g., $10 or 10%). 

Note: The offer must have a Discount amount (optional) set up if you want to add the {{offer.value}} variable to a message. For more information, see Create offers

{{subscriber.signupOffer.code}}

Sign-up offer code. Previously: {coupon}

{{subscriber.firstName}}

Subscriber's first name. Previously: {firstName}

{{subscriber.fullName}}

Subscriber's full (first and last) name. Previously: {fullName}

{{subscriber.lastName}}

Subscriber's last name. Previously: {lastName}

{{triggerEvent.product.image}}

Image of the product. Previously: {productImage}

{{triggerEvent.product.name}}

Product name. Previously: {productName}

{{triggerEvent.product.price}}

Product price. Previously: {productPrice}

{{triggerEvent.product.quantity}}

Product quantity. Previously: {{productQuantity}

Note: This variable is only available for post-purchase journeys.
{{triggerEvent.product.priceDropPct}}

Price drop as a percentage. Previously: {priceDropPct}

Character counts with dynamic content

Keep in mind that when you add dynamic content, the final character count for each message varies depending on the values populated for each subscriber. See  How message character counts are calculated with Campaign Composer for more information.

Choose a default value for variables

You can choose a default value for variables. A default value is a value that appears when the variable has no value. For example, you might want to set “friend” as a default value for the subscriber first name variable. This way, if a subscriber’s first name is unknown, Attentive will populate “friend” for the subscriber first name variable instead of leaving it blank in the message.

When you add a variable to your message, enter the default value in the Default value (optional) field; then click Insert.

Selecting the {{subscriber.firstName}} variable and entering 'friend' as the default value.

The variable with the default value appears as follows in the editor: 

{{variableName | default:”default value”}}
'Friend' appearing as the default value in the message preview.

Examples

Hey {{subscriber.firstName | default:”friend”}}, we have your perfect shade in stock!

The message above appears to subscribers as follows: 

Hey Jane, we have your perfect shade in stock!

If the subscriber's first name is unavailable, the message appears to subscribers as follows: 

Hey friend, we have your perfect shade in stock!

How do you like your new {{triggerEvent.product.name | default: “item” }}? 

The message above appears to subscribers as follows: 

How do you like your new Downpour Rain Jacket?

If the product name is unavailable, the message above appears to subscribers as follows:

How do you like your new item?

Add variables to links

You can add variables to links in your text messages to send your subscribers to unique URLs. For example, you can use variables for enhanced link tracking, send subscribers to personalized landing pages, and take better advantage of certain apps. See Add variables to links in campaign messages and Add variables to links in journey messages for more information.

Use app-specific variables and links in journeys

Some third-party apps in the App Marketplace come with their own journey triggers that let you use variables or dynamic links specific to those apps.

For example, if you’ve installed the Okendo app, you can create an Okendo review request journey. You can add links and variables specific to Okendo to messages in this journey, such as {{triggerEvent.custom["Product Review Url"]}}, which links to a URL where subscribers can review a product in Okendo.

Note: App-specific links and variables can only be added to messages when Attentive receives corresponding data from the apps you’ve installed. For example, one of the variables you can add to an Okendo journey message is {{triggerEvent.custom['Product Variant Name']}}, but you can’t add it to journey messages if Attentive doesn’t receive a product variant name from Okendo.

Some apps have additional custom subscriber attributes that can be added to messages as variables. For example, you can personalize messages by including subscribers’ favorite colors if that data is available from one of your installed apps.

To add a variable that uses a custom attribute from a third-party app, search for the variable in the Subscriber category in the Insert variable window. You can also scroll the Subscriber category until you find the section for the app that sends the attribute you’re looking for.

Selecting the 'Age' attribute from mParticle as a variable in the 'Insert variable' window.

Note: Custom attributes as variables are only available with the following apps:

  • Klaviyo
  • mParticle
  • Punchh
  • ReCharge
  • Segment
  • Shopify
  • Smile.io

Use variables in transactional journey messages

For transactional email and text message journeys, a number of app-specific links and variables are available. You can find them by adding a variable or link to a message, then selecting one specific to the journey in the Insert variable window.

You can see examples of transactional email messages that include journey-specific variables and links in the following articles:

Use variables in welcome journey messages

Because subscriber data isn’t yet available at initial sign-up, only the following variables are supported in welcome journey messages:

  • {{message.messageId}}
  • {{message.messageName}}
  • {{message.messageType}}

Use Preview Options to preview text messages

Text message previews in campaigns and journeys show you text messages as a recipient would see them. This allows you to validate the appearance and content of your messages, including dynamic content like variables and links. You can also preview how your unsubscribe message appears for AT&T subscribers.

m-preview-options.png

Note: For more information about how character counts and message segments are calculated, see How message character counts are calculated with Campaign Composer.

Follow these steps to preview text messages as a subscriber would see them:

  1. Go to the text message in a campaign or draft journey you want to preview.
  2. At the bottom of the preview, click Preview Options. The following options are available:
    • Unsubscribe preview: Preview your message with opt-out language for AT&T subscribers. This option only appears if you send messages from a toll-free number.
    • Preview as a subscriber: Preview your message as a subscriber would see it. The preview includes resolved variables, including subscriber names and shortlinks. 

      For example, if the subscriber's first name is Sam, the preview shows Sam in place of {{subscriber.firstName}}. Similarly, if the name of the message in Attentive is “Spring Sale 2024,” the preview shows “Spring Sale 2024” in place of {{message.messageName}}.

      For offer variables and links, the preview shows a placeholder. For example, the preview shows [ OFFER CODE ] in place of {{offer.code}}.

      This option is turned on by default. If you turn it off, you’ll see variable names (e.g., {{subscriber.firstName}}) instead of the actual value.
  3. Use the arrows below the subscriber’s name and number to preview the message as a different subscriber.
    m-preview-other-subscribers.png
    If subscriber data is unavailable and the variable doesn't have a default, an informational message appears.
  4. Click Send test message to send a test message using the selected subscriber’s information. You can send a test message to a specific phone number or choose to send a test message to all of the users in your company’s Attentive account.

Notes:

  • For campaigns, the subscribers you can preview as are selected randomly.
  • For journeys, you can only preview as subscribers who have completed an action that triggers the journey (e.g., they've actually added an item to their cart for cart abandonment journeys).
  • For journeys, at least five subscribers must have completed an action that triggers the journey in order to view actual subscriber information in previews.
  • Not all subscribers will have values for dynamic variables, so it’s helpful to use a default value where it makes sense.
  • When messages include offer links or variables, the following placeholders appear:
    • [ OFFER CODE ]: appears in place of {{offer.code}}, {{subscriber.signupOffer.code}}
    • [ OFFER LINK ]: appears in place of {{offer.link}}, {{subscriber.signupOffer.Link}}
    • [ COUPON SCREEN LINK ]: appears in place of {{offer.couponScreenLink}}, {{subscriber.signupOffer.couponScreenLink}}
  • The message composer (where you create your text message) on the left side of the screen doesn't show variables or links as a subscriber would see them, nor does it show opt-out text if you use Unsubscribe preview. However, the character counter for the message composer does count opt-out language if you've turned on Unsubscribe preview.

Preview dynamic content in your email

You can preview how your campaign and journey emails will look to your subscribers. Email previews show actual subscriber data in place of variables, such as a subscriber's first name or a product name. You can also send test emails to yourself or others on your team.  See Preview and send test emails for more information.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful