I'm trying to make the script that it reads from a Google Sheets and pauses campaigns that we input in that sheet.
This is the code provided in the developers documentation, I just added the spreadsheeturl in const spreadSheet = SpreadsheetApp.openByUrlthe. If I put the spreadsheetURL in the first line it throws an error already.
If I run the code as it is it throws this error:
InputError: Unrecognized function name "main"
at l (adsapp_compiled:379:11)
at Object.<anonymous> (adsapp_compiled:18977:13)
This is the code I'm running. I tried including only the required columns provided in the campaign template, as well as using the full template and only filling in the data for the corresponding columns
function bulkUploadFromGoogleSpreadsheet(spreasheetURL) {
// The format of this spreadsheet should match a valid bulk upload template.
// See
https://developers.google.com/google-ads/scripts/docs/features/bulk-upload // for the list of supported bulk upload templates.
const spreadSheet = SpreadsheetApp.openByUrl('
https://docs.google.com/spreadsheets/d/1eIGM6uGmisyjO9DNAaQJJ52ZQwq9d1ubd4uK2k0U9c8/edit#gid=485045791');
const sheet = spreadSheet.getActiveSheet();
const upload = AdsApp.bulkUploads().newFileUpload(sheet);
upload.forCampaignManagement();
// Use upload.apply() to make changes without previewing.
upload.preview();
}