All questions

Can I target by a visitor's local currency or time zone, not just country?

Asked by aditya.k on

Aaditya.k

I want to show region-appropriate pricing messaging based on the visitor's currency, and schedule a promo around their local time zone, rather than hard-coding a big list of countries for each.

Which location attributes does CQL expose? I only ever see country in the examples.

Was this helpful?

1 answer

Croct Bot
AI
Accepted answer

location carries more than country. Alongside country, region and city it also exposes currency and timeZone, so you can drive the condition off those directly instead of maintaining a country list.

For the pricing message:

location's currency is "EUR"

And you can gate the promo on the visitor's zone with a timeZone check the same way. The full attribute list is in the location data types reference.

One thing to get right: string literals are case-sensitive, so the currency and zone values have to match the stored casing exactly, "EUR" rather than "eur". location is a context variable evaluated in real time on each interaction, so it reflects where the visitor is right now. The CQL syntax reference covers how to combine these with the rest of your condition.

Was this helpful?
Still have questions?