# Geolocation

Learn how to define an audience based on the geolocation.

The [`location`](/reference/cql/context#location) variable provides geographic information about the user, such as the continent, country, region, state, city, and time zone.

The least granular level is the continent, which you can use in a condition like this:

```cql
location's continentCode is "na"
```

You can find the list of possible values in the [Continent](/reference/cql/data-types/location/location#continent) section. For countries, you can use the [two-letter ISO code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#officially_assigned_code_elements), such as `us` for the United States, `gb` for the United Kingdom, and so on.

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

You can also use the region's code or name to create an audience of users from a specific state or region. Note that the terms state and region are interchangeable in the examples below, so you can use either [`stateCode`](/reference/cql/data-types/location/location#location-statecode-prop) or [`regionCode`](/reference/cql/data-types/location/location#location-regioncode-prop).

> **Why two variables for the same thing?**
>
> This is merely a convenience to accommodate the fact that some countries use regions instead of states to denote administrative divisions.

Example using the state's code:

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

Alternatively, you can use the state's name:

```cql
location's stateName is "California"
```

You can also create an audience of users from a specific city:

```cql
location's cityName is "San Francisco"
```

For more information on location variables, see the [Location](/reference/cql/context#location) section.
