> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/assets-library/creating-and-managing-triggers/list-of-trigger-criteria/weather-criterion.md).

# Weather criterion

Weather is a triggering criterion that enables defining a [segment](/assets-library/creating-and-managing-segments.md).

To learn how to create a segment, please refer to this [article](/web-experimentation-and-personalization/targeting-step/how-to-create-a-segment-who-section.md).

## Definition <a href="#h_01hhpygwdzt9fhcmk07n3wtz6n" id="h_01hhpygwdzt9fhcmk07n3wtz6n"></a>

The weather criterion enables you to test or personalize your visitors' experiences based on real-time weather data.

### Configuration <a href="#h_01hhpygwdz33kbshnj8m6kc4rn" id="h_01hhpygwdz33kbshnj8m6kc4rn"></a>

<figure><img src="/files/FX0XQZ5kvmgrZAPJTkgi" alt="" width="563"><figcaption></figcaption></figure>

AB Tasty offers you different dimensions to work with based on weather conditions. In the first field, you can either include or exclude the audience you’ll be configuring. Then, two main elements will help you define your trigger:

* **A specific type of weather:** You can choose between Clear, Clouds, Drizzle, Dust, Fog, Mist, Rain, Smoke, Snow, Thunderstorm, or All.
* **A range of temperature:** select here the range of temperature you want your campaign to be based on, starting from the minimum value to the maximum value of this range
  * If you put only one min temperature, the targeting will be done on all the values equal to or above that value.
  * If you put only one max temperature, the targeting will be done on all the values equal or under that value.

### Use case <a href="#h_01hhpygwdzjzx1fv7jaam165c0" id="h_01hhpygwdzjzx1fv7jaam165c0"></a>

The weather criteria is a key pillar in terms of personalization and will help you build a strong strategy based on what your visitors are experiencing in real-time. Let’s imagine a big drop in temperature in mid-season. You could promote and display with AB Tasty,  a specific card or banner on your website to highlight your snow/winter coats with specific price discounts.

<figure><img src="/files/iRM9gsioc4LFzGxJO5EX" alt="" width="563"><figcaption></figcaption></figure>

Inside the trigger builder, you can proceed as follows:

1. Select the weather criteria
2. Select the `is` operator
3. Select the `Snow` type of weather
4. The range could go from `0F°` to `32F°`

With this configuration, your campaign will be displayed only when your visitors are exposed to snowy conditions.

### How does it work? <a href="#h_01hhpyw4abkqmjd1yk9a78xfk5" id="h_01hhpyw4abkqmjd1yk9a78xfk5"></a>

To display the right temperature metric (either Celsius or Fahrenheit), AB Tasty refers to your account language settings. We will display Fahrenheit by default if the language configured is English, and Celsius for other languages. The trigger will automatically use the right reference system.

Weather detection goes through a few different steps:

1. We interpret the visitor geolocation from its IP
2. We call a specific service called “Open weather map” to know what is the current weather on that particular geolocation
3. We store this information in the session storage, inside the same object as the Geoloc one (`ABTastyGeoloc`)
4. The weather information for the geolocation point is cached for 2 hours

This weather service is triggered only when our tag detects that a weather-based trigger is being used in an active campaign on your account.

When a user session starts, the tag first checks if the weather information is already available in the session storage. If the data is not found, the tag performs a weather lookup based on the user's IP address, provided that the user has given the necessary consent. This process follows the verification flow described earlier.

**Need additional information?**

Submit your request at <product.feedback@abtasty.com>

Always happy to help!

<img src="/files/wHMvSehmIno4WeyTBE8O" alt="" width="146">


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.abtasty.com/assets-library/creating-and-managing-triggers/list-of-trigger-criteria/weather-criterion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
