AdWords Scripts can simplify your daily work.

Add the word “scripts” into a conversation with someone who isn’t aware of code and they’re going to think you’re casting them in a play and look at you strangely.

Mention “scripts” to people who are aware of code but aren’t coders and they’re going to look at you strangely and probably start looking for the nearest exit.

But scripts can be incredibly useful if you’re running an AdWords account.  I’d really encourage you to give this a go.  It’s a step by step guide to setting up your first adwords script.  A way to get an overview of your AdWords campaigns in one simple spreadsheet.

Lets start simple.  The first step is to find out where to put a script – if you had one you wanted to use.

The AdWords script editor lives under the  “Bulk Operations” on the Adwords Dashboard:

When you click the “+ script” button you get the script editor, where, if you’re familiar with JavaScript, it’s quite easy to code.

If you’re not familiar, you might be a little intimidated, but really all you’re going to do is just a bit of copy and paste.

You need to Authorize the script before you can start doing anything as complex as coding or cutting and pasting!.  And you’ll want to look at some examples of scripts to use, and they’re easy enough to find in the “show examples”.

When you see the examples, select Reports from the drop down menus on the left and we’re going to build a campaign performance report.  Which is all the funky stuff on the left.

Looking a little closer you can see the metrics we want.  And really all we care about is the values!

Looking at the values highlighted above, this AdWords script is going to give use a spreadsheet (which you’ll find in your google drive) with the following fields:

  1. Campaign Name
  2. Clicks
  3. Impressions
  4. Cost

Just enough to give a decent overview.  But if you’re feeling lucky, feel free to change the conditions – in this script below, I’ve made it so that it will show me campaigns with impressions greater than 20 over the past 30 days.

function main() {

   var spreadsheet = SpreadsheetApp.create(‘Campaign Report’);

   var report =   AdWordsApp.report(

   ‘SELECT CampaignName, Clicks, Impressions, Cost ‘ +

   ‘FROM   CAMPAIGN_PERFORMANCE_REPORT ‘ +

   ‘WHERE  Impressions > 20 ‘ +

   ‘DURING LAST_30_DAYS’);

    report.exportToSheet(spreadsheet.getActiveSheet());

}

Feel free to cut and paste starting with the word “function” and ending with the curly close bracket “}” and insert it into the script editor. If you hit “Run Script Now”, and check your Google Drive in a 60 seconds or less – you should have a spread sheet in there called “Campaign Report” that looks like this:

A simple overview of your campaign performance over the past 30 days!

Feel free to stop reading here – but if this was easy for you and you want more…

Now let’s go about modifying your first script:

  1. You’ll need to get familiar with the Google Developer Site: https://developers.google.com/adwords/scripts/

Feel free to look at the Campaign Performance Report, the same report above:

https://developers.google.com/adwords/api/docs/appendix/reports

And it’s where I found the campaign performance report.  I’ll click on that – but I want to add a Click Through Rate on my report.

So I’ll search on the right for each to find out the category I’m looking for.  It’s the technical name (on the left) that I’ll insert into the script.

So your Script will look like this: (make sure your case sensitive here)

function main() {

   var spreadsheet = SpreadsheetApp.create(‘Campaign Report’);

   var report =   AdWordsApp.report(

   ‘SELECT CampaignName, Clicks, Impressions, Ctr, Cost ‘ +

   ‘FROM   CAMPAIGN_PERFORMANCE_REPORT ‘ +

   ‘WHERE  Impressions > 20 ‘ +

   ‘DURING LAST_30_DAYS’);

    report.exportToSheet(spreadsheet.getActiveSheet());

}

If you run the above script – you’ll have click through rate added to your output!

You can schedule these so they happen each week and you can get a quick health check emailed to you.  Much easier than diving into the AdWords interface! If you want more on how to apply an AdWords script – there’s a whole section in PPCSavvy our training forum