Follow these instructions to get going with AdWords scripts in under a minute.
Navigate to "Bulk operations" → "Scripts" in the AdWords web application.
Click "Create script".
Copy and paste the following code into the editor area:
function main() { var keywords = AdWordsApp.keywords() .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } }
Authorize the script. Don't worry, this only has to be done once per script.
Hit "Preview" and wait a bit for the results to appear.
Follow these instructions to get going with MCC scripts in under a minute.
Navigate to "My Client Center" → "Scripts" in the AdWords web application.
Click "Create script".
Copy and paste the following code into the editor area:
function main() { // Retrieve all the child accounts. var accountIterator = MccApp.accounts().get(); // Iterate through the account list. while (accountIterator.hasNext()) { var account = accountIterator.next(); // Get stats for the child account. var stats = account.getStatsFor("THIS_MONTH"); // And log it. Logger.log("%s,%s,%s,%s", account.getCustomerId(), stats.getClicks(), stats.getImpressions(), stats.getCost()); } }
Authorize the script. Don't worry, this only has to be done once per script.
Hit "Preview" and wait a bit for the results to appear.
Perhaps not the most useful of scripts out there, but it's a start! Explore our code snippets and examples for further inspiration.