Difference between "matches" and "is" in audience conditions?
I set up a condition for a landing page test:
session's landingPage is "first-purchase"and it never matches, zero users in the estimator. The actual landing page is a full path with the campaign slug in it so I suspect thats the problem. I saw matches used in one of the docs examples and now I'm not sure which operator I should be using where. Is matches a regex thing? Would love a rule of thumb so I stop second-guessing every condition.
2 answers
is is exact equality, the whole value has to be identical. Your landing page is something like /lp/first-purchase-q3, so comparing it to the string "first-purchase" fails every time.
matches is substring/pattern matching, which is what you want here:
session's landingPage matches "first-purchase"Same idea works elsewhere, e.g. campaign's name matches "sale" catches "summer-sale", "flash-sale-2025" and so on. Rule of thumb: use is for values you fully control (fixed paths, enum-like attributes), use matches when the value is a longer string you only partially know.
That was it, switched to matches and the estimator lit up. The full path had a trailing campaign id I forgot about.
One more gotcha in the same family: CQL keywords are case-insensitive, but string literals are case-sensitive. So IS and is are the same operator, but "Sale" and "sale" are different values. If a condition mysteriously misses some users, check the casing of the actual data first.
And when you find yourself chaining several exact comparisons with or, use is in instead:
page's path is in ["/home", "/about"]Shorter and easier to review.