How do I set a custom variable?
In order for a variable to exist it must be contained within an Action. If the Action that contains the variable is deleted, the variable will cease to exist.
To set a variable with element interactions:
- Select an element.
- From the Interaction tab, click the Actions button.
- Select Set Variable. The Element Interaction panel will open.
- Select a Trigger.
- Set a Delay time, if desired.
- The Variable will be set to New Variable by default.
- Give the variable a Name.
- Choose a Type. See Type options below.
- Select Fire Once if you want to make sure that the variable set only happens the first time a user interacts with this element. This saves having to track variables that are used to determine if all the buttons on a page have been clicked.
- Input Conditions you wish to evaluate, if any, that are met before the variable can be set.
- Click Apply to commit your changes.
- Click Preview to preview the variable or Done to complete.
To set a variable with page timings:
- Select an element.
- From the Interaction tab, click the Actions button.
- Select Set Variable. The Element Interaction panel will open.
- Select a Trigger.
- Set a Delay time, if desired.
- The Variable will be set to New Variable by default.
- Give the variable a Name.
- Choose a Type. See Type options below.
- Select Fire Once if you want to make sure that the variable set only happens the first time a user interacts with this element. This saves having to track variables that are used to determine if all the buttons on a page have been clicked.
- Input Conditions you wish to evaluate, if any, that are met before the variable can be set.
- Click Apply to commit your changes.
- Click Preview to preview the variable or Done to complete.
Note: You will know that an element has a set variable when you see an ( x ) symbol next to it.
Type Options:
Number: Requires selection of an Operator (=, +=, -=)
String: Requires input of Value.
Note: When setting a variable to a string there is no need to surround the text with quotes unless you're doing string manipulation. Example : {{dki.course.title}} + " : " +{{dki.course.description}}.
Note: When setting a variable to a string there is no need to surround the text with quotes unless you're doing string manipulation. Example : {{dki.course.title}} + " : " +{{dki.course.description}}.
True/False Boolean: Requires selection of a Value of True or False.