Missing the toal details from adgroup report

18 views
Skip to first unread message

Yaniv Lev-Ari

unread,
Mar 10, 2014, 7:13:36 AM3/10/14
to adwords...@googlegroups.com
Hi,

I created a script that will send a daily adgroup report including conversions to my client's email

I found a script that take the adgroup report and put the details in Google Doc, and I edited the script to fetch the relevant details for me.

my problem is,

the script only give me the details about each adgroup,
but missing the total details - total clicks, total impressions and the total conversions
from the original report.

What do I need to do, to include it?

thanks, 
In advance

/**************************************
* Store Account Performance Report in a Google Doc
* Version 1.1
* Changelog v1.1 - Removed apiVersion, Removed get spreadsheet
* Created By: Russ Savage
* FreeAdWordsScripts.com
**************************************/
function main() {
  var spreadsheet_url = "MY GOOGLE DOC LINK";
  var date_range = 'YESTERDAY';
  var columns = ['Date',
'CampaignName',
'AdGroupName',
  'Clicks',
                            'Impressions',
                            'Ctr',
                            'AverageCpc',
                            'Cost',
                            'AveragePosition',
                           'ConversionsManyPerClick',
                           'ConversionRateManyPerClick',
                          'CostPerConversionManyPerClick',
                 'ViewThroughConversions',
                 'TotalCost',

                ];
  var columns_str = columns.join(',') + " ";
   
  var sheet = SpreadsheetApp.openByUrl(spreadsheet_url).getActiveSheet();
  if(sheet.getRange('A1:A1').getValues()[0][0] == "") {
    sheet.clear();
    sheet.appendRow(columns);
  }
   
  
  var report_iter = AdWordsApp.report(
    'SELECT ' + columns_str +
    'FROM  ADGROUP_PERFORMANCE_REPORT ' +
    'where CampaignStatus = ACTIVE and AdGroupStatus = ENABLED ' +
    'DURING ' +date_range).rows();
   
  while(report_iter.hasNext()) {
    var row = report_iter.next();
    var row_array = [];
    for(var i in columns) {
       row_array.push(row[columns[i]]);
    }
    sheet.appendRow(row_array); 
  }
}

Anash Oommen

unread,
Mar 11, 2014, 2:55:45 PM3/11/14
to adwords...@googlegroups.com
Hi Yaniv,

You'd need to calculate them yourself, these rows aren't available through Scripts right now.

Cheers,
Anash P. Oommen,
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages