• Michael Tucker

How to personalize emails using weather in Marketo

“Rainy days and Mondays always bring me down” sang Karen Carpenter in a song from a long time ago. Thinking as a marketer, how much does the weather impact your target audience’s emotions and, thus, their purchase behaviors? How do you communicate to people based on something that changes as frequently and randomly as the weather? We covered an example of how to use weather in our last MUG meeting with a Case Study on a Parking Lot Party for a local Chevy dealership, but here we’ll go into details on how to use current weather conditions in your marketing communications.


A deeper opportunity to engage

In today’s current events that are dominated by Stay at Home orders, one of the few areas of your in-person marketing program remains outdoor activities. Ask anyone in the restaurant industry these days how important drive-thru or takeout business is these days. Even in normal conditions, how important is the weather for the home improvement industry. Should Home Depot or Lowe’s promote products for outdoor lawn and garden projects or talk about how great a fresh coat of paint and some crown molding looks in your dining room? As you’re heading out, should Wendy’s try to sell you a warm bowl of chili or one of their cool, creamy Frosty’s? All of these purchase decisions are strongly influenced by the current weather.


Accessing a source for weather data

How then do you incorporate weather into your Marketo instance? Essentially, we’re creating a webhook that checks with a weather service and returns a local forecast to a user record in Marketo. For this example we’re using AccuWeather APIs. You’ll need to sign up for an account to get an API Key before you can submit your webhook request, but AccuWeather offers free accounts for 50 calls per day.


Step 1: Build Location Key Webhook

Our forecast endpoint covers all cities in the US and Canada and uses a 6-digit location key value to determine the right city to forecast… how many US cities are named Springfield, for example? So we’ll run the following webhook to search for a Location Key from the City and State fields in Marketo:

http://dataservice.accuweather.com/locations/v1/cities/search?apikey=***********&q={{lead.city}}%2C{{lead.state}} 

Note that you’ll need to get the following values for your example:

  1. API Key: This is hashed out in our example, but you’ll put in the API Key value that you were assigned when you create an application on your AccuWeather account

  2. Q: This is a string that contains the “City, State” values that you search for to get a location key. I’ve replaced these with Marketo Lead tokens and used the HTML encoding for a comma, which is %2C, but while you’re initially testing this out you can replace this any city that you’d like. Let’s use Knoxville, TN for our example.

The output of our location webhook starts as follows (note that key is located on line 4):


In Marketo, we’ll map that value back into a Custom Field called Location Key to use in the forecast webhook as follows:


Step 2: Build Local Forecast webhook

Now that we have the location key for Knoxville, TN saved to the lead record for our store executive, we can use that value in a different webhook to gather the Local Forecast for the next day. Below is the webhook we’ll use in Marketo:

http://dataservice.accuweather.com/forecasts/v1/daily/1day/{{lead.Location Key}}?apikey=*********

Querystring Parameters:

  1. APIKey: The same API Key that was used for the first webhook. Replace with the key you were issued when you signed up for an AccuWeather account and created your app there.

Note the {{Lead.Location Key}} token at the end of the endpoint’s URL is what determine’s the location where we’re looking for the weather forecast. We’ll receive the following output from the API:


We’ll use this information to map the response back to the Marketo Person record for the Knoxville store executive.



Step 3: Build a Marketo Operational Program for Weather Forecasts


Marketo only runs webhooks that are inside of triggered smart campaigns. AccuWeather also requires the above querystring values to properly look up the weather.

So we’ll create an Operational Program to using a Request Program trigger so that any program in your Marketo workspace can trigger the webhook throughout. The program will also check for any missing values that might return an error. See the tree on the left for a list of different actions.


Here are elements that we include in our program:

  1. A smart campaign with a Requested Program trigger for each type of webhook to AccuWeather (one each for Location Search, 1 Day Forecast, 5 Days Forecast, and a National Weather Alert)

  2. An error handling folder with a smart campaign and an email alert to internal stakeholders if a webhook is requested without the required city/state data.

  3. Smart Lists that add Local Store Marketing leaders by location as they’re processed through the program.


How do I use Weather data in my Marketo programs?

With the Weather Operational program in place, you can quickly request the weather forecast for a given lead by placing a Request Campaign flow step into any program in your Marketo instance. Here are a few ways that you might use this data:


  1. Build a Segmentation around Weather Category for dynamic content emails based on the weather your target audience is experiencing (e.g. A national promotion for an HVAC provider showing either Heating or Air conditioning service)

  2. Build website personalization segments to customize your web pages with the right information (e.g. change your hero graphics daily based on whether your visitors are experiencing rain, sun, or snow)

  3. Create alerts in your event program to anticipate rain out situations for outdoor events (e.g. See our Marketo Case Study: The Parking Lot Party)


Example: Lowe’s Weekend DYI Projects

While people are staying at home, this is a great time for home improvement projects. Here’s a fictional example of how Lowe’s Home Improvement might use weather data to power dynamic content on it’s emails. Every Friday, Lowe’s would a drip campaign out to new home owners suggesting weekend projects based on the forecasted weather.


Here are two examples of the exact same email built with Marketo’s Dynamic Content features:


Outdoor Appeal – Perfect for Patio Season

Indoor Appeal – Freshen Your Look


MarTech Blog

©2018, THE CONVERSION STORE
All Rights Reserved

Our Privacy Policy