What are variables and how to use them

In Connectif, variables represent data that can change their value depending on the contact browsing and their web context. This allows you to create personalized content and experiences based on the user and their behavior, increasing loyalty and conversion.

 

1. Properties

  • A variable in Connectif is the representation of data that changes depending on the contact and their behavior.
  • Any data collected in a workflow can be assigned to a variable, whether it's related to, for example, product or contact information.
  • Each variable is distinguished by a name and a unique identifier.
 

The variable identifier cannot include spaces and can only contain letters, numbers, hyphen (-), and underscore (_) symbols.

  • Variables can have a format type depending on the data they represent. These formats are Number, Date, Currency, and Percentage. By default, variables are defined as Unformatted. This undefined type is used to represent text or data that won't be displayed in a special way.
 

If you want to learn more about variable formats in email, web content, push notifications or SMS, click here.

  • Variables can be included in any type of content from their respective editors and linked to any data collected in previous nodes of a workflow.
  • Data is assigned to variables in the configuration of action nodes responsible for sending content to the contact: "Send web content", "Send email", "Show push" and "Send SMS".
  • When creating a variable, it is possible to define a default value, which will be automatically assigned when there are no values to link from the data source. If it's not linked to any data and doesn't have this default value, a blank space will be displayed instead.

 

2. How it is used in Connectif

2.1. Use of predefined variables

There are some variables that Connectif provides for use in content without needing to explicitly associate data in the nodes that send or display the content:

These variables do not allow the definition of a default value.

  • {{__cn_available_width}} : this variable is available in all Connectif content except for Web Push Notifications. It is automatically replaced with the pixel value of the width of the cell where the variable is located.
 

For example, if we create a popup with a width of 600px and add dynamic content with this variable configured to show rows of 4 equal cells, each cell of the dynamic content will be 150px wide.

  • {{__cn_email_subject}} : this variable is only available in the email content type. It can be used anywhere in the email, and is automatically replaced with the email's Subject.
  • {{__cn_email_from}} : this variable is only available in the email content type. It can be used anywhere in the email, and is automatically replaced with the From used to send the email.

 

2.2. Creating variables

Web content

1. Go to "Content > Web Content" and click on  Create new web content. If you want to create variables in an existing web content design, click  More to expand the menu and select Edit.

2. Add or select the component in your design where you want to create a new variable.

3. Click on  (Edit element).

4. In the editor, click the Variables button.

Variable update - 1-min.png

5. Enter a name to identify the variable in Variable identifier.

6. (Optional) Set the Default value if necessary.

7. (Optional) Assign a Data type if necessary.

Variable update - 2-min.png

8. Click  Accept to save the changes in the node and  Save to save the changes in the workflow.

 

Emails

1. Go to "Content > Email" and click on  Create new email. If you want to create variables in an existing email design, click  More to expand the menu and select Edit.

2. Add or select the component in your design where you want to create a new variable.

3. Click on  (Edit element).

4. In the editor, click the Variables button.

Variable update - 3-min.png

5. Enter a name to identify the variable in Variable identifier.

6. (Optional) Set the Default value if necessary.

Variable update - 4-min.png

8. Click  Accept to save the changes in the node and  Save to save the changes in the workflow.

 

Web push notifications

1. Go to "Content > Push Notifications" and click on  Create new push notification. If you want to create variables in an existing design, click  More to expand the menu and select Edit.

2. In the Content or Compact version tabs, click the {} (Define a dynamic variable) button.

3. Enter a name to identify the variable in Variable identifier.

4. (Optional) Set the Default value if necessary.

Variable update - 5-min.png

5. Click  Accept.

6. Click  Accept to save the changes in the node and  Save to save the changes in the workflow.

 

SMS

1. Go to "Content > SMS" and click on  Create new SMS. If you want to create variables in an existing design, click  More to expand the menu and select Edit.

2. In the Content tab, click the {} (Define a dynamic variable) button.

3. Enter a name to identify the variable in Variable identifier.

4. (Optional) Set the Default value if necessary.

Variable update - 6-min.png

5. Click  Accept.

6. Click  Accept to save the changes in the node and  Save to save the changes in the workflow.

 

2.3. Modifying the data type of a variable

  

It is only possible to modify the data types of a variable in web and email content.

1. In the editor, click on   General properties.

2. Select the Variables tab.

3. Click on   (Edit).

4. Modify the data type.

Variable update - 7-min.png

5. Click  Accept to save the changes to the variable and  Save to save the changes in the design.

 

2.4. Assigning variables

"Send web content" node

1. Go to "Workflows" and click on  Create new workflow. If you want to assign variables in an existing strategy, click  More to expand the menu and select Edit.

  

To follow the steps in this section, you will need a web content with variables, and a workflow that contains at least one "Send web content" node.
Remember that you can use a template available in Connectif, for example, Home recommender.

2. In the "Send web content" node, click on  (Edit node settings).

3. Select the web content with variables.

4. Click Next  .

5. In the second step, set the sending configuration according to the type of web content.

  

To learn more about the "Send web content" node, click here.

6. In the third configuration step, establish the relationship between the data obtained in the previous nodes and the variables created in the web content design.

Variable update - 8-min.png

7. Click Finish  .

8. In the workflow, click  Save to save the changes and  Start to activate it.

 

"Send email" node

1. Go to "Workflows" and click on  Create new workflow. If you want to assign variables in an existing strategy, click  More to expand the menu and select Edit.

  

To follow the steps in this section, you will need an email design with variables and a workflow that contains at least one "Send email" node.
Remember that you can use one of the existing templates in Connectif, for example, Mass email campaign.

2. In the "Send email" node, click on  (Edit node settings).

3. Select the email design with variables.

4. Click Next  .

5. In the second step, set the configuration and sending parameters.

6. In the third configuration step, establish the relationship between the data obtained in the previous nodes and the variables created in the web content design.

Variable update - 9-min.png

7. Click Finish  .

8. In the workflow, click  Save to save the changes and  Start to activate it.

 

"Show push" node

1. Go to "Workflows" and click on  Create new workflow. If you want to assign variables in an existing strategy, click  More to expand the menu and select Edit.

  

To follow the steps in this section, you will need a web push notification design with variables, and a workflow that contains at least one "Show push" node.
Remember that you can use one of the existing templates in Connectif, for example, Request web push notification subscription.

2. In the "Show push" node, click on  (Edit node settings).

3. Select the web push notification design with variables.

4. Click Next  .

5. In the second configuration step, establish the relationship between the data obtained in previous nodes and the variables created in the web content design.

Variable update - 10-min.png

6. Click Finish  .

7. In the workflow, click  Save to save the changes and  Start to activate it.

 

"Send SMS" node

1. Go to "Workflows" and click on  Create new workflow. If you want to assign variables in an existing strategy, click  More to expand the menu and select Edit.

  

To follow the steps in this section, you will need an SMS design with variables, and a workflow that contains at least one "Send SMS" node.
Remember that you can use one of the existing templates in Connectif, for example, Send an SMS after purchase.

2. In the "Send SMS" node, click on  (Edit node settings).

3. Select the SMS design with variables.

4. Click Next  .

5. In the second step, configure the settings and sending parameters.

6. In the third configuration step, establish the relationship between the data obtained in previous nodes and the variables created in the SMS design.

Variable update - 11-min.png

7. Click Finish  .

8. In the workflow, click  Save to save the changes and  Start to activate it.

 

2.5. Identifying variables

  

The left column displays a list of data obtained from previous nodes in the workflow.
The right column lists the variables created in the dynamic content.
The central column, blank, is used to map the data to the variables.

1. Assign the data obtained in the workflow to the corresponding variable.

  

Drag the relevant data from the list (left column) to the central column to establish the relationship with the variable (right column).

Variable update - 12-min (2).png

 

In our example, the first variables assigned have a Contact data source from the "Start" node.

Variable update - 13 (1)-min.png

 

In our example, the second set of data assigned comes from the "Get products" node, which contains product information, and these are matched with the variables in the dynamic content.

  

Some of the most common variable associations include:
"Name": Contact's name.
"Title": Product name.
"Description": Item description.
"ButtonUrl": Product detail URL, linking to the product page on the eCommerce site.
"ImageUrl": Product image.
"Price": Current product price.

 

If you want to learn more about the different data included in the product information, click here.

2. (Optional). Assign literal values to the variables that require them.

  

A literal value is a defined, static piece of data that will be the same for all contacts, unlike dynamic data which changes based on the contact and their behavior.

Variable update - 14-min (1).png

 

In our example, the button links (buttonURL) always lead to the cart page, which is why a literal value is used.

The result would have been the same if this behavior had been implemented from the button configuration in the content editor.

3. Click  Finish.

4. In the workflow, click  Save to save the changes and  Start to activate it.

 

  

 Congratulations!
You've reached the end of the lesson.

  

 Still have questions?
Remember that our Connectif specialists are available to help you. To contact them, simply open a support ticket by clicking the blue “Help” button on your dashboard.

 


Keep learning!

To make the most of your Connectif account, we recommend continuing with the following articles: