Google Ads script Bulk upload fails with generic error

104 views
Skip to first unread message

Meghana Neelakanta

unread,
Apr 3, 2025, 12:30:13 PM4/3/25
to Google Ads Scripts Forum
Hi,
I am using google ads script to create a Video campaign of bid strategy "Target CPM".
I use bulk CSV upload code to programmatically create the Video campaign.

Sample csv values : 
{"Campaign":"NEW_BUMPER","Budget":"100.00","Bid Strategy type":"Target CPM","Campaign type":"Video","Campaign status":"PAUSED","Budget type":"Campaign Total","Campaign start date":"2025-04-03","Campaign end date":"2025-05-03","Networks":"YouTube videos"}

Code snippet to upload the csv values
function createCampaign(csvValues) {
try {
const csvMap = new Map(Object.entries(csvValues));
const columns = Array.from(csvMap.keys());
const upload = AdsApp.bulkUploads().newCsvUpload(columns);

upload.append(csvValues);
upload.forCampaignManagement();
upload.apply();
} catch (err) {
throw err
}
}

Error from the uploads tab : An error occurred. Please try again later.

Side note : 
I have been creating these campaigns programmatically successfully since last September. In the last two weeks I also started creating "Manual CPV" bid strategy type campaign for truview ads and since March 27th "Target CPM" campaigns are no longer getting created on the platform with the above error. Manual CPV is still working.

Could someone please let me know if this is due to some caching of allowed bid strategy types at the google ads level? How do I go about fixing this issue? 


Google Ads Scripts Forum Advisor

unread,
Apr 3, 2025, 5:32:36 PM4/3/25
to adwords...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads Scripts Support team.

Based on reviewing the script and the error, I would like to inform you that the line "upload.append(csvValues)" is causing the issue. As the csvValues are taken as a single value to append. In order to resolve this you can convert those to an array and use them. Refer to the below updated code. You can also refer to the bulk upload sample examples documentation for more information.
const rows = Array.from(csvMap.values());
upload.append(rows);
Feel free to get back in case of any further issues by providing us with the following details.
  • Google Ads account ID/CID
  • Name of the script
You can share the requested details via Reply privately to the author option or a direct private reply to this email. If you are not able to reply to author directly, you can send the requested details to our email address "googleadsscr...@google.com". 
 
Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-04-03 21:32:05Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vHF55:ref" (ADR-00298453)



Reply all
Reply to author
Forward
0 new messages