MCC level script of tracking Quality Score?

316 views
Skip to first unread message

Ryan Burt

unread,
Mar 3, 2016, 7:18:14 PM3/3/16
to AdWords Scripts Forum
Hello -

I found a script online a while back that you load into an individual account and it will log your account level weighted average quality score.  It works great, but I want to  modify the script to run at the MCC level across all my clients.  I am not a coder so any help would be appreciated. Happy to share the script, I believe it was posted for free by frederick vallaeys.

Ryan

Tyler Sidell (AdWords Scripts Team)

unread,
Mar 4, 2016, 9:08:47 AM3/4/16
to AdWords Scripts Forum
Hi Ryan,

I would suggest looking at our documentation pertaining to updating multiple accounts in a series.  It would also be helpful to read the additional MCC examples.  These examples show how to work on different account from the MCC level.

Thanks,
Tyler Sidell
AdWords Scripts Team

Roel

unread,
Aug 1, 2016, 12:33:49 PM8/1/16
to AdWords Scripts Forum
Did you get it to work already?

Op vrijdag 4 maart 2016 01:18:14 UTC+1 schreef Ryan Burt:

Tyler Sidell (AdWords Scripts Team)

unread,
Aug 1, 2016, 3:25:25 PM8/1/16
to AdWords Scripts Forum
Hi Roel,

Quality Score is available through either the Keyword or the Criteria report.  To run these types of reports on a MCC level you could start with the following:
function main() {
 
var today = new Date();
 
var beginDate = "20140101";
 
var endDate = formatDate(today);

 
var accountIterator = MccApp.accounts().get();


 
var spreadsheet = SpreadsheetApp.openById("SPREADSHEET_ID");


 
var mccAccount = AdWordsApp.currentAccount();
 
var i=0;
 
while (accountIterator.hasNext()) {
   
var account = accountIterator.next();
   
// Switch to the account you want to process.
   
MccApp.select(account);


   
var report = AdWordsApp.report("Select AdGroupId, Criteria, QualityScore from KEYWORDS_PERFORMANCE_REPORT during " + beginDate + ", " + endDate);


   
var sheet = spreadsheet.getActiveSheet();
   
//Name sheet by account name
   
if(i == 0){
      spreadsheet
.renameActiveSheet("Report "+account.getName());
   
}
   
else if(i != 0 && !spreadsheet.getSheetByName("Report "+account.getName())){
      spreadsheet
.insertSheet("Report "+account.getName());
   
}
   
else if(i != 0 && spreadsheet.getSheetByName("Report "+account.getName())){
      spreadsheet
.setActiveSheet(spreadsheet.getSheets()[i]);
   
}
   
    report
.exportToSheet(spreadsheet.getActiveSheet());
    i
++;


   
var range = sheet.getRange("A2:G30");
    range
.sort(7);
 
}
}




function formatDate(dt) {
   
var day = dt.getDate();
    day
= (day > 9) ? day : "0" + day;
   
var month = dt.getMonth() + 1;
    month
= (month > 9) ? month : "0" + month;
   
var year = dt.getFullYear();
   
return "" + year + month + day;
}


Thanks,
Tyler Sidell
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages