Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using AdWords scripts

From: Advanced Google AdWords Tips and Tricks

Video: Using AdWords scripts

We've looked at how automated rules can help you Note that these are very different than the AdWords API which is And that leads us to our second big advantage of scripts.

Using AdWords scripts

We've looked at how automated rules can help you save time and take care of systematic and repeatable tasks. But you'll also find that those rules can take you only so far. When you've reached the limits of what rules can do, you're probably ready to graduate to AdWords scripts. In short, scripts provide a way to programmatically access and change AdWords data through JavaScript. Note that these are very different than the AdWords API which is extremely powerful but also fairly difficult to get access to these days. Scripts are available to everyone.

And they have quite a few benefits. First, they can be run against just about whatever schedule you can come up with right down to an hourly granularity. If you want to schedule one of these to run every third day of the month at 1 a.m., you can do that here. Or if you want to use a script to check your actual inventory every hour, pausing ads for products that you don't have in stock, you can do that too. And that leads us to our second big advantage of scripts. They can read from external data sources. We just mentioned pulling in inventory data to automate actions, but you can access any kind of data that you want through a URL fetch service, XML, or even data stored in Google Drive.

With the flexibility of JavaScript and external data, you can not only programmatically make decisions, you can programmatically act on those decisions. AdWords scripts let you read, write and change key words, bids, ads, ad groups, campaigns, targeting and even bid modifiers. And if you're not ready to actually take action, you can use AdWords scripts to send you emails with everything from notifications and alerts to recommendations that you can forward on to individuals that are working on the accounts.

Last, scripts can also be created and run at the MCC level. Meaning you can use them to manage multiple linked accounts. Putting all this together is pretty powerful and you can solve a wide range of problems. Generally, the things you'll do with scripts fall into a few categories. First, you can create tools to automate tasks. Things like sifting through search terms reports to add new keywords, or adding the same negative keywords from campaign to campaign, or account to account. Second, you can use scripts to drive highly customized reporting.

For example, you could use a script to bring very specific data into a Google spreadsheet that's already set up with very specific formats, graphs and visualizations based on that data set. Every time your script updates the data, you've got your custom report or dashboard refreshed and ready to go. Third, you can use scripts to alert you to problems that require your immediate attention. Things like, when ads stop running, or when your cost per acquisition gets too high. Or, you could write a script to send you an email when a particular ad group's conversion rate drops for three days in a row.

You can even write anomaly detection scripts that can alert you to abnormal behavior so you can go check things out. Last, AdWords scripts can be used to react to triggers. We've already seen things like pausing ads based on your inventory feed but you could get really creative here. If you're a travel agency selling trips to Hawaii, you might monitor weather feeds and up your bids in all the states where it's snowing and freezing cold. Those are people that probably want a trip to the tropics. Okay. By now, you probably agree that AdWords scripts have the potential to really help you out.

So let's walk through how we do it. First, you'll find scripts in the Bulk operations area of the left-hand menu. Here, you'll see a list of all the scripts you've got, and you can see we make good use of these at Cardinal Path. This is where you can edit existing scripts, run them on demand, or update the scheduling options for individual scripts. To create a new script, just click the red plus script button and you'll have a blank canvas where you can start your coding. And if your JavaScript is a little rusty, or you want to get some sample code snippets to get started, you can use the show examples button that will help you out with samples of common tasks that you can start from.

And of course, for a more complete code reference you can always click the link to the full documentation. Note that before you can preview or run a script, you'll have to authorize the script to access the account. This is a security measure. Since it's possible that these scripts will be running when you're not logged in, in those cases, AdWords needs to know that it's okay for it to do whatever the scripts are doing on your behalf. And previewing is important, since these scripts have the power to actually make changes to your account, you'll want to make sure they're working as intended before you let them loose.

A recommendation here is to start learning by creating some reporting related, or read-only scripts. This will ensure that you're not making unintentional bulk changes to your account. And when you get comfortable, you can move on by writing scripts that actually make things happen in your account. But before you do, a good best practice is to make a backup of your account, and that's something we'll talk about in the next chapter. Finally, we're going to look at a sample of an AdWord script that you can download from the link below, copy and paste it into your account, and start running.

As you already know, quality score is one of the most important things to focus on when managing and optimizing accounts. But it's also something that you can't get historical data on. What this script is doing is regularly grabbing quality score and click the rate data, continually appending it to a Google spreadsheet over time. Over in that sheet, you can see that we've created a simple graph that can show us how our quality score is trending over time and how it might be impacting our click-to rate. To use the script, just paste it into the window of a new script, create a blank Google spreadsheet, and replace the spreadsheet URL variable with your own spreadsheet's URL.

Then, you can start keeping a historical record of your quality store. Then you can modify and update this script to do whatever else you want it to do. A good next exercise might be for you to take this script and add a third column of data to see how your average position is being impacted over time. AdWords scripts are extremely powerful and when used properly, they can help you reach new levels of performance in your accounts while simplifying the manual management process. If you're already using scripts, then hopefully you've gotten a few ideas from this video. And if not hopefully you're already working on writing your first script.

Show transcript

This video is part of

Image for Advanced Google AdWords Tips and Tricks
Advanced Google AdWords Tips and Tricks

16 video lessons · 1951 viewers

David Booth


Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.

Mark all as unwatched Cancel


You have completed Advanced Google AdWords Tips and Tricks.

Return to your organization's learning portal to continue training, or close this page.

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?


Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.