Creating campaign with Bulk Upload

90 views
Skip to first unread message

Thao Pham

unread,
Sep 8, 2020, 11:33:15 AM9/8/20
to Google Ads Scripts Forum
I am using Bulk Upload to create new campaigns using scripts. 
How do I do the following:
- Specify a shared budget for the newly created campaign (instead of the separate daily budget)
- Specify a bidding portfolio for that campaign (instead of a campaign level bidding strategy)

Thank you,

Google Ads Scripts Forum Advisor

unread,
Sep 8, 2020, 4:15:30 PM9/8/20
to adwords...@googlegroups.com
Hi Thao,

Thank you for reaching out. However, the use of shared library items such as shared budgets and portfolio bid strategies is not currently supported with bulk uploads at the moment. I will forward this request to our team.

Regards,
Matt
Google Ads Scripts Team

 

ref:_00D1U1174p._5004Q24Zh1W:ref

Thao Pham

unread,
Sep 8, 2020, 11:45:56 PM9/8/20
to Google Ads Scripts Forum
In that case, can I ask whether I can change a campaign's individual budget to an existing shared budget with Google Script?
Eg. I already have an existing shared budget of $1000 for all campaigns in the account. And there was a new account created with its own budget (doesn't matter how much), now I want to add that campaign to the existing shared budget together with other previous campaigns. Can I do that? 
Similar question with the bidding portfolio. Can I use script to change a campaign from manual bidding to assign to an existing bidding portfolio?

Google Ads Scripts Forum Advisor

unread,
Sep 9, 2020, 2:12:05 AM9/9/20
to adwords...@googlegroups.com
Hi Thao,

Thanks for providing further details.

I am afraid that it is currently not possible to associate shared budget to the campaigns using Google Ads scripts. What is currently possible is to only update the attributes of existing shared budgets such as budget amount using AdsApp.​Budget.

That said, allow me to bring this is up with the rest of the team; however, there is no guarantee if this will be supported soon in the Google Ads Scripts. In the meantime, please follow our blog for updates and new releases.

As for associating portfolio bidding strategy to campaigns, you can use this sample code and update the value inside the setStrategy() method with the name of portfolio bidding strategy that is existing in your Google Ads account.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q24Zh1W:ref

Thao Pham

unread,
Sep 9, 2020, 5:19:13 AM9/9/20
to Google Ads Scripts Forum
I tried to follow the instruction above (update the value inside   setStrategy() method with the string that represent name of portfolio bidding strategy ) but i got this error: 

Invalid argument: troas. Should be of type: Anonymous bidding strategy type  

("troas" is the name of the portfolio).
I checked the documentation, it seems the value cannot be a string but the actual bidding strategy that I have to access using BiddingStrategySelector . The problem is, I do not see a way to Select the bidding strategy using the name with withCondition() 
There's also a choice to select bidding strategy with withIds() However I don't even know where to find the IDs for my bidding strategy??? :( I'm stuck right now. 

Google Ads Scripts Forum Advisor

unread,
Sep 9, 2020, 6:36:05 AM9/9/20
to adwords...@googlegroups.com
Hi Thao,

Technically, you can filter the withCondition() of BiddingStrategySelector by name. For your convenience, you may try to use the script below that will retrieve bidding strategy by name and set bidding strategy object to setStrategy() method.

Let me know how it goes after trying the provided suggestion.
 
function main() {
  
  var bidObj;
  
  var biddingStrategies = AdsApp.biddingStrategies().withCondition("Name='NAME_OF_PORTFOLIO'").get();
  while (biddingStrategies.hasNext()) {
    bidObj = biddingStrategies.next();
  }
  
  
 var campaignSelector = AdsApp
     .campaigns()
     .withCondition("Name = 'CAMPAIGN_NAME'")
 
 var campaignIterator = campaignSelector.get();
 while (campaignIterator.hasNext()) {
   var campaign = campaignIterator.next();
   campaign.bidding().setStrategy(bidObj);
   
 }
}

Thao Pham

unread,
Sep 9, 2020, 6:50:10 AM9/9/20
to Google Ads Scripts Forum

Thank you this seems to work now! The documentation for  withCondition() of BiddingStrategySelector did not mention Name so I didn't know it was possible. Maybe you guys should check that :) 
Thank you!
Reply all
Reply to author
Forward
0 new messages