This e-mail and any attachment contains information which is private and confidential and is intended for the addressee only. If you are not an addressee, you are not authorized to read, copy or use the e-mail or any attachment. If you have received this e-mail in error, please notify the sender by return e-mail and then destroy it.
El presente documento electrónico y cualquier anexo al mismo, contiene información confidencial y exclusiva para el destinatario. Si usted no es el destinatario, no está autorizado a leer este documento, a copiarlo o usar el presente y sus anexos o bien si usted ha recibido este documento electrónico por error, favor de notificar al remitente por este mismo conducto y proceda a eliminar de cualquier archivo este documento electrónico
function main() {
// Upload spreadsheets for 3 specific accounts and send one email when it's all done.
var accounts = MccApp.accounts()
.withIds([123,456,789]);
accounts.executeInParallel('upload','email');
}
/**
* Uploads a spreadsheet for an individual account. Assumes spreadsheets are saved
* as "123456.csv" where 123456 is the id of the account.
*/
function upload() {
var account = AdWordsApp.currentAccount();
var spreadsheet = DriveApp.getFilesByName(account.getId() + '.csv').next();
var upload = AdWordsApp.bulkUploads().newFileUpload(spreadsheet);
upload.forCampaignManagement();
upload.preview();
}
/**
* This is an optional callback method that could be used to send an email
* once the script has completely finished.
*/
function email(results) {
var numSuccessful = 0;
var numFailed = 0;
for (var i = 0; i < results.length; i++) {
var status = results[i].getStatus();
if (status == 'OK') {
numSuccessful++;
} else {
numFailed++;
}
}
MailApp.sendEmail('us...@example.com','uploads from script complete','Successfully uploaded ' + numSuccessful + ' spreadsheets and failed to upload ' + numFailed + ' spreadsheets.');
}