Weather Campaign Management Script Error

44 views
Skip to first unread message

Becs Christofides

unread,
May 31, 2023, 3:44:59 AM5/31/23
to Google Ads Scripts Forum
Wanting to pause campaign if weather drops below 15 degrees or is raining. Doesn't seem to be working.

Is there another script template out there to use?

Nils Rooijmans

unread,
May 31, 2023, 4:11:27 AM5/31/23
to Google Ads Scripts Forum
have you tried the solution created by Google?

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum

unread,
Jul 5, 2023, 1:34:27 AM7/5/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/cnBar6gTyBE) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Jul 5, 2023, 6:46:08 AM7/5/23
to adwords...@googlegroups.com

Hi All,

 

Thank you for reaching out to the Google Ads Scripts Team. Please excuse us for only getting back now as your message failed to be routed to our support queue.

 

@Nils - Thank you for providing your insights on this.

 

@Becs - I would agree with Nils' previous response, however, please do take note of how the script Bid By Weather <https://developers.google.com/google-ads/scripts/docs/solutions/bid-by-weather> works as it only reads the rules from all three of it's sheets. It then attempts to execute each rule from the Campaign sheet in sequence. For each executed rule, the script checks if the campaign targets the specified location. If it does, then the script retrieves the current bid modifier. Next, the weather conditions for that location is retrieved by making a call to the OpenWeatherMap API. The weather condition rules are then evaluated to see if the weather condition for the location matches what is specified in the rule. If it does, and the new bid modifier is different from the current bid modifier, the script modifies the bid modifier for that location. No changes are made if the weather condition doesn't match, if the bid modifier values are the same, or if the rule's Apply Modifier To is Matching Geo Targets but the campaign doesn't target the locations mapped to the rule.

 

That being said, I would also suggest checking the Generic Weather-based Campaign Management solution script as this script lets you perform campaign management tasks based on weather information. It retrieves weather info from OpenWeather servers. You can request current weather data or the week's forecast by providing city names. There are examples on how you can manage your campaigns based on a weather information included in the documentation, so I would recommend checking it out. You would need to set up the logic such that, if it meets the condition of the temperature or if it's raining from your use-case, then the script would make changes to the campaign by pausing them. I've also included documentation below this email on how to pause campaigns using the method pause().

 

Let us know if you have any clarifications.

 

Reference links:

 

Let us know if you have any clarifications.

 

This message is in relation to case "ref:_00D1U1174p._5004Q2mrQop:ref"

Thanks,
 
Google Logo Google Ads Scripts Team


Reply all
Reply to author
Forward
0 new messages