var bulker = AdsApp.bulkUploads().newCsvUpload([
'Action',
'Campaign',
'Ad group', 'Ad group state', 'Bid strategy type', 'Target CPA',
], { moneyInMicros: false });
bulker.append(
{"Action":"set","Campaign":"c1","Ad group":"a1","Target CPA":Math.random(),"Bid strategy type":"Target CPA"}
)
bulker.apply()
var bulker = AdsApp.bulkUploads().newCsvUpload([
'Action',
'Campaign',
'Ad group', 'Ad group state', 'Bid strategy type', 'Max. CPA (converted clicks)',
], { moneyInMicros: false });
bulker.append(
{"Action":"set","Campaign":"c1","Ad group":"a1","Target CPA":Math.random(),"Bid strategy type":"Max. CPA (converted clicks)"}
)
bulker.apply()
function main() { // Works on campaign level (note that Target CPA is undocumented @ https://developers.google.com/google-ads/scripts/docs/features/bulk-upload-entities) Bulk("Campaign level Target CPA working",{ "Action": "set", "Campaign":"some campaign",
"Bid strategy type":"Target CPA",
"Target CPA": 1.23 }) // Prints success in bulk upload but is a NOP and doesn't change the target cpa on the adgroup Bulk("Succeeds but does nothing", { "Action": "set", "Campaign":"some campaign", "Ad group":"some adgroup",
"Bid strategy type":"Target CPA",
"Max. CPA (converted clicks)":Math.random() // to ensure we always get a "new" CPA value which should trigger an update }) // Trying to use "Target CPA" field with "Ad group" set fails with: // Unable to determine the entity-type of this row. Make sure to only provide fields for columns that are appropriate for the entity. Bulk("Fails with unable to determine", { "Action": "set", "Campaign":"some campaign", "Ad group":"some adgroup",
"Bid strategy type":"Target CPA",
"Target CPA":Math.random() // to ensure we always get a "new" CPA value which should trigger an update }) }
function Bulk(name, data){ var bulker = AdsApp.bulkUploads().newCsvUpload(Object.keys(data), { moneyInMicros: false }); Logger.log(data) bulker.setFileName(name) bulker.append(data) bulker.apply();}
Hi Mikael,
Thanks for your patience on this. I'm afraid that there is currently no update on this. However, I've already made a follow up with the team.
As an aside, have you tried the workaround mentioned by my colleague (Peter) on the previous response?
"Usually the right way to ensure the correct formatting of a bulk upload is actually to perform a download from the UI to see what columns you can get and what they're called. Modifying values from the downloaded report and then re-uploading it should generally result in a correctly formatted bulk upload."
Regards,
|
||||||
Hi Mikael,
Thanks for getting back to us.
Allow me to relay your message with the team. We'll be updating this thread for any feedbacks available.
Regards,
Hi Mikael,
I am Harry from the Google Ads Scripts Team. I am writing to inform you that bulk uploading Target CPA for Ad Groups should be working as expected by now. Let me know if there are still issues.
Thanks,
|
||||||
Hi Mikael,
Thanks for getting back. You can check out the code snippets on this link regarding the Bulk Upload function via Google Ads Scripts. Let me know if you have other concerns.
Hi Mikael,
I'll pass this on to the rest of the team for consideration and get back to you once I have any updates regarding your request. Please be informed that there is no guarantee that this will be added to the Google Ads Scripts documentation anytime soon.