Flexible budgets script customization

151 views
Skip to first unread message

David Rojas

unread,
May 17, 2017, 4:25:44 PM5/17/17
to AdWords Scripts Forum
Hi,

I have been trying to modify this script adapting it to requirements in my work for a while, so I have two punctual questions:

1. Is there some way to adjust the daily budgets depending on the historical consumption of the campaigns?

2. Can I modify the script to show which campaigns are limited by budget, paused or enabled on the spreadsheet?


Thanks

David.

Vincent Racaza (AdWords Scripts Team)

unread,
May 18, 2017, 3:40:17 AM5/18/17
to AdWords Scripts Forum
Hi David,

Please see answers below to your questions:

1. Is there some way to adjust the daily budgets depending on the historical consumption of the campaigns?
Currently, the Flexible Budgets script does not depend on historical consumption of the campaigns. You will be the one to set the total budget, the start and end dates, and the script will be the one to distribute the budget daily depending on your cost every single day.

2. Can I modify the script to show which campaigns are limited by budget, paused or enabled on the spreadsheet?
Status of limited by budget is currently not supported in AdWords Scripts. For paused or enabled campaigns, you can add this as a condition in the script:

 function setNewBudget(budgetFunction, campaignName, totalBudget, start, end) {
   
var today = new Date();
   
if (today < start) {
     
Logger.log('Not ready to set budget yet');
     
return;
   
}
   
var campaign = AdWordsApp.campaigns().
        withCondition('Status = PAUSED').
        withCondition('CampaignName = "' + campaignName + '"').
       
get().
       
next();

Thanks,
Vincent Racaza
AdWords Scripts Team

David Rojas

unread,
Jun 28, 2017, 12:36:13 PM6/28/17
to AdWords Scripts Forum on behalf of Vincent Racaza (AdWords Scripts Team)
Hi, Vincent.

Sorry for the late answer but I have not been in the office so I reply your email until now.

The first question that I made is because I have several campaigns whose weekly budget behavior is different each other, so I wanted to assign more money if is needed and less when the daily budget was too much,  always depending on the historical data but I would like to do this in an automatic way instead manually.
(for example, increase the established daily budget 10% when the campaign consumes more money or have more clicks and decrease the daily budget 10% in the days when the budget is not consumed at all.)

The other problem I have, is the necessity to pause the campaigns in the platform when the script shows "Budget already finished", how I can do that?

Thank you.



--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/SrnoY5Jhv5Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scripts+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/dad2bc98-f483-442d-9618-714f13da9b94%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vincent Racaza (AdWords Scripts Team)

unread,
Jun 29, 2017, 2:22:20 AM6/29/17
to AdWords Scripts Forum
Hi David,

For your first concern, unfortunately, the Flexible Budgets solution script would just distribute the budget daily depending on your cost everyday. It does not have control over how the budget is consumed. That said, it would be difficult to customize this solution script based on your case as this is a huge modification. However, you can create a simple script which would cater your use cases. You can add conditions in your script based on your requirements and use the setAmount() function in setting a campaign's budget.

For your second concern, I can see the "Budget already finished" being logged in the MCC version of the Flexible Budgets solution script. You can pause the campaign after that line in the script:

if (today > endDate) {
      resultCell
.setValue('Budget already finished');
     
campaign.pause();
     
continue;
}

Let me know if you have further clarifications.
Reply all
Reply to author
Forward
0 new messages