Daily Budget Script

340 views
Skip to first unread message

Vanessa Sarmiento

unread,
Apr 14, 2021, 12:07:20 PM4/14/21
to Google Ads Scripts Forum
Hi! I would like to know if is there a way to set up an automated rule for the daily budget to increase by 15% every 2 days as long as the ROI is greater than or equal to $6? On an specific campaign? Can I do this by an automated rule or by running an script?

Thanks for your help!

Regards,

Vanessa Sarmiento

KGuiste1

unread,
Apr 14, 2021, 2:04:14 PM4/14/21
to Google Ads Scripts Forum
Hi Vanessa,

This is definitely possible via scripts. I've written scripts like this for many clients.
Not sure about automated rules for this kind of thing though.

Regards

Vanessa Sarmiento

unread,
Apr 14, 2021, 2:08:13 PM4/14/21
to Google Ads Scripts Forum
Thank you very much for the information!

Could you tell me what Data or what do I need to write the Script? How long could it take to create it in order to start running?

I appreciate your help!


Regards,
Vanessa Sarmiento

KGuiste1

unread,
Apr 14, 2021, 2:27:52 PM4/14/21
to Google Ads Scripts Forum
I could probably write a script like this in under an hour, Not sure how long it'd take you as I don't know your proficiency level.

You'd have to have a campaign selector, selecting campaigns by ID, Names or Labels.
If by ROI you're referring to ROAS then you'd need to retrieve the conversion value from the campaign, the cost of the campaign and the budget for the campaign.
Write an if statement where if the conversion value/cost >= 6 then increase the campaign budget by 0.15.
Scripts can be scheduled hourly, daily or weekly, but since you want to increase increase the budget every two days you might have to schedule it to run daily and track the last increase date in a google sheet and write a script to calculate if two days had passed since then.
I'd also make sure that when the script runs it updates the 'last budget increase' date in the sheet.

That's how I'd do it.

Maybe there's a better way

Vanessa Sarmiento

unread,
Apr 14, 2021, 3:42:53 PM4/14/21
to Google Ads Scripts Forum
Thank you very much for the information! 

I really have no experience writing Scripts but I would like to try it as it would automate the processes.
Suddenly, do you know about any tool that can guide me to develop this Script that Im needing?

On the other hand, do you know if for the script is there a way to ensure the ROAS performance it's taking a look at, to decide whether to increase daily budget is over a 7 day lookback window?

Thank you one more time! 

KGuiste1

unread,
Apr 14, 2021, 3:58:33 PM4/14/21
to Google Ads Scripts Forum
The best resource I know is Resources - Ads Scripts | Google Developers. Learning how to navigate this site will help you build most of the solutions you'll ever come to build.

When selecting the campaign stats the date range will be "LAST_7_DAYS" to get the data within the last 7 days.

Vanessa Sarmiento

unread,
Apr 14, 2021, 5:06:02 PM4/14/21
to Google Ads Scripts Forum
Awesome! It is really helpful.

I have one last question, you mentioned that Scripts can be scheduled hourly, daily or weekly, but since I want to increase the budget every two days, I might have to schedule it to run daily and track the last increase date in a google sheet and write a script to calculate if two days had passed since then. Could you explain a little what you mean by this last part? Would I need two Scripts?

Thanks!!

KGuiste1

unread,
Apr 14, 2021, 5:17:01 PM4/14/21
to Google Ads Scripts Forum
The same script that is monitoring the ROAS and adjusting the budget will also read and update the last budget update date from a google sheet.

Google Ads Scripts Forum Advisor

unread,
Apr 15, 2021, 1:00:29 AM4/15/21
to adwords...@googlegroups.com
Hi Vanessa,

Thanks for raising this to us. Harry here, from the Google Ads Scripts Team.

The solutions provided by the user KGuiste1, are very much correct and to assist you further, here are more helpful links:
  • To retrieve entities at the Campaign level, you need to use a CampaignSelector and CampaignIterator.
  • Then use the getBudget method to retrieve the Budget entity of a Campaign.
  • To update the budget amount, use the setAmount method.
  • For script examples, check this link for Budgets and this link for Campaigns.
  • Please see this article on how you can calculate your ROI from your ads and free product listings.
  • As mentioned, you may update your budget in a 2 day interval by having a Google Sheet to reference by the script. You would have to compare dates (last date when the budget was changed and the date today) as the script will be executed daily.
Let us know if you need further assistance in implementing the script. If you would like to use Automated Rules, you may reach out to our Google Ads Product Team instead for better assistance through this link.


Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2FYWRf:ref
Reply all
Reply to author
Forward
0 new messages