December 9

Use Weather Forecast Data to Place Google Ads

In our most recent post, we discussed the ability to use our weather API to instruct Google Ads to make campaign changes based around the current weather of your target audience. Given that digital advertising based off of current weather conditions in an area provides only one piece of the weather-triggered ads puzzle, we’re excited to share a similar tutorial to make Google ad campaign logic decisions based off of weather forecast data as well. Imagine the possibility of selling ice melt, umbrellas, or beach towels when forecast weather conditions tempt consumers the most.

Similar to before, there’s some minimal setup required. Below we’ve included our full script for you to copy, paste, and modify for your own needs.

Weather Triggered Ads: Forecast-Driven Campaign Logic

To use our Forecasts endpoint to utilize weather forecast data in your Google Ads campaign management logic, implement the following code in Google’s script manager tool, broken down for your convenience. Please note that beyond a short trial period, you’ll need to subscribe to an AerisWeather package that can support the volume needed for your daily ad impressions.

Step 1: Sign Up for an AerisWeather API developer account and begin building your script.

This code snippet covers the vital credentials necessary to access our API – minus the addition of your unique Client ID and Client Secret. Once you gather them from the “Apps” tab in your AerisWeather account, place them within the quotes where the variables are declared, it’s that easy!

Step 2: Limit the amount and type of data the API returns by providing the field and filter variables.

The following snippet calls the fields from the API Forecast endpoint that you specify. If this is not specified, all available data will be returned. Additional fields are available in the AerisWeather documentation:

Step 3: Build your advertising campaign management logic.

Below are just a few examples of methods you can use to call the API and make decisions based on the returned weather data. As mentioned, there are multiple data points in the weather forecast you can return, but also a number of additional campaign adjustments available via Google Ads that can fit neatly into this script’s logic. Learn more about those from Google here.

The preceding code snipped is where you declare the location you’d like to receive the forecast for. Use this to pinpoint your forecast to your user’s locale or base it around your current location’s conditions. How to use the location parameter is covered in this part of the AerisWeather documentation. This includes a list of all supported place formats.

 Example 1: Take action using upcoming rainy days in the forecast data

 Example 2: Use snowfall accumulation to trigger campaign logic

Example 3: Check each day for beach weather with less than 50% cloud coverage

Step 4: Call the API’s forecast endpoint

Now that you’ve built your logic using our examples and a little bit of Javascript know-how, we can call the API to return the fields we declared back in Step 2, just like the Observations endpoint.

This step requires little customization as the API returns data in a clean and uniform JSON format each time it’s called.

To finalize the implementation of your Forecast-based Campaign Management Script, follow the instructions to authorize and run the script from Google’s documentation. Based on which campaigns or ad groups you set this script up to trigger, you can impact the efficiency of every ad you run.

There you have it! Within minutes you’re driving your ads based on upcoming weather conditions.

Looking to get started with AerisWeather’s precise weather data? Sign up for a free trial of our Weather Data API and AMP (AerisWeather Mapping Platform) or contact our sales team today!

Share this post:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.