setCustomVariables method provides a way to indicate that a custom variable is present on your site.
value, both of which can be a string or a number. For example, you can track membership levels for individual customers. You can report a custom variable called
membership and return the membership level for a site visitor.
Perhaps your site has a rewards program that allows members to earn badges. You know that a customer currently logged into the site has earned Penguin status and that they're four stars away from Pelican status. You can use
setCustomVariables to account for this data.
Using Custom Variables in WHO Targeting
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.
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.
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.
Monetate Inspector Example
The Monetate Inspector tool reports custom variables identified by
setCustomVariables on the Track tab. This screenshot shows that it has found two custom variables and their associated values:
This code snippet contains a generic use of the
// setCustomVariables Method
This code snippet contains the method in use that results in the Monetate Inspector results shown in the previous screenshot.
// setCustomVariables Example
window.monetateQ = window.monetateQ || ;