AdWordsApp

Adwords Scripts give us a handy top level object called AdWordsApp.

We can use this script to access any part of our AdWords account. We can run queries, we can get account data. We can pull out anything we need from the core AdWords system.

Check out the documentation here:

https://developers.google.com/adwords/scripts/docs/reference/adwordsapp

Let's access our account data:

function main() {
getAverageCpc();
}
function getAverageCpc() {
var currentAccount = AdWordsApp.currentAccount();
var stats = currentAccount.getStatsFor('LAST_MONTH');
Logger.log(stats.getAverageCpc())
}

Exercise

Modify the above script to get the average click through rate for the account.

Try and output a nice report for the account.

Do you like Email? Do You Like JavaScript?

Sign up for occasional emails covering modern Web Development topics such as Angular 2 and React. You can unsubscribe at any time.

We totally respect your email privacy

comments powered by Disqus