5.3K members online now
5.3K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me

executeInParallel question

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭


I've created a geo performance report for all of my accounts and am trying to make it faster by using the executeInParallel method. However, my use of executeInParallel has only made the script run slower. Any suggestions on how to improve the script? Additionally, is there any way to incorporate SQL language such as "case when" into AWQL? The current script spits out a large number of cells and I'd like to lessen that. Thanks!


var SPREADSHEET_URL = URL; //url hidden for security purposes
 var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
 var sheet = spreadsheet.getSheetByName("Geo_Performance_Report")
 var ACCOUNTS = []
function main() 
  //get accounts and data respectively
  var accountSelector = MccApp.accounts();
  if (ACCOUNTS.length > 0) {
    accountSelector = accountSelector.withIds(ACCOUNTS);

  var accountIterator = accountSelector.get();

  while (accountIterator.hasNext()) {
    var account =;
    Logger.log('Done processing %s', account.getCustomerId());

function Dashboard(account) {;
    var report =' SELECT AccountDescriptiveName, Date, CountryCriteriaId , CampaignName, RegionCriteriaId, MetroCriteriaId, CityCriteriaId, Impressions, Clicks, Cost' +
                                   ' FROM GEO_PERFORMANCE_REPORT' +
                                   ' WHERE Cost > 0' +
                                   ' DURING YESTERDAY');
    var rows = report.rows();
  while (rows.hasNext()){
    var row =;
    sheet.appendRow([row['AccountDescriptiveName'], row['Date'], row['CountryCriteriaId'], row['CampaignName'], row['RegionCriteriaId'], row['MetroCriteriaId'], row['CityCriteriaId'], row['Impressions'], row['Clicks'], row['Cost']]);


1 Expert replyverified_user
Marked as Best Answer.
Accepted by topic author Edward D
September 2016

executeInParallel question

Top Contributor
# 2
Top Contributor



There's a dedicated AdWords script related forum, where you might be interested in posting this technical query:-!forum/adwords-scripts