The weather plays an important role in influencing consumer behavior. Infoplaza offers options to target a wide range of weather conditions and parameters, such as temperature, UV index, weather type or snowfall. The advantages: real-time data ensures high relevance and high relevance ensures high effectiveness.
Infoplaza titles with weather targetting
- weerplaza.nl (web and app)
- weeronline.nl (web and app)
- Buienalarm (app)
- meteovista.be (web)
Available weather targeting keys**
Before working on your ad please check carefully which screenad var is used and which data is returned by each website. The return value can differ between Infoplaza titles.
WEERONLINE (web)
Key
|
Example value |
Screenad var |
Available on |
weathertype today
|
weather code, please checkout the script (in the example below): convertWeeronlineWeatherCode(weeronlineCode) |
screenad.vars.scrweathertypetoday |
weeronline.nl (web)
|
feelslike temperature today
|
number |
screenad.vars.scrfeelsliketemperaturetoday |
weeronline.nl (web)
|
WEERPLAZA (web)
Key
|
Example value |
Screenad var |
Available on |
weathertype today
|
- bewolkt (cloudy)*
- zon (sun)*
- regen (rain)*
|
screenad.vars.scrweathertypetoday |
weerplaza.nl (web)
|
temperature today
|
number
(Always temperature of the "markt" in the Bilt)
|
screenad.vars.scrtemperaturetoday |
weerplaza.nl (web)
|
temperature tomorrow
|
number
(Always temperature of the "markt" in the Bilt)
|
screenad.vars.scrtemperaturetomorrow |
weerplaza.nl (web)
|
weathergrade bbq today
|
- zeer klein (very small)*
- klein (small)*
- matig (medium)*
- groot (large)*
|
screenad.vars.scrweathergradebbqtoday |
weerplaza.nl (web)
|
* Information between brackets is a translation for non Dutch speakers. The information between brackets won't be returned by the api.
Available GEO targeting keys
Key
|
Example value |
Screenad var |
Available on |
city
|
Amsterdam
|
screenad.vars.scrcity |
- weerplaza.nl (web)
- weeronline.nl (web)
|
**More keys on request. Please contact sales (sales@weborama.nl)
How to work with the keys inside your creative?
// Hardcode any default values to preview in the previewer or as fallback.
// This is NOT a must, however useful during development.
var weathertypetoday = "S0000000";
var temperaturetoday = 23;
// Infoplaza sometimes returns locations starting with a code followed by the name.
Please take this into account.
var city = "4057672-Amsterdam";
// Please add the two functions below to your on preload complete function
connectScreenAdVars();
setData()
function connectScreenAdVars() {
// This is used when going live to get the weather information from the Infoplaza network.
// Please use only the vars needed in your creative.
if (screenad.vars.scrweathertypetoday != "" && screenad.vars.scrweathertypetoday != undefined) {
weathertypetoday = screenad.vars.scrweathertypetoday;
}
if (screenad.vars.scrtemperaturetoday != "" && screenad.vars.scrtemperaturetoday != undefined) {
temperaturetoday = screenad.vars.scrtemperaturetoday;
}
if (screenad.vars.scrcity != "" && screenad.vars.scrcity != undefined) {
city = screenad.vars.scrcity;
}
}
// Here we filter the weather type belonging to the supplied code by Infoplaza
function setData() {
// Here we set the weather type by converting the code received through weeronline
// You don't need to do this for weerplaza because it supplies a weather type string
weathertypetoday = convertWeeronlineWeatherCode(weathertypetoday)
// Here we set different content belonging to the different weather type
if (weathertypetoday.toLowerCase() === "sunny") {
image = "sunny.png";
} else if (weathertypetoday.toLowerCase() === "rainy") {
image = "rain.png";
} else if (weathertypetoday.toLowerCase() === "cloudy") {
image = "cloudy.jpg";
} else if (weathertypetoday.toLowerCase() === "snowy") {
image = "snow.jpg";
}
// Here we use the screenad vars to be displayed in the html
document.getElementById("image").style.backgroundImage = `url(${image})`;
document.getElementById("weather-type").innerHTML = weathertypetoday;
document.getElementById("temp").innerHTML = temperaturetoday + "°C";
// Here we make sure we do not get the numbers before the location name
document.getElementById("city").innerHTML = city.substring(city.indexOf("-") + 1);
}
function convertWeeronlineWeatherCode(weeronlineCode) {
const weatherCodeExcludingTimeOfDay = weeronlineCode.slice(1, weeronlineCode.length).toLowerCase()
if (weatherCodeExcludingTimeOfDay.includes('s')) {
// code explanation: s = snow
return 'Snowy'
} else if (
// code explanation: r= rain, d = drizzle, f = frozen rain, w = Winter precipitation
(other than snow or frost or combinations)
weatherCodeExcludingTimeOfDay.includes('r') ||
weatherCodeExcludingTimeOfDay.includes('d') ||
weatherCodeExcludingTimeOfDay.includes('f') ||
weatherCodeExcludingTimeOfDay.includes('w')
) {
return 'Rainy'
} else if (
// code explanation: 0=none, 1=Veil clouds, 2=sun/small white cloud, 3=sun/large white cloud,
4=sun/large grey cloud, 5=large grey cloud without sun
weatherCodeExcludingTimeOfDay.charAt(1) === '0' ||
weatherCodeExcludingTimeOfDay.charAt(1) === '1'
) {
return 'Sunny'
} else {
return 'Cloudy'
}
}
<!-- Example html body -->
<body>
<div class="stage-content">
<div class="click-area" id="click-area"></div>
<div class="stage-background"></div>
<div id="image"></div>
<img id="shape" src="shape.svg" />
<div id="text-container">
<p id="weather-type" class="text"></p>
<p id="temp" class="text"></p>
<p id="city" class="text"></p>
</div>
</div>
</body>
Example banner
View here
Download example
Download here
Comments
0 comments
Please sign in to leave a comment.