rules

Using weather forecast data in Studio

LocationRuleGroup.png

We are continuously looking for new rules that you can implement into your scripts to create a more dynamic result and today we are unveiling the new Forecast rule. Previously we only provided the current weather conditions but using the new forecast rule you can now select the weather forecast from today to 9 days in advance.

To use the forecast rule, select it from the Location rule group.

To choose the forecast condition for up to 9 day from now, type today+ into the search box. A drop down list will prompt you to choose one of the options. For example, if today is Monday and you want to know if it is forecast to rain on Wednesday, you would add the condition Today+2 Rain.

WeatherForecast.gif
forecastTomorrow.PNG

This rule also allows you to group together multiple weather conditions with multiple days as either a Match all or Match any.

For example, if the creative only cared about tomorrow being a sunny day, you can have one line mentioning tomorrow being a sunny day and another line grouping together the non sunny values with a Match Any operator. If the weather forecast was anything but sunny then the second line would play.

If you wanted to provide creative on the condition that this weekend is sunny you could implement the Day of week rule alongside the Forecast rule.

ForecastDayOfWeek.jpg

As you can see in the screenshot, the Day of week rule is set to Monday and the forecast is set to  ‘Today+5 sun’ and ‘Today+6 sun’ to see if the forecast for either Saturday or Sunday is sunny.

You could then go through the rest of the week: On Tuesday set the rule to ‘Today+4 Sun’ and ‘Today+5 Sun’ as the weekend is 4 and 5 days after Tuesday.

 

The new weather forecast rule has plenty of creative potential. In this blog we suggest a range of ideas that use this forecast rule.

Rule processing

Rules are processed in order, from the top down.

threeRules.png

In an option block you can up to four rules that all have to be true for that element to be chosen. For example, in the image above, the rules are Day of Week, Weather and Impression.

We process the option block from the top down and stop processing as soon as we find an element where all rules are true. So, for the "Its another Monday morning" line to be chosen in the above example, Day of Week would need to equal Monday, Weather equal Cloud and Impression less than 2. If these rules are all true, then this line will be chosen and we will not continue down the list. If any of the rules are not true then we move on to the next element in the list ("Its a sunny Monday afternoon").

For numerical and date rules, this can have a neat outcome by using less than or greater than rules.

Example 1: Age

If you have messages for listeners of different ages, then you can use the less than rule to always evaluate the first in the list. As the table below shows, for ages bands less than 18, less than 30, less than 50 and default, the yellow marker shows which message would be returned for different user ages.

Age rule Age = 17 Age = 27 Age = 51
> 18 Yes No No
> 30 Yes Yes No
> 50 Yes Yes No
Default Yes

Where Age = 17, the rule is true, but we pick the first in the list, so the <18 message is returned.

Example 2: Date

You may have time bound messages, for example over the Christmas period where you need different messages up to Christmas Day, then up to New Years Eve, then after 1 Jan. The table below shows how that would be evaluated, again, taking the first "Yes" in the list as the message returned.

Date rule 21 Dec 28 Dec 4 Jan
Before 25 Dec Yes No No
Before 31 Dec Yes Yes No
Default Yes

Ignore

Ignore rules to reduce the number of options.

ignore.png

Sometimes when writing a script you want to have a specific line for one option only but not the others. For example, if you have a line that changes by day part (morning, afternoon or evening) and you want to talk about the weather only in the morning line, the Ignore check box lets you avoid having to create lines for every possible combination.

Without ignore, you would need to have 12 lines in the script:

Snow Rain Cloud Sun
Morning 1 2 3 4
Afternoon 5 6 7 8
Evening 9 10 11 12

With ignore, you can ignore weather for some of the day parts (for example Afternoon and Evening) and so end up with 6 lines:

Snow Rain Cloud Sun
Morning 1 2 3 4
Afternoon 5 (with Weather set to ignore)
Evening 6 (with Weather set to ignore)

You could take this even further if you only wanted to call out a snowy morning and not mention the weather in any other morning line.

Snow Rain Cloud Sun
Morning 1 2 (with Weather set to Ignore)
Afternoon 3 (with Weather set to Ignore)
Evening 4 (with Weather set to Ignore)

And as long as the Morning - Snow line (1) comes before the Morning / Ignore line (2) then a snowy morning will trigger that line. This is because we process rules from the top down and stop at the first true rule. (See the Greater Than post for more)