Weather Targeting for Google Ads: The Complete Guide

Weather Targeting for Google Ads: The Complete Guide

Weather impacts consumer behavior more than most advertisers realize. On rainy days, people search for umbrellas and indoor entertainment. During heat waves, they look for air conditioning units and cold beverages. Savvy advertisers capture these intent signals by adjusting campaigns in real-time based on weather conditions.

Google Ads doesn’t offer native weather targeting in the interface—but Google Ads Scripts give you the power to automate weather-based campaign management at scale. This guide walks you through setting up weather targeting, automating bid adjustments, and controlling when campaigns go live based on weather forecasts.

Table of Contents

How Weather Targeting Works in Google Ads

Google Ads Scripts is a JavaScript-based automation tool built into Google Ads. It allows you to write custom logic that runs daily (or hourly) to modify bids, pause campaigns, adjust budgets, and more—all based on external data sources like weather APIs.

The workflow looks like this:

  1. Fetch weather data from a public API (OpenWeather, Weather.com, etc.) for your target location
  2. Apply logic to your campaigns based on weather conditions (temperature, precipitation, humidity)
  3. Execute actions such as increasing bids, pausing ads, or enabling high-performing weather-specific campaigns
  4. Track results to see how weather adjustments impact CTR, conversion rate, and ROAS

The key advantage: You’re not limited to broad seasonal strategies. You respond to weather in near-real-time, capturing intent spikes as they happen.

Real-World Example: Hardware Store Chain

A hardware store chain sells snow shovels, ice melt, and outdoor heaters. Their campaigns perform differently depending on weather:

  • Snowing? Increase bids on “snow shovel” and “ice melt” by 50%, pause “outdoor heater” ads
  • Below 32°F? Activate “de-icing” campaign with 30% bid boost
  • Clear forecast? Pause snow-related ads, increase bids on grill covers and patio furniture

By automating this, the store responds faster than competitors and captures demand spikes in minutes, not days.

Getting Weather Data Into Google Ads

Choose a Weather API

You’ll need a weather data source that returns current conditions and forecasts. Popular options:

API Free Tier Accuracy Best For
OpenWeather 1,000 calls/day High (95%+) Temperature, precipitation, forecasts
Weather.gov (NOAA) Unlimited Very high (97%+) US-only, highly accurate
Open-Meteo Unlimited (no key needed) High (94%+) Global coverage, simple API
WeatherAPI 1M calls/month High (95%+) Global, real-time + forecast

Recommendation for beginners: Start with OpenWeather. The free tier is generous, documentation is excellent, and the API returns both current and forecast data.

Get Your API Key

  1. Sign up at openweathermap.org (free)
  2. Navigate to API keys in your account settings
  3. Copy your default API key
  4. You’re ready to use it in Google Ads Scripts

The free tier includes current weather data and 5-day forecasts—enough for most ad strategies.

Step-by-Step: Automate Bid Adjustments by Temperature

Let’s build your first weather-triggered script. This example increases bids on a cold-weather campaign when temperatures drop below 40°F.

Step 1: Create a New Google Ads Script

  1. Log into Google Ads
  2. Navigate to Tools & Settings > Bulk Actions > Scripts
  3. Click the blue + button to create a new script
  4. Name it “Temperature-Based Bid Adjustment”

Step 2: Add the Script Code

Paste this code into the script editor:

// Configuration
const OPENWEATHER_API_KEY = 'YOUR_API_KEY_HERE';
const LOCATION = 'New York,US'; // Change to your target location
const CAMPAIGN_NAME = 'Winter Gear'; // Your campaign name
const LOW_TEMP_THRESHOLD = 40; // Celsius or Fahrenheit (set units below)
const TEMP_UNIT = 'F'; // 'C' for Celsius, 'F' for Fahrenheit
const BID_INCREASE_PERCENT = 25; // Increase bids by 25% when cold

function main() {
  try {
    // Fetch weather data
    const weatherData = getWeatherData();
    const currentTemp = weatherData.temperature;
    const condition = weatherData.condition;

    Logger.log('Current temp: ' + currentTemp + '°' + TEMP_UNIT);
    Logger.log('Condition: ' + condition);

    // Get campaign
    const campaign = AdsApp.campaigns()
      .withCondition("Name = '" + CAMPAIGN_NAME + "'")
      .get()
      .next();

    if (!campaign) {
      Logger.log('Campaign not found: ' + CAMPAIGN_NAME);
      return;
    }

    // Apply bid adjustments
    const keywords = campaign.keywords().get();
    let adjustedCount = 0;

    while (keywords.hasNext()) {
      const keyword = keywords.next();
      const currentBid = keyword.getCpcBid();

      if (currentTemp <= LOW_TEMP_THRESHOLD) {
        // Cold weather: increase bid
        const newBid = currentBid * (1 + BID_INCREASE_PERCENT / 100);
        keyword.setCpcBid(newBid);
        adjustedCount++;
        Logger.log('Bid increased for: ' + keyword.getText() +
                   ' from $' + currentBid.toFixed(2) +
                   ' to $' + newBid.toFixed(2));
      } else {
        // Warm weather: reset to original
        keyword.setCpcBid(currentBid);
      }
    }

    Logger.log('Total keywords adjusted: ' + adjustedCount);

  } catch (error) {
    Logger.log('Error: ' + error);
  }
}

