Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Created May 8, 2015 14:59
Show Gist options
  • Select an option

  • Save chipoglesby/4f7f4550d7c54dbe644d to your computer and use it in GitHub Desktop.

Select an option

Save chipoglesby/4f7f4550d7c54dbe644d to your computer and use it in GitHub Desktop.
Google Adwords MCC script will run on the MCC level and log cost for given date range
var dateRange = "THIS_MONTH";
function main() {
MccApp.accounts().withCondition("Cost > 1.00").forDateRange(dateRange).withLimit(50).executeInParallel('runOnEachAccount');
}
function runOnEachAccount() {
var stats = AdWordsApp.currentAccount().getStatsFor(dateRange);
var impressions = stats.getImpressions();
var clicks = stats.getClicks();
var cost = stats.getCost();
var name = AdWordsApp.currentAccount().getName();
var customerId = AdWordsApp.currentAccount().getCustomerId();
var query = [name, cost].join(' ');
Logger.log(query);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment