Visual Crossing Blog

How to use weather forecasts to optimize Google Ads

Use case: Optimize your Google Ads by dynamically changing them based on upcoming weather.

optimize your Google Ads by dynamically changing them based on upcoming weather

Google Ads and other online advertising has become essential to every business. While it is obvious that every business needs to advertise online, business that have no online sales ability still find it valuable to reach out to potential customers while they are browsing the internet. Even businesses that are very local in their reach have found online advertising to drive more customers and more valuable interactions. In fact, Google has created various location extensions some of which are designed specifically to help local business reach their local customer-base. Studies have shown than more than 85% of local customers use the internet to find local business. So there is no question that every type of local business can benefit from online advertising.

There are many articles and consulting services that will help you create locally-targeted ads. So, in this article we will assume that you already have a functioning Google Ads campaign that targets the specific trade areas applicable to your customers. By now you already know that Google Ads can be targeted to a specific city or local area simply by entering the desired locations. The purpose of this article is to discuss how to take your Google Ads campaign to the next level by adding local weather forecasts. Using weather forecast data, you can drive customers and sales based on weather conditions specific to the local areas in which your business operates. Showing customers targeted advertising based on the exact weather conditions predicated for their own local area not only puts exactly the right products and services in front of customers at exactly the right time, it also shows that your business is knowledgeable and cares about detailed local conditions. Luckily, with the right weather service, this can be easy to do whether you have only a few locations or hundreds.

Finding quality, easy-to-use weather forecast data

In order to successfully use weather forecast data to manage Google Ads we must first locate a quality weather data service. Ideally, this service would have a few key features. First, it needs a flexible interface that allows us to quickly and easy monitor the weather forecasts for multiple locations in a single screen. In a few minutes each day, we need to see the forecast for each business area that our business serves. Second, we need to be able to access this data daily or even more frequently if necessary and at a low cost. Third, a high-quality weather data service should offer a Weather API that we can use to automate our forecast lookups. Perhaps not initially, but in the longer term, we will want to consider automating our entire weather look-up and Google Ads deployment process. This is incredibly valuable as the project grows. Using simple scripting, we can combine a weather API and the Google Ads API to completely control the ad adjustments all automatically. We’ll discuss this more later.

While there are entirely free weather forecast services available, none allow you to see easily see a forecast calendar of multiple locations on the same screen. In addition, API access is often an expensive addition to most low-cost or free services. For this article we have selected the Visual Crossing Weather Data service to supply the required forecast. It is updated constantly with worldwide coverage, it is very low cost to get started (as low as $5 per month), provides a multi-location forecast calendar view, and offers an API that can handle any business volume with ease. If you do not already have an account with Visual Crossing Weather Data, you can sign up for a free trial account here.

Manual ad management

Our first entry into managing Google Ads using weather forecast will be manual. That is, we will view the weather forecasts for our business trade areas manually in a calendar view and then manually adjust our Google Ads to reflect the forecasts that we see.

To get started we will load our business areas into the Visual Crossing Weather Data website. It is recommended to use a spreadsheet of locations, but initially you can enter them manually to see how the basic system works end-to-end. Simply follow the online prompts to submit your locations. When prompted, select the forecast query option, and you will automatically get a forecast calendar that looks like this.

Weather forecast for the days ahead

In this view you can easily see the daily forecast for each area that you have entered. While it depends upon the exact products or services being offered, customers typically respond well to events that they have heard on television or radio news, and for weather forecasts that tends to be the 3-5 day forecast period. However, if there is a very significant storm or weather change on the horizon, then a 5-7 day forecast is important. So, we simply need to scan the calendar to identify weather events relevant to our business. Is there a significant temperature change on the horizon? How about a period of rain or snow storms? We can use these weather events that people are naturally talking about to connect with prospective customers online.

We can do this by manually modifying our Google Ads that we want to deploy. Go into your Google Ads console and find your Ad Group that targets the area with the actionable forecast. If you have grouped the ads by weather event type, you can easily enable the ones that match the expected forecast. For example, if a heatwave is pending, you can put fans, AC units, or swim attire in front of your prospects. Another great feature of Google Ads is that it will track the number of actions that views take based on your ads. These are configured as “Conversions,” and you can use them to track your ads effectiveness in near-real time.

Weather forecast data

Automated ad management

The power of weather-based Google Ads marketing becomes even more apparent when you add automation into your Google Ads process. Both Google Ads and Visual Crossing Weather have an API that you can use in simple scripts and code. While scripts for specific applications are beyond the scope of this article, we can walk through the process step by step, so that you can easily create the specific versions that you need for your business purposes.

First, we will need to use the Visual Crossing Weather API to fetch the weather forecast for one or more of our target locations. We can do this with a URL call such as this one below. (Note that you can generate your own query URLs from the Visual Crossing query page using the account that you created above. The one given here is just a sample.)

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast?goal=forecast&aggregateHours=24&shortColumnNames=false&sendAsDatasource=false&allowAsynch=false&contentType=csv&unitGroup=us&key=&locations=Herndon%2C%20VA

The result of this example call will give us the weather forecast for Herndon, VA. (If you run this sample directly, make sure to replace the API key placeholder with your API key.) Each row of the data will hold the forecast for a specific day, and each cell of that row will provide a specific weather metric value.

Google Ads Manager

For example, in the in the grid shown above, the first row is tomorrow’s forecast (as of this writing). The average temperature is projected to be 45 deg F, and there is a very low chance of precipitation. However, if we look forward a few days, we can see that the chance of precipitation jumps significantly. Perhaps we may want to market rain-related accessories such as umbrellas and slickers.

We can now use this observation to trigger Google Ads API code to enable the appropriate Google Ads that targets rainy days. Here is a code snippet in Python that does exactly this.

ad_group_ad_service = client.get_service('AdGroupAdService', version='v2')
ad_group_ad_operation = client.get_type('AdGroupAdOperation', version='v2')
ad_group_ad = ad_group_ad_operation.update
ad_group_ad.resource_name = ad_group_ad_service.ad_group_ad_path(,
ResourceName.format_composite(, ))
ad_group_ad.status = client.get_type('AdGroupStatusEnum', version='v2').ENABLED
fm = protobuf_helpers.field_mask(None, )
ad_group_ad_operation.update_mask.CopyFrom(fm)

Simply replace the placeholders with your Google Ads ID, Ad Group ID, and Ad ID to match the rainy day ad that you wish to enable.

This is just the beginning of your ability to automate this system. A single Visual Crossing Weather API call can be used to query the forecast for multiple locations in one pass, and you can use multiple weather variables concurrently to make your decision about which Google Ads to enable or disable. You can find more details here in the API documentation. Likewise, the Google Ads API offers much flexibility. Not only can you enable and disable ads, you can create entirely new ads, modify keywords, and more. You can find all of the details here including samples in various programming and scripting several languages including Java, Python, and Ruby.

Summary

Savvy marketers already realize the value of using changing weather patterns to drive customers into stores and promote immediate sales. Since weather is typically a local phenomenon, local stores have an enormous amount to gain by tailoring their online advertisements to changing weather forecasts. The goal of this article was to show how easy it can be to do just that. With the right weather service, manually adjusting your Google Ads based on daily weather forecasts for multiple locations can take only minutes a day. With a bit of additional scripting work, this task can be accomplished as frequently as desired automatically without any human intervention. Of course, the simple techniques discussed here are just a starting point. By delving into the weather functionality and API available, you will find many ways to better market and manage your business using weather data. If you have any question or need more information, please contact me on the site or use the comments below. I’ll be happy to help you improve your marketing using weather data.