Is there a way to test why my audience does not match my own browser?
I built an audience that combines a location clause with a session clause and the experience never shows for me, even though I should clearly match. The condition is roughly:
location's stateCode is "ca" and session's stats' pageviews > 3I opened the console hoping for some kind of match log but all I get from the SDK is the usual startup output:
[Croct] Croct is readyIs there a way to see which clause is failing instead of guessing? Right now I'm just refreshing and hoping
1 answer
Yes, you can evaluate the exact condition straight from the devtools console. croct.evaluate takes any CQL expression and returns the live result:
croct.evaluate('location\'s stateCode is "ca" and session\'s stats\' pageviews > 3')The trick for debugging is to break the condition into clauses and evaluate each one separately. Undefined variables evaluate to false by design, so a clause that silently never matches will show up as false on its own. You can also dump what a variable currently holds:
croct.evaluate('location')That usually reveals the culprit immediately, for example a VPN or corporate proxy resolving to a different state than you expect.
Two more tools worth knowing:
- The profile explorer in the dashboard shows what your profile actually contains.
- The attributes option on evaluate injects test values without touching the profile, useful for simulating a state you are not in.
Found it in two minutes with this. croct.evaluate('location') showed my office VPN resolving to a different state entirely. The session clause was fine all along. Thanks!