Examples you can refer to for creating expressions in the Expression Builder code editor.
Create your own trait rules with the Expression Builder code editor. The following examples can help you get started. Some of the examples preface the key
variable with c_
to identify it as a user-defined variable. Include the c_
prefix (or any other naming convention) for key
variable if your event calls send data to Audience Manager using that syntax.
The rule establishes trait qualification requirements using Boolean AND operators.
Sample Code | To qualify, a visitor must |
---|---|
(c_make=="A") AND (c_model=="B") AND (c_search=="1") |
|
This rule establishes trait qualification requirements using Boolean OR and AND operators.
Sample code | To qualify, a visitor must |
---|---|
(a== "1" OR b=="1") AND (c=="new") |
Meet the conditions set by variables a or b and c . |
This rule establishes trait qualification requirements using a range.
Sample code | To qualify, a visitor must |
---|---|
(price >= 1.00 AND price <= 100.00) |
Meet any price condition between 1.00 and 100.00. |