function getWeatherData() {
  const url = 'https://api.openweathermap.org/data/2.5/weather?q=' +
              encodeURIComponent(LOCATION) +
              '&appid=' + OPENWEATHER_API_KEY +
              '&units=' + (TEMP_UNIT === 'C' ? 'metric' : 'imperial');

  try {
    const response = UrlFetchApp.fetch(url);
    const json = JSON.parse(response.getContentText());

    return {
      temperature: Math.round(json.main.temp),
      condition: json.weather[0].main,
      humidity: json.main.humidity
    };
  } catch (error) {
    Logger.log('API Error: ' + error);
    return { temperature: null, condition: 'Unknown' };
  }
}

Step 3: Configure Your Settings

Replace these values at the top of the script:

  • YOUR_API_KEY_HERE → Your OpenWeather API key
  • New York,US → Your target location (city, country)
  • Winter Gear → Your actual campaign name
  • 40 → Your temperature threshold
  • 25 → Percentage bid increase

Step 4: Authorize & Test

  1. Click Authorize and grant the script access to your Google Ads account
  2. Click Preview to see what would change (without actually changing anything)
  3. Review the logs. You should see current temperature and adjusted keywords
  4. Once confident, click Save and Deploy

Step 5: Set the Schedule

After deploying, configure when the script runs:

  1. In the script page, click Execution schedule
  2. Select Daily or Every hour (hourly updates are better for weather sensitivity)
  3. Save

Your script now runs automatically, adjusting bids based on real-time temperature data.

Activating and Pausing Campaigns by Weather

Beyond bid adjustments, you can completely enable or disable campaigns based on weather. This is especially useful for seasonal products.

Script: Enable/Disable Campaigns by Weather Condition

const OPENWEATHER_API_KEY = 'YOUR_API_KEY_HERE';
const LOCATION = 'New York,US';

// Campaigns and their weather triggers
const CAMPAIGN_RULES = {
  'Snow Removal': { triggers: ['Snow', 'Sleet'], enabled: true },
  'Cold Weather Gear': { triggers: ['Rain', 'Drizzle', 'Cold'], enabled: true },
  'Summer Products': { triggers: ['Clear', 'Sunny'], minTemp: 75, enabled: false }
};

function main() {
  const weatherData = getWeatherData();
  const condition = weatherData.condition;
  const temp = weatherData.temperature;

  Logger.log('Current: ' + temp + '°F, ' + condition);

  for (const [campaignName, rule] of Object.entries(CAMPAIGN_RULES)) {
    const campaign = AdsApp.campaigns()
      .withCondition("Name = '" + campaignName + "'")
      .get()
      .next();

    if (!campaign) continue;

    let shouldEnable = false;

    // Check if weather matches triggers
    for (const trigger of rule.triggers) {
      if (condition.toLowerCase().includes(trigger.toLowerCase())) {
        shouldEnable = true;
        break;
      }
    }

    // Check temperature conditions if specified
    if (rule.minTemp && temp < rule.minTemp) {
      shouldEnable = false;
    }

    // Apply changes
    if (shouldEnable && campaign.isPaused()) {
      campaign.enable();
      Logger.log(campaignName + ' enabled');
    } else if (!shouldEnable && !campaign.isPaused()) {
      campaign.pause();
      Logger.log(campaignName + ' paused');
    }
  }
}

function getWeatherData() {
  const url = 'https://api.openweathermap.org/data/2.5/weather?q=' +
              encodeURIComponent(LOCATION) +
              '&appid=' + OPENWEATHER_API_KEY +
              '&units=imperial';

  const response = UrlFetchApp.fetch(url);
  const json = JSON.parse(response.getContentText());

  return {
    temperature: Math.round(json.main.temp),
    condition: json.weather[0].main,
    humidity: json.main.humidity
  };
}

This script:

  • Checks current weather conditions
  • Compares them against your predefined rules
  • Automatically enables or pauses campaigns
  • Runs every hour to respond to weather changes

Real impact: Instead of manually pausing campaigns, your ads turn on/off automatically. During a surprise snowstorm, "Snow Removal" campaigns activate instantly. When it clears up, they pause. No lost revenue, no wasted spend.

Geographic Targeting by Weather Zone

If you operate in multiple regions, you can set different rules per location. This advanced approach treats each area's weather independently.

Multi-Location Weather Script

const OPENWEATHER_API_KEY = 'YOUR_API_KEY_HERE';

// Define locations and their associated ad groups
const LOCATIONS = {
  'New York,US': {
    campaign: 'Northeast Campaign',
    coldWeatherThreshold: 40,
    hotWeatherThreshold: 85
  },
  'Phoenix,US': {
    campaign: 'Southwest Campaign',
    coldWeatherThreshold: 55,
    hotWeatherThreshold: 105
  },
  'Seattle,US': {
    campaign: 'Pacific Campaign',
    coldWeatherThreshold: 45,
    hotWeatherThreshold: 80
  }
};

function main() {
  for (const [location, config] of Object.entries(LOCATIONS)) {
    const weather = getWeatherData(location);
    adjustCampaignByWeather(config.campaign, weather, config);
  }
}

function adjustCampaignByWeather(campaignName, weather, config) {
  const campaign = AdsApp.campaigns()
    .withCondition("Name = '" + campaignName + "'")
    .get()
    .next();

  if (!campaign) return;

  const temp = weather.temperature;
  let bidMultiplier = 1.0;

  if (temp <= config.coldWeatherThreshold) {
    bidMultiplier = 1.3; // 30% increase
  } else if (temp >= config.hotWeatherThreshold) {
    bidMultiplier = 1.2; // 20% increase
  }

  const keywords = campaign.keywords().get();
  while (keywords.hasNext()) {
    const keyword = keywords.next();
    const baseBid = keyword.getCpcBid();
    keyword.setCpcBid(baseBid * bidMultiplier);
  }

  Logger.log(campaignName + ': ' + temp + '°F, multiplier: ' + bidMultiplier);
}

function getWeatherData(location) {
  const url = 'https://api.openweathermap.org/data/2.5/weather?q=' +
              encodeURIComponent(location) +
              '&appid=' + OPENWEATHER_API_KEY +
              '&units=imperial';

  const response = UrlFetchApp.fetch(url);
  const json = JSON.parse(response.getContentText());

  return {
    temperature: Math.round(json.main.temp),
    condition: json.weather[0].main
  };
}

This approach lets national brands manage weather-based campaigns by region, responding to local conditions without manually toggling each region's settings.

Integrating WeatherTrigger for Hands-Free Automation

Writing and maintaining Google Ads Scripts requires technical knowledge and ongoing adjustments. If you want weather-based Google Ads automation without the scripting, WeatherTrigger removes the complexity.

How WeatherTrigger Works with Google Ads

WeatherTrigger connects to your Google Ads account and automates the actions described above—without writing a single line of code:

  1. Connect your account via OAuth (2 minutes)
  2. Set rules in a simple interface: "When temperature drops below 40°F, increase bids on this campaign by 25%"
  3. Let it run — WeatherTrigger checks weather every hour and applies changes automatically
  4. Track results in the dashboard with detailed performance metrics

Advantages of WeatherTrigger vs. Manual Scripts

Feature Google Ads Scripts (Manual) WeatherTrigger
Setup time 30-60 minutes + API key 5 minutes
Technical knowledge JavaScript required None
Rule complexity Simple (temperature, condition) Advanced (humidity, forecasts, location-based)
Updates & maintenance You manage WeatherTrigger manages
Support Google documentation Dedicated support team

See the full guide to weather-triggered ads for more on how WeatherTrigger simplifies the process across Google and Meta platforms.

Frequently Asked Questions

1. How often should my script run?

It depends on how weather-sensitive your products are. For seasonal items (snow shovels, sunscreen), daily is fine. For hyper-responsive categories (delivery services, outdoor events), run hourly. More frequent = faster response, but also more API calls. OpenWeather's free tier supports up to 1,000 calls/day, so you can safely run every hour for most use cases.

2. Can I use multiple weather conditions in one script?

Absolutely. Modify the weather fetch to include humidity, wind speed, or precipitation probability from the API response, then create conditional logic around multiple factors. For example: "If temperature is below 45°F AND humidity is above 80%, enable the 'wet cold weather' campaign." This gives you granular control.

3. What's the lag time between weather change and bid adjustment?

Google Ads Scripts can run as frequently as every hour. Weather APIs update every 10-30 minutes. So in practice, you'll see adjustments within 30-90 minutes of a weather change. For most use cases, this is fast enough. Real-time integrations (like WeatherTrigger's API connection) can reduce this to 5-15 minutes.

4. Will weather automation increase my ad spend?

Not necessarily. If you're increasing bids during high-intent periods (e.g., when it's cold and people search for heaters), you'll spend more but convert more. The ROAS usually improves. If you're pausing low-performing weather campaigns, you reduce waste. Track performance in Google Ads conversion reports to see the actual impact.

Next Steps

Start with the temperature bid adjustment script above—it's the easiest to implement and shows immediate ROI. Once you're comfortable with how it works, expand to campaign activation and multi-location rules.

For more advanced automation that removes the scripting burden entirely, try WeatherTrigger free. It handles all the complexity and gives you a dashboard to monitor what's happening.

See more Google Ads automation examples here.

Learn how to measure weather-based ad performance.

Understand weather-based advertising fundamentals.

Compare WeatherTrigger with other weather ad platforms.