How To Create An Automatic Monthly Google Ads Pacing Sheet

In this video tutorial, you will learn how to create a monthly Google ads budget pacing sheet that connects to your MCC account and updates automatically

Preparing Google Sheet

First, make a copy of the Monthly Budget Pacing Sheet.

Adding the Script to Google ads

Copy and paste this code into you MCC Google ads account.

 

				
					function main() {

  // Select the accounts to be processed (all of them).
  var accountIterator = MccApp.accounts()
  .get();

  // Set the Spreadsheet that you want to add data to.
  var SPREADSHEET_ID = 'Paste your ID here';
  var SHEET_NAME = 'Monthly Spend';

  // Open sheet in spreadsheet
  var ss = SpreadsheetApp.openById(SPREADSHEET_ID);
  var sheet = ss.getSheetByName(SHEET_NAME);

  // Clear yesterdays contents
  sheet.clearContents();

  // Add heading rows
  sheet.appendRow(['Name', 'Account ID', 'Cost']);

  // First we take the accountIterator variable from before
  while (accountIterator.hasNext()) {
    // And, for each account, we save the data into another variable
    var account = accountIterator.next();
    // Switch to the account you want to process.
    MccApp.select(account);
    // Now we can do something
    // Generate account level query
    var report = AdWordsApp.report(
      'SELECT ExternalCustomerId, Clicks, Impressions, Cost, Ctr ' +
      'FROM ACCOUNT_PERFORMANCE_REPORT ' +
      'DURING THIS_MONTH');
    // Get the results and save them into a variable
    var rows = report.rows();
    while (rows.hasNext()) {
      var row = rows.next();
      var cost = row['Cost'];
      var id = row['ExternalCustomerId'];
    }

    Logger.log(account.getName() + ", " + id + ", :" + cost);
    sheet.appendRow([account.getName(), id, cost]);
  }



  Logger.log(ss.getName());

}
				
			

Customizing the Template

Add a budget for each account, & you’re all set.

Table of Contents

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *