Created
May 8, 2015 14:59
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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