Set Target-CPA for campaign level

777 views
Skip to first unread message

Itay Meir

unread,
Dec 28, 2020, 2:40:41 PM12/28/20
to Google Ads Scripts Forum
Hello,

We have display ad groups which are managed with campaign level Target-CPA.
Is it possible to change Target-CPA for campaign level?
I've only managed to find how to change ad group level Target-CPA..

Thanks in advance!
Itay

Google Ads Scripts Forum Advisor

unread,
Dec 28, 2020, 9:17:09 PM12/28/20
to adwords...@googlegroups.com

Hi Itay,

Thank you for reaching out to us.

When you say "change Target-CPA", are you referring the Target-CPA as a BiddingStrategy? If yes, then you can simply update the campaign bidding strategy using the setStrategy(biddingStrategy) method.

However, if you're referring to update the Target CPA bid in the campaign level, then I'm afraid that this is only possible in the UI and not via Google Ads scripts. Updating the Target CPA bid via scripts is only available in the Adgroup level using the setCpa(cpa) method.

Hope this helps.

Regards,

Google Logo
Mark Kevin Albios
Google Ads Scripts Team
 

 

ref:_00D1U1174p._5004Q2AFZ39:ref

Daniel Zrust

unread,
Mar 28, 2021, 4:25:21 PM3/28/21
to Google Ads Scripts Forum
Campaign Level CPAs are possible to change via "bulk uploads" via scripts. 

I have a working script which I use.

tCPAs are loaded from a Google Sheet and pushed to Google Ads as a bulk upload.

DZ

Bob Parker

unread,
Apr 6, 2021, 1:42:33 PM4/6/21
to Google Ads Scripts Forum
Can you please post a sample?

Daniel Zrust

unread,
Apr 6, 2021, 1:48:58 PM4/6/21
to Google Ads Scripts Forum
Sorry,  I can't show it outright as I wrote this script for a customer who actually paid for it.

I can give you a hint though...

Setup a Google Sheet with these columns:
campaign | target CPA

Load the sheet with the script. 

Then use this key part in the script:
      var upload = AdsApp.bulkUploads().newFileUpload(tempSheet);
      upload.forCampaignManagement();

      //and push it to the account
      upload.apply()


DZ

Bob Parker

unread,
Apr 6, 2021, 1:55:54 PM4/6/21
to Google Ads Scripts Forum
I understand. I don't want the script. I wanted the fields used.


Here is my code:
var csv = AdsApp.bulkUploads().newCsvUpload(columns, {moneyInMicros: false});
for (var i = 0; i < campaignsData.length; i++) {
var name = campaignsData[i].name;
var campaignName = `Auto - ${name}`;
if (!!AdsApp.campaigns().withCondition(`Name = '${campaignName}'`).get().totalNumEntities()) {
Logger.log(`Campaign with name '${campaignName}' already exists.`);
} else {
Logger.log(`Creating campaign: '${campaignName}'.`);

const row = {
'Campaign': campaignName,
'Currency code': 'CAD',
'Budget': campaignsData[i].budget,
'Budget Type': 'Daily',
'Bid strategy type': campaignsData[i].bidStrategyType,
'Campaign type': campaignType,
'Campaign subtype': campaignSubType,
};

if (campaignsData[i].bidStrategyType == 'Target CPA') {
row['Target CPA'] = campaignsData[i].cpa;
}

csv.append(row);
}
}

csv.forCampaignManagement();
csv.apply();


The code above works for Manual CPA,

Daniel Zrust

unread,
Apr 6, 2021, 3:53:37 PM4/6/21
to Google Ads Scripts Forum
Okay I see you have a different approach... Is there any problem with it?

The code looks solid.

DZ

Bob Parker

unread,
Apr 9, 2021, 9:52:05 AM4/9/21
to Google Ads Scripts Forum
I found out the problem. the columns variable did not have 'Target CPA'.

Google Ads Scripts Forum Advisor

unread,
Apr 12, 2021, 12:47:24 AM4/12/21
to adwords...@googlegroups.com
Hi Bob,

Harry here, is there anything more that I can assist you with regard to your script? If yes, kindly provide more context and the script's name and your Google Ads account CID so that I can check this on our end and assist you further. You may send them here or privately via the reply to author option. Note that you may need to join the Google Group for you to use this option.
 
If this option is not available at your end still, you may send it through our email (googleadsscr...@google.com) instead.


Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


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