Using your data to provide Dynamic Content
- How to Use Fields for Dynamic Content
- How to Create a Dynamic Subject Line
- How to Provide Targeted Information using Dynamic Content
- Leveraging Data Extensions in your email content
- Dynamic Content Syntax
How to Use Fields for Dynamic Content
Dynamic variables are a great way to personalize your message with information you've collected in your DataMart about the user (Name, Address, Recent Purchases, etc.).
This will help you engage your customers on a much more personal level.
1. The ## Tag
- To pull information from the DataMart into your message, it is as easy as placing the "Field Name" in where you would like the information to appear in your template.
- Adding ## in front of and after the Field name to label it as a Dynamic Variable (see example).
- This will work in the subject line as well.
2. Field Names
To view the available fields in your DataMart and the Field Name that needs to be referenced in your message, follow these steps:
- Click on the Target Tab
- Click on the Datamart Fields Button
- The fields names are located under the Name header.
How to Create a Dynamic Subject Line
This feature offers the possibility to create Dynamic Subject Line based on the data that was collected from your customers or users, You can either use a dynamic variable or add a logic.
1. Click ## "Insert a Dynamic Variable" button
Go to Compose > Envelope
- In the envelope tab:
- Click on the ## button
2. Select your Fields
In the popup window, different options are available
- Select a field : You can choose which DataMart field you would like to pull and display dynamically.
- Select a format : This allows you to reformat the data (eg. Switching All caps into lower case)
- Default value : If the data field was not provided or collected, we can choose to display a default value eg. "Customer"
- Click Insert
3. Click on Add Logic
4. Add Logic Explained
In the popup window, different options are available
- The IF statement is the first condition based on the DataMart fields.
- The ELSE/IF statement is the following condition based on the DataMart fields.
- The ELSE statement will display the value added in the text box if the above conditions are false
- Click Insert
5. Logic Example
- In this logic , we would like to display the recipient firstname in the subject line as well as giving 10% OFF to anyone from Toronto If they are not form Toronto, they would get 20% OFF.
- You are able to add an endless number of layers to your logic in order to create a highly personalized email.
How to Provide Targeted Information using Dynamic Content
When building a message or template, you might come across a situation where you want to display an offer or image to the recipient based on their preferences or the demographic information you have collected on them.
Dynamic Content allows you to create IF/ELSE statements to help dictate which recipients will receive which pieces of content in the message.
1. Place the cursor where you'd like the dynamic content to appear OR select the content you'd like to replace with Dynamic Content statement.
2. Click the "Dynamic Content" button in the Editor Bar
3. Name the Dynamic Content section
- This will be used to show where it is in the template and for reporting later on.
4. Define the "IF" statement or copy logic from an existing Dynamic Content piece
- Select a field first, then an operator and then finally a value.
- You can also add in an AND statement or Create an OR group to help further target.
- For more information on targeting, visit the Segmentation article.
- Alert: If you copy from an existing Dynamic Content piece, it will overwrite any work you have done already in the Dynamic Content piece, so make sure to do this first.
5. Select the Content Type
The different content types are:
- Text - Text only, no formatting or styling can be defined. It will use the default styling of the section it is placed in.
- Image - Image only, no formatting or styling can be defined. It will use the default styling of the section it is placed in.
- Block - This allows you to place an entire block of HTML code where the variable is placed.
- This allows for endless possibilities and you are able to use a Visual editor to make changes.
6. OPTIONAL: Define additional "ELSE IF" statements
- This will provide a new section with the same options as the IF statement.
- You will need to identify how to target contacts and provide content as well.
- You can add as many ELSE IF's as you like.
7. If required, define content for the "ELSE" statement
- The ELSE statement is the default option if the recipient of the message does not meet any of the IF or ELSE IF statements identified in the Dynamic Content.
- There is a 4th content type you can use for this statement.
- If you do not want anything shown when they do not meeting the IF/ELSE IF criteria, then keep the default option "Blank".
- Otherwise, you can select a content type and follow the same procedure.
8. Finally, click "Insert" to place the variable in the message or template
9. The Dynamic Content variable will appear in the template highlighted green
- By clicking on the variable, you can make edits to the Dynamic Content and update the variable with those edits.
Leveraging Data Extensions in your email content
Personalize your emails even further by inserting the information in your Data extension. This can be used for displaying preferred location information or the customer's assigned customer rep. This can create a more one-to-one experience - the type that converts.
Tutorial
Please note: To try out the feature, click the full screen icon in the tutorial.
Dynamic Content Syntax
PREREQUISITE : Dynamic Content
Allows the user to create dynamic content statements without needing to know the syntax.
A new syntax has been created in the system which allows developers to keep all content and logic within one document.
Syntax
- ##FirstName##
- ##FirstName Format="Firstlettercapital"##
- ##FirstName Default="Customer"##
- ##FirstName Format="Firstlettercapital" Default="Customer"##
Data Types for Format
- Email : No formatting options
- Text : ALLCAPS, lowercase, Firstlettercapital, EachWordFirstLetterCapital
- Number : WholeNumber, OneDecimal, TwoDecimal
- Date : MM/dd/yyyy, MM-dd-yyyy, MMMM dd, yyyy, MMM dd, yyyy
Dynamic Content Syntax.
###variablename###
if (field[FieldName] operator "value" ) { "Content" }
else if (field[FieldName] operator "value" ) { "Content" }
else { "Content" }
###/variablename###
Logic Breakdown (Part 1)
if (field[FieldName] operator "value" )
- FieldName has to match the one in CONNECT, Operators are different depending on the Field type (i.e. Email, Text, Date, Number)
- You can have as many else if’s as needed
Logic Breakdown (Part 2)
Email/Text Operators:
equals, is_not, begins_with, contains, not_contain, is_empty, not_empty
Number/Date Operators:
==, !=, greater, greater_or_equal, less, less_or_equal, is_empty, not_empty
AND/OR Statements:
if ((field[ ] ) && (field[ ] ))
if ((field[ ] ) || (field[ ] ))
if (((field[ ] ) && (field[ ] )) || (field[ ] ))
For Each Statements:
Use the for.each statement by itself:
for.each({"test data"})
for.each({block "<table><tr><td>Some text</td></tr></table>"})
for.each({image: "<img src="http://imagefile.jpg">"})
Or combined with an IF statement:
if(condition) {block "for.each({"test data"})"}
if(condition) {block "for.each({block "<table><tr><td>Some text</td></tr></table>"})"}
if(condition) {block "for.each({image: "<img src="http://imagefile.jpg">"})"}
Content Types
Text: Should only contain text, no HTML.
Example:
{ "Here is some text" }
Image: Should only contain an image tag.
Example:
{ image"<img src="http://imagefile.jpg">" }
Block: Can contain anything including code.
Example :
{ block"<table><tr><td>Some text</td></tr></table>" }
Web and Text Versions
Web versions
- Continue to use the ##webversionurl## tag and Connect will handle the rest.
- If the client would like different content on their web version vs email message, you can use the following:
if (content[type] == "email" ) or if (content[type] == "webversion")
Text Versions
- Use the "Auto Generate Text Version" option in CONNECT or leave it to the AM.
- No separate text version logic required.
System Variables
These variables provide data from the system for various use cases. They all begin with "system" and are proceeded by the variable name.
Eg. ##system:deploymentid##
Variable | Description |
deploymentid | Provides the ID of the deployment at the time of send and is great for adding context to other tracking code. |