Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

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

Select an option

Save chipoglesby/4bb87c0a0cd530892012 to your computer and use it in GitHub Desktop.
Cost Checker - This MCC script will log the Client's Name and Cost
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();
Logger.log('Starting on: '+name+' Cost: '+cost);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment