Custom Context Variables Overview

You can create custom context variables for Monetate's personalization engine to use for Automated Personalization experiences. See Engine Context for more information about how these distinct data points are used as well as how to change the context at the account level and at the experience level.

If you're an Engine API client, then you only need to use the monetate:context:CustomVariables event to pass custom context variables and their values to Monetate. For more information about this event, refer to the entry for monetate:context:CustomVariables in the Engine API reference in the Monetate Developer Hub.

If you're a Monetate JavaScript API client, then you must first set up the custom context variable using the Define a Custom Variable modal accessible from the Custom Variables list page in the Monetate platform. See Define a Custom Context Variable for the steps.

You must have the Engine Context — Custom Variables feature enabled for your account to access the Custom Variables list page. Contact your dedicated Customer Success Manager (CSM) to request that the feature be enabled.

After you've defined the variable, you can then pass it and its value using the setCustomVariables method.

Regardless of your Monetate implementation type, you do not need to define a custom variable in the Monetate platform before using it for WHO targets or for dynamic text in Content Builder and a variety of actions.

Custom Variables List Page

To access the Custom Variables list page, click COMPONENTS in the top navigation bar, and then select Custom Variables.

Callout of the Custom Variables option in the COMPONENTS menu

Like many list pages in the Monetate platform, the Custom Variables list page is a table that contains basic information for each custom variable defined in the account.

The Custom Variables list page

The search bar above the table on the left-hand side allows you to search for a word or phrase in the custom variable name and description fields. You can sort the table's contents by variable name in alphabetical or reverse alphabetical order at any time by clicking the NAME header. Sort the contents by creation date in chronological order or reverse chronological order by clicking the CREATION TIME header. Click TYPE to sort the contents by each variable's data type in alphabetical or reverse alphabetical order.

Callout of the NAME header, TYPE header, and CREATION TIME header of the table on the Custom Variables list page

The EXPERIENCE USAGE column shows the number of active and inactive experiences an action is part of or if the action is not used at all.

The count of active and inactive experiences doesn't differentiate between experiences to which a custom context variable was added at the experience level and those experiences that included it because the variable had been added to the Engine Context at the account level.

Callout of the EXPERIENCE USAGE column of the table on the Custom Variables list page

Click DEFINE CUSTOM VARIABLE to create a new custom context variable. See Define a Custom Context Variable for the steps.

Using Custom Variables in WHO Targets

You can use custom variables and their values in Web experiences to target site visitors. To accomplish this goal, when configuring the WHO part of an experience, select Landing on the Target Type panel, and then select either Custom variable visitors or Custom variable visitors with multiple values targets.

For example, you want a Web experience that targets customers with Penguin status. When configuring the WHO part of the experience, you select Custom variable visitors and then input the custom variable name and the value that you want to target, as shown in this screenshot.

Callout of the 'Variable name' and 'Variable value' fields in the

You can include or exclude from an experience site visitors associated with the custom variable value(s) you input for the custom variable you identify in the target.

Using Custom Variables with Dynamic Text in Content Builder

You can use custom variable values in dynamic text that you add to creatives that you build in Content Builder.

For example, you can add to the experience that targets all visitors with Penguin status (as collected by setCustomVariables) a banner that you create in Content Builder that states, "You are X stars away from being promoted to Pelican!" The banner is customized so that each Penguin-status visitor sees how many stars they must earn to be promoted.

To achieve the customized text, in Content Builder create a text layer, double-click it to edit it, and then click Add dynamic content on the text toolbar. Select Custom Variable from the selector on the Add dynamic content modal.

The 'Add dynamic content' selector of Content Builder, which includes the 'Custom Variable' option

Input the custom variable into the text field so that its value is inserted into the dynamic text for each visitor that views the creative.

The custom variable value placeholder 'customvar: points' placed within the body of a creative's text

The setCustomVariables method only includes in-session data. Therefore, you cannot use it across sessions for targeting. Use Target Builder if you must create a custom target.