Automated Ad Optimisation, whatever the weather

As advertisers, there are many moving parts that affect the performance of ad accounts. Many of which we can’t influence; such as PR, word of mouth, news and current events, economic factors, ad platform policies and even the weather.

But there are ways to capitalise on such events – and quickly!

Sell sledges? Wouldn’t it be nice to be able launch ads, increase bids and adapt ad copy messaging as soon as the first snowflake fell in specific towns and cities across the UK?

Sell sunglasses? How about increasing budgets and launching promo code ads as soon as the spring sun peeks out from behind winter clouds. Well now you can.

If you want to find opportunities to reach users searching for weather-sensitive products, such as boots, waterproof shoes and wellies with specific ad copy, there is a way forward.

There isn’t an ‘out-of-the-box’ solution for this, however, we have found a way to use weather API data and Ad Customisers to change ad copy based on the weather in the user’s location.


We’ve created a Google Sheet that dynamically pulls in current weather data for desired locations, then updates Ad Text through an Ad Customiser feed. The Google Sheet matches the ‘Custom Ad Text’ back to the Target Location (which is where the user is based) to deliver them ad text which is relevant to the weather where they are.

For example, if it’s raining, the user may be delivered an ad similar to the below:

Setup Weather Data

There are a number of factors to consider in the setup of weather-dependent ad copy:

  1. Importing Weather Data
  2. This is pulled from API data into a Google Sheet
  3. Creating an Ad Customiser feed
  4. This pulls together all customisable data (e.g. weather, desired message, target location) to feed into ad copy
  5. Implementing Ad Customisers within Ad
  6. Making sure ads are set up to pull thorough ad customiser data into them

Step 1: Generating an API Key

  1. Go to, set up a log in
  2. This will generate your API Key, which is used to import your data.

Step 2: Importing Weather Data into Google Sheets

  1. An API key is crucial in this step! Make sure you have one
  2. Required columns before you start include:
  3. Target Location
    This is where you’ll match up your weather data with Google’s location targeting. This tells Google that you’re interested in targeting users in x location with y ad messaging
  4. Location Name – for your own reference, which location you’re pulling weather for
  5. Location ID – to match back from OpenWeatherMap API data
  6. Ad Customiser Text – Text you want to show in your ads based on the weather
  7. Ad Customiser Len – How long the custom text is for character limit purposes (NB the most characters you can have in an Ad Customiser sheet is 80, NOT 90)

3. Choose the locations you’re interested in pulling weather data for

We’ve chosen main UK cities, in order to match them with corresponding Counties in Google Ads to change the ad text depending on the user’s location

There are a couple of ways of importing the data from OpenWeatherMap with the =IMPORTDATA function, where you need either the city + country, or the location ID of that City to get the data

  1. City + country is easiest, but location ID is preferred
    To find the location ID, search for that location in and use the city/ code in the URL.
  2. To pull data using city + country, use the below formula:
    Where C2 = city name (no spaces), D2 is country name (e.g. UK) and apikey is the API Key you generated earlier
  3. To pull data using the location ID, use the below formula:
    Where C2 is the location ID

If done correctly, Google Sheets should pull data into the cells to the right of where your formula is, like this:ght of where your formula is, like this:

  1. It’s up to you to name the columns, however we’ve just stuck with ImportVar1, ImportVar2 etc. Every Column must have its own unique heading.
  2. This is all weather data for the current data; it’s up to you what pieces of data you want to use to feed your ad copy, but I’ve decided Main Weather and Weather Description are the two most important factors for this example. You could use temperature, wind speed, or anything else if these are important.

In separate columns, use a couple of formulas to clean up the data you need to use, e.g.

  1. To get Main weather, use the below where K2 is cell containing main:”Clouds” for example
  2. To get weather descriptions, use the below where L2 is cell containing description:”few clouds” for example

Lastly, it’s up to you how you might want to adjust your ad text based on the weather. We’ve used =IF(ISNUMBER(SEARCH( functions to check for certain words in the Main Weather cell, and tailor the output depending on what this weather is. E.g.

  1. =IFERROR(IF(F2=“rain”,“Beat The Rain With Our Range Of GORE-TEX Waterproof Boots & Shoes, Shop Today.”,IF(F2=“snow”,“Face The Snow With Our GORE-TEX Boots & Shoes, Shop The Range Online Today.”,“Discover Our Range Of GORE-TEX Waterproof Boots & Shoes. Shop Online Today.”)),“”)
  2. Once you have all of the data you and it’s cleaned up, you can now begin making an Ad Customiser feed in Google Ads based on your Google sheet. Download a copy of your Google Sheet into Excel and save this.

Step 3: Creating an Ad Customiser Feed

  1. In Google Ads, go to Business Data > Data Feeds
  2. Make a new Ad Customiser Feed
  3. Name the feed something relevant, and choose the file you downloaded earlier to upload as your feed template
  4. Once uploaded, you can create a schedule to automatically update the data in your feed. Go to ‘Schedules’, then select the relevant Google Sheet, set the frequency to update every 6 hours
  5. Google Ads will tell you to share access to your Google Sheet with a certain email address, make sure to do this
  6. You can look in your ‘upload history’ to see if all of the data has pulled correctly, and use the ‘Update Now’ button in schedules if you want to manually refresh your feed data
  7. It will let you know if there are any errors and what these are whenever the data refreshes, so ensure you know that your feed is working correctly!
  8. If you ever need to add a new ‘Attribute’ to the feed (e.g. if you add a new column in the Google Sheet), you can do so in ‘Settings’ and create this. Ensure the name matches exactly that of the new column heading
  9. Your ad customiser sheet is now set up! Now you can make changes to your Target location, ad messaging and anything else in your Google Sheet on the fly, and it will be updated into your data feed every six hours.

Step 4: Setting Up Customised Ads

  • Go into your desired Ad Group in the Google ads interface
  • Create a new ad or edit an existing ad
  • Type “{“ to open up the ad customiser options
  • Choose ‘Ad customiser’, wherever you want to in your ad
  • Select the feed your ad text will be pulling from
  • Select the data attribute you’re pulling into your ad copy
  • You should see a preview of what an ad couple look like after the data from the feed is pulled through
  • Apply the same syntax in the curly brackets to any other ad copy as required, in any campaign, and save the ads. You should then be able to start testing the performance of these ads!
  • N.B for any ad groups with Ad Customisers in them, you also need to use a Standard ad just in case anything goes wrong with your customiser data feed.

And there you have it – a one-stop guide to updating ad copy based on real-time weather data for your target locations!