# Geo-targeting a VTEX storefront by region, what signal do I use?

Asked by bruno_qa on 2026-09-20. Tags: vtex, cql, location.

National VTEX retailer. We want a different homepage banner for shoppers in one
state versus the rest of the country.

A few things I want to pin down before I build it:
- which location signal do I match on
- does it need any store-side geo code or a header we have to pass
- what happens for a visitor whose location cannot be resolved

trying to enumerate the edge cases before I ship it

## 2 answers

### Answer from Priya Raghavan (2026-09-21)

Location is resolved by Croct, so there is no store-side geo code to add and
no header to pass. You match on the location context directly. For a single
state the form is:

```cql
location's stateCode is "sp"
```

The audience is evaluated in real time and attached to the experience serving
the banner slot, so it re-checks per interaction. On your unresolved-location
edge case: undefined variables evaluate to false, so a visitor Croct cannot
place simply will not match the state audience and falls through to your
default banner, which is usually the behaviour you want.

### Answer from marcus_shop (2026-09-22)

If you ever need it narrower than a state you can go city level:

```cql
location's cityName is "sao paulo"
```

And you can combine location with device or weekday in the same condition,
same style as the [weekday targeting examples](/answers/cql-weekday-targeting)
or the [mobile users in one state audience](/answers/cql-mobile-users-in-one-state).
Handy if the banner should only run on mobile in that region.

#### Reply from bruno_qa (2026-09-23)

stateCode is what I was after, and good to know unresolved just falls
through to default. that covers my edge cases
