Google Adwords Bulk Upload Script

386 views
Skip to first unread message

Niral

unread,
Jan 3, 2018, 5:44:43 AM1/3/18
to AdWords Scripts Forum

function bulkUploadFromGoogleDrive() {
// See https://developers.google.com/adwords/scripts/docs/features/bulk-upload
// for the list of supported bulk upload templates.
// You can upload a CSV file, or an EXCEL sheet.
var file = DriveApp.getFilesByName('testad2.csv').next();
var upload = AdWordsApp.bulkUploads().newFileUpload(file);
upload.forCampaignManagement();

// Use upload.apply() to make changes without previewing.
upload.preview();
}

 

The column headings we have in that sheet are: Ad group, Ad Group ID, Ad group state. It does not seem to make the necessary changes. Can someone provide an example sheet we should be using to update the adgroup status and what column headings are required? According to the documentation it should update with only those two columns or am I incorrect? 


I have even tried importing using the column headings from an exported adgroup. The script executes but makes no changes. The same csv makes changes when imported manually. 

 

Thanks for you help/ 

Anthony Madrigal

unread,
Jan 3, 2018, 3:11:37 PM1/3/18
to AdWords Scripts Forum
Hi Niral,

After executing a script with a bulk upload, you should see the changes in the Bulk operations -> Bulk upload section. From there you can preview and approve the changes.

Also note, that you should call the function bulkUploadFromGoogleDrive inside your main function.

If you are still not seeing results, please reply privately to author your CID and script name so I can take a look.

Thanks,
Anthony
AdWords Scripts Team

Niral

unread,
Jan 3, 2018, 4:11:45 PM1/3/18
to AdWords Scripts Forum
Hi Anthony,

Thank you for your reply. I am very new to scripting and am learning. Sorry to ask the obvious but could you give an example of:

calling the function Inside your main function

Thanks,

Anthony Madrigal

unread,
Jan 3, 2018, 4:40:29 PM1/3/18
to AdWords Scripts Forum
Hi Niral,

Sure, no problem. This is a common issue that many new users face. 
function main(){
bulkUploadFromGoogleDrive
();


}
function bulkUploadFromGoogleDrive() {
// See https://developers.google.com/adwords/scripts/docs/features/bulk-upload
// for the list of supported bulk upload templates.
// You can upload a CSV file, or an EXCEL sheet.
var file = DriveApp.getFilesByName('testad2.csv').next();
var upload = AdWordsApp.bulkUploads().newFileUpload(file);
upload
.forCampaignManagement();

// Use upload.apply() to make changes without previewing.
upload
.preview();
}

Cheers,
Anthony
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages