Optmyzr Blog

Thinking Outside the Box: Bid by Weather

Sam Mualim

Optmyzr alumnus


You know that old saying “when it rains… apply bid changes”. Well, that’s not really how it goes, but it’s most definitely one thing you can do with our Rule Engine!

In our last “Thinking Outside The Box” post, we showed you how to create a date-driven automation to change your campaign status. And that’s just one example of the many different (and powerful) use cases we have for Rule Engine.

Now we’ll show you how Optmyzr can help you automatically bid by weather.  A similar case was also covered in the “Advanced Rule Engine Examples” video by our co-founder Frederick Vallaeys.

Step 1: Create the Recipe.

For this example, we’ll create a recipe to modify bids at the ad group level using values such as “Current Temperature” or “Current Weather Condition”.

Keep in mind that this is just one of many use cases for the Rule Engine weather bid management. Among the possibilities you’ll find you can:

  • Increase/decrease bids at the keyword or product group level using weather data (e.g., increase bids for all keywords containing “air conditioners” during warm days).
  • Change the status of your campaigns (e.g., pause your “bathing suits” campaigns if it’s snowing)
  • And more!

Step 2: Set up the spreadsheet.

To set up the spreadsheet, you’ll need to make a copy of this Google Spreadsheet, and share it with

You’ll need to generate your own API key here and follow the rest of the steps listed on the sheet “Instructions and Keys”.

Note: For the last step on the spreadsheet, you can download your list of campaigns from the “Connect External Data” section in the Rule Engine by clicking on “Get Sample Data For Your Account” and pasting it exactly as it is on the “Paste CSV from RE here” sheet.

Step 3: Add the corresponding City or ZIP Code to each of the campaigns.

Now let’s add the corresponding City or ZIP Code to the campaigns. The spreadsheet has a couple of sheets to get weather data. Depending on which one you want to use, you’ll have to manually add the City or ZIP code to your list of campaigns.

For cities, please follow this format {city},{country code} (you can get a list of country codes here).

Note: If the country code is not specified, the OpenWeatherMap API might return data for the wrong city.

To link the spreadsheet to your recipe, you’ll need to paste the spreadsheet’s URL in the “Connect External Data” section. Make sure you specify the sheet from where the Rule Engine pulls weather data, and the correct column types (Current Temperature: Number|Current Weather Condition: Text).

Read further on “Connecting External Data in Rule Engine”.

Step 5: Build the recipe.

Let’s get down to business! Having completed these previous steps, you can now use any of the weather data from the spreadsheet to build your own custom optimization. Remember the spreadsheet has campaign data, so that’s the scope you should use when adding the conditions:

Let’s suppose that we have a couple of campaigns for “Sunglasses” in Madrid and “Shorts” in Toulouse. If temperatures start to rise, we might want to increase the bids for the ad groups in those campaigns accordingly. 

The first rule does precisely this. If the temperature rises above 27ºC, and the weather condition is “clear sky” it applies two actions:

  1. We increase the bids for the ad groups in the campaign by 10%
  2. We label the ad groups (for the example we’ll use: Bid by High Temperature) – This step is critical, as it helps to revert the changes with Rule-2.

But what happens if the temperatures drop? The second rule reverses the changes applied by the first rule. To do this, we check all ad groups with the label “Bid by High Temperature” and apply two actions:

  1. Set the bids back to their previous value. We achieve this by using an expression where we divide the Current Bid by 1+(0.1) where 0.1 = 10% increase.
  2. We remove the labels “Bid by High Temperature”.

Note: In the same spreadsheet you can change the temperature units used (Instructions and Keys sheet – Step 4) and see a list of all weather conditions the Open Weather Map API can return (Descriptions sheet)

Step 6: Test, preview & automate.

All set! You can now preview the suggestions and if everything looks ok, you can go ahead and automate it to run on a daily basis.

Try it out! If you have any questions, or if you’d like us to have a look at your recipe before you start running it just email us at – we’ll be glad to help you.