> For the complete documentation index, see [llms.txt](https://kbase.whitelabel-loyalty.com/product/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kbase.whitelabel-loyalty.com/product/loyalty-engine/audiences/audience-tutorials/create-audiences-based-on-user-profile-information/create-a-user-location-audience.md).

# Create a user location audience

## Introduction

User location can be a great way of tailoring your loyalty program to a specific user. It can be used to promote local events and rewards, while ensuring that you're only showing relevant information to relevant people.

***

## Configuration

### Users in a particular city

1. Navigate to Users > Audiences and then click 'Create' in the top right corner.
2. Give the audience a name and description. Turn on AUDIENCE\_JOINED and AUDIENCE\_LEFT events if needed. Set the refresh rate to 'Daily'.
3. Move to the criteria tab. The criteria should be;
   * Profile matches JSON schema

     ```json
     {
       "$schema": "http://json-schema.org/draft-06/schema#",
       "type": "object",
       "required": [
         "city"
       ],
       "properties": {
         "city": {
           "const": "enter city name here"
         }
       }
     }
     ```
4. Click save.

### Users in a particular UK postcode area

{% hint style="warning" %}
The following setup applies to UK postcode formats. Setting up for different countries will require a different schema. The country validation in the schema ensures that countries with similar postcode formats are excluded.
{% endhint %}

{% hint style="info" %}
The criteria is case sensitive. Consider adding upper and lowercase variations to the schema to ensure accuracy. E.g., for the NE postcode the pattern would be `"^(NE|Ne|nE|ne)\\d+"`
{% endhint %}

1. Navigate to Users > Audiences and then click 'Create' in the top right corner.
2. Give the audience a name and description. Turn on AUDIENCE\_JOINED and AUDIENCE\_LEFT events if needed. Set the refresh rate to 'Daily'.
3. Move to the criteria tab. The criteria should be;
   * Profile matches JSON schema

     ```json
     {
       "$schema": "http://json-schema.org/draft-06/schema#",
       "type": "object",
       "properties": {
         "postcode": {
           "type": "string",
           "pattern": "^(POSTCODE AREA 1|POSTCODE AREA 2|POSTCODE AREA 3)\\d+"
         },
         "country": {
           "const": "GB"
         }
       }
     }
     ```
4. Click save.

***

## Tips

* The end-user can update their location details via their profile at any time. Consider this if you're using this audience to limit reward availability.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kbase.whitelabel-loyalty.com/product/loyalty-engine/audiences/audience-tutorials/create-audiences-based-on-user-profile-information/create-a-user-location-audience.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
