Skip to content
English
  • There are no suggestions because the search field is empty.

Weather Trigger

Weather conditions

Advertisements can change depending on the weather. For example, an advertisement for umbrellas may be displayed when it's raining; a sunscreen advertising is automatically displayed on screens when the temperature exceeds 25°C.

Here are the following items for the weather conditions:

  • Weather (sunny, cloudy, rainy, not rainy, snowy, half cloudy)
  • Temperature (threshold of temperature in celcius)
  • Air pollution (Good, poor,...)
  • UV index (threshold of UV index)

Not rainy means: the combination of all other possible weather conditions, except rain.

Our data provider

For weather targeting, we work with the Open Weather API (https://openweathermap.org/) which is based on latitude/longitude.

There's a caching mechanism for weather data within a 500-meter radius. Here's a detailed explanation of this concept:

Caching Principle

  • When a request is made for weather data for a specific location, the results are stored in a cache.
  • If a new request is made for a location within 500 meters of a previously requested location, the system will use the cached data instead of recalculating or re-fetching the data from the OpenWeatherMap API.
Concrete Example
  • If a weather application requests data for point A (latitude 40.7128, longitude -74.0060) and gets the results, these data are stored in the cache.
  • If later a request is made for point B very close by (e.g., latitude 40.7130, longitude -74.0055), the system will use the cached data from point A because B is within 500 meters of A.
Advantages
  • Efficiency: Reduces the number of requests to the API, decreasing server load and improving response times.
  • Consistency: Ensures that weather data remains consistent for geographically close areas, avoiding minor but potentially confusing discrepancies.

Granularity

For Air pollution, the data is retrieved from Open Weather every two hours.

For Weather, UV index and Temperature the data is retrieved from Open Weather every hour. 

We have hourly granularity on triggers.

To illustrate that, let's assume you select a trigger Weather > Not rainy, and you didn't apply any dayparting in the setup of your line item.

  • We retrieve data from Open Weather every hour. The interval is labelled as 'not rainy', so we'll buy during that period.
    • If the weather changes within the hour and becomes 'rainy', the buying process will still happen until the next refresh.
  • We retrieve data from Open Weather every hour. The interval 1pm-2pm is labeled 'rainy', the interval 2pm-3pm is labeled 'not rainy'.
    • Purchase will start at 2pm but no earlier.
    • Even though it only rains from 1pm to 1:45pm, purchase will not resume until 2pm.