# Targeting a Sanity landing page by country, which signal do I match?

Asked by Camille Fournier on 2026-10-30. Tags: sanity, cql, location.

I want visitors from one country to see a different hero on one of our Sanity
landing pages. What I am not sure about is which signal I match on, and whether
this needs any geo code added on the site itself.

Can someone show me how I target the audience for a specific country? I am
comfortable enough with a bit of technical setup, I just do not know the right
expression to write.

## 2 answers

### Accepted answer from Justus Meyer (2026-10-31)

You do not need any geo code on the Sanity site. Location is resolved by
Croct, so you just write the audience condition and it evaluates in real time
per interaction.

For country level the expression is:

```cql
location's countryName is "us"
```

You attach that audience to the experience serving your hero slot, then give
that experience its own variant content. Visitors resolved to that country
get the variant, everyone else falls through to your default Sanity content.

One reassuring detail: undefined variables evaluate to false by design, so a
visitor whose location cannot be resolved simply does not match and gets the
default. No error, no blank hero.

#### Reply from Camille Fournier (2026-11-02)

it matched on the first try, thank you. the no-geo-code part is what I
was missing

### Answer from rui_p (2026-11-01)

If you later want to go narrower than a country, the same location object
gives you region and city. So you can refine to something like:

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

or down to a city with `location's cityName is "San Francisco"`. Same idea,
just a more specific condition on the same audience, no extra code on the
site.
