How to Make Time to Learn Coding Adwords Scripts

There are lots of excuses people make for not progressing in learning a new skill like coding; I’m not smart enough, it’s too hard, I can’t remember the concepts, I have different priorities now etc. But the ONE EXCUSE I hear the most frequent is…

“Dude, I’m already so busy managing a ton of accounts. I don’t have any time to learn how to write my own Adwords Scripts!”

Fair enough. You’ve got meetings to attend, reports to send out to clients, SKAG’s to create, bids to adjust, endless search term reports to analyse, ad copy to test…Business to take care of. And then there is friends, family, and a mountain of other responsibilities that have a monopoly on your time.  So how, amidst all those time-consuming responsibilities, do you find time to learn to write some awesome custom Adwords Scripts?

Easy. You make time. By using Adwords Scripts.

Sounds like a chicken and egg situation? Maybe not…

“Hundreds of hours are saved because I took some time to learn JavaScript and automate those tedious activities.” – quote from Reddit r/PCC

Here’s how you can do the same.

Step 1: Monitor your time spend.

From today on, monitor how much time you spend on every task, including browsing the web and scrolling Facebook timelines. Also make distinct log entries for the different tasks that make up Adwords account management, like ad copywriting, bid management, reporting, account structure optimizations, client communication etc. I recommend using some form of time tracking app for this. Toggle is a great tool and there are tons of free alternatives.

 

Step 2: Eliminate tasks that have poor ROI

The easiest way to get back huge chunks of time is to eliminate pointless activities from your daily working routines. I used to spend hours a day on social media and reading blog posts that did not translate into any actions. I also did a lot of pointless clicking in the Adwords interface. Just clicking around with no specific purpose other than to see what was going on. All this lead me to no action, no results. Nothing really improved. Not my accounts performance, not my relationship with my boss, not my skills, not my happiness. It was a complete waste of my time. Once i cut out social media, and only read blog posts that got me to actually do something i started to make my time useful and feel a sense of achievement every day. Learnings new skills made me feel much better than relaxing every day.

 

I urge you to look at your daily activities, including those Adwords related, and ask yourself “does this really make anything better?”. Does adding sitelinks to ad groups with near zero impressions really make sense? Does spending hours digging in search terms reports to find negative keyword candidates really cut down costs? Is a Quality Score of 7 really an issue for these keywords? Do you really apply any of the things you read at search engine land? What if you just read the 3 top posts once a week, instead of spending hours reading every post every day?

Remove all tasks that do not deliver significant results from your daily routine.

 

Step 3: Automate recurring Adwords tasks

Welcome to the art of bootstrapping. Let’s use scripts to free up some time to learn how to write your own scripts. Magic, right? Here’s how. You make a list of the Adwords management tasks that currently take up much time. Now go find a script that reduces the time you spend on these time-consuming actions. Just browse some of the many Adwords Scripts collections out there and I assure you, you will find some that can alleviate some of the tasks that currently take ages to complete.

NB: Try to think of a task that takes up a large chunk of your time every week. Next time you are scheduled to do the job, instead of going in and doing the task the way you normally would, go find an Adwords script to help you. If you are lucky you’ll find one that you can use straight out of the box and delivers an immediate “return on research time”. Example: if you spend 4 hours every week digging for negative keyword candidates in your Shopping campaigns, use this script. Finding, installing and running this script would maybe take you 2 hours. Running the script, using its output and finishing your job will take you 1 hour. Congrats! You just won 1 hour of time this week, next week you will win 3! That is 3 hours a week to spend on learning your new superpower.

 

Step 4: Dedicate freed-up-time to learning Adwords Scripts

Freed up time is of no use, unless you make it so. Start building the habits to succeed in learning to write your own Adwords Scripts. Spend 30min each day learning new Javascript skills. Codecademy is a great start for this. Then add an additional 30min each day to play around with some existing scripts and code snippets. Have some fun tinkering with the code. After a week or two of following this habit, learning Adwords Scripts has become part of your daily routine and you should be able to write your own small Adwords Scripts!

 

So, start monitoring, eliminating and automating your daily tasks today. Next week you’ll have an ocean of time to spend learning how to use the power of Adwords Scripts, and enjoy all the benefits.

 

BONUS TIP: During coffee breaks I like to browse some Adwords Scripts libraries, just to get a feel for what is possible. This way I learn about the use cases and I activate my brain to start thinking about the possibilities of automation for my own accounts. Why not give this a try on your next coffee break?

Was this helpful? Subscribe to my mailing list to receive updates on how to start learning to write your own Adwords Scripts.

Join my list to automate your way to PPC success

* indicates required


My Frequently Updated List of Resources on Adwords Scripts

Here’s a list of resources to get you started on using Adwords Scripts, and learning to write custom scripts for yourself. I’ll be updating the list on a regular basis if I discover additional valuable resources.

Getting Started Guides

I recommend reading my 3 Ways to Getting Started with Adwords Scripts post first.

Next, once you’re ready to get your hands dirty, have a look at these great resources to get you up to speed with AdWords Scripts:

Google Developers website Your First Script

Adhawk  Complete Guide to Google Adwords Scripts: Set Up and Best Practices

Seer Interactive Adwords Scripts Intro

FreeAdWordsScripts.com  Beginner’s Guide to Javascript You Should Know For AdWords Scripts

Search Engine Land Adwords Scripts for Every Level, Part 1, Part 2, Part 3, Part 4.

PPC Hero Getting Started with Adwords Scripts

eConsultantcy How to use AdWords scripts, the future of paid search

 

Some Introduction Videos on Adwords Scripts

[VIDEO] AdHawk – How to use the Adwords Scripts Console

[VIDEO] PPC Hero – Introduction to Adwords Scripts

[VIDEO] PPC Hero – Understanding Adwords Scripts

 

Adwords Scripts Resources from Google

Google Developers website for Adwords Scripts

Google’s own portal on Adwords Scripts with getting started guides, tutorials, code snippets, the Reference manual and complete scripts for some popular use cases.

Adwords Scripts Forum

This is the place to ask questions if you get stuck. Get answers from the community within hours. The people from the Adwords Scripts Team are pretty active as well and usually respond within one working day.

 

Online JavaScript Tutorials to learn the Basics of the Language of Adwords Scripts

To get the most out of the enormous potential of Adwords Scripts you need at least a decent understanding of JavaScript.

Codecademy

Codecademy is an online interactive platform that offers free coding classes in 12 different programming languages including JavaScript.

It’s a great resource to give you a good grasp of the basics of the language of Adwords Scripts and get started using them.

Other online tutorials include Team Treehouse,  w3schools JS Tutorial, Mozilla web docs, the JavaScript Road Trip at Code School, Free Code Camp,  WatchAndCode, and the video courses on Udemy.

More Advanced JavaScript Resources

Eloquent JavaScript , JS The Right Way , CodeWars

And if you’re really serious about learning how to code your won scripts, -> You Don’t Know Javascript .

 

Reddit

Reddit offers great communities that are willing to share knowledge and experience.

r/Javascript

r/Adwords Scripts

r/PPC

 

Collections of Adwords Scripts

Search Engine Land posts with Adwords Scripts Diverse scripts from diverse authors

Brainlabs Blog with great scripts by Daniel Gilbert

Freedadwordsscripts.com one of the first Adwords Script collections out there by Russell Savage

Optmyzr’s Free Scripts, great scripts by probably the most popular script developer Frederick Vallaeys

Karooya Blog with valuable scripts from the team at Karooya

Clicteq’s list of 120 Adwords Scripts , probably the most complete list currently out there (but wait unitl I publish mine ;).

Koozai’s list of 100 Adwords Script you shoud be using, another great list.

PPC Reddit’s list of Adwords Scripts, list of code snippets maintained by the PPC Reddit community

 

Adwords Scripts Developers

FreeAdWordsScripts.com Developer Directory

Freelance developers on Upwork

 

Missed anything?
Add your resources to the comments below, or send me an email: nils [at] nilsrooijmans.com

Was this helpful? Subscribe to my mailing list to receive updates on this list and how to boost your career with Adwords automation.

Join my list to automate your way to PPC success

* indicates required


How Knowing Adwords Scripts will Improve Your Career, For Sure

“How will learning Adwords Scripts progress my career?”

That’s a no brainer. Adwords Scripts increase your earning potential. Whether you’re an employee, freelancer or agency owner. Automating PPC tasks will enable you to dramatically increase your salary, or charge waaaay more $$$ for the same work that (thanks to scripts) requires less time, less people.

Also, using Adwords Scripts you’ll enjoy your work more.

 

Adwords Scripts benefits for employees

An increasing number of job listings in digital marketing ask for “scripting knowledge” or at least mention it as a desired skill. It’s a big plus on your resume that will make most agencies and many large in-house PPC managers want to hire you. Having this skill shows you have a resourceful mentality, you like problem solving and have a desire to learn. These are all attributes that will make it easier to land better jobs.

Knowing how to use Adwords Scripts will also project your career upwords by impressing your colleagues and your boss. Your output will feel like magic to them and they will value and appreciate your work even more than they do already. You will be able to help your colleagues by relieving some of the burdens of boring repetitive PPC tasks and present bigger results (ROI) to your boss. You’ll be the PPC Rockstar in the company. Eventually this enables you to move up in your company; from PPC specialist to PPC analyst to PPC manager and who knows, become PPC director.

Even if you don’t end up staying in PPC, learning Adwords Scripts will teach you things that can be transferred into almost any job you can think of. Coding Javascript is a globally applicable skill to have.

 

Adwords Scripts benefits for freelancers

Adwords Scripts will progress your career as a PPC freelancer as well. You can help businesses make more money and as a result make more money for yourself. Thanks to monitoring and alert scripts you will make less mistakes that might cost you clients. Thanks to automated bid management and other scripts for campaign optimization you can deliver more bang for your buck. Clients will notice improved returns and be happier to pay your bills. You will be able to send customized reports with convincing results to your clients. You can even notify them of issues outside of Adwords that are relevant to their business..

 

Adwords Scripts benefits for agency owners

As an agency owner you want to be working ON your business instead of IN your business. Working on your business will allow it to grow. But working on the business also takes a lot of time. Time you can’t spend in the Adwords interface. Adwords Scripts enable you to spend more time working on the stuff that matters to grow your business by freeing up time and preparing the work you can delegate to your team.

Next to that Adwords Scripts will enable you to drive your account performance. Given the right pricing model this directly translates into additional revenue for your company.

 

BONUS: Knowing Adwords Scripts and understanding code gives you an insight into the way the world works that most people don’t have. Algorithms drive the future of humanity. Best be part of it! 🙂

Wait, don’t close this tab just yet!

Your career won’t get far if you just consume this knowledge and then…do nothing. We need some action.

I challenge you to spend 5 minutes to, right now:

  1. think about what tasks you would like to automate that will improve your career
  2. write down the tasks and include how you think/hope they will improve your career
  3. send me an email with your output and i will respond with my take on how to make this dream a reality.
    In my response i will include actionable steps that will take you there as quickly as possible.
    Mail to nils@nilsrooijmans.com .

Then, if you feel ready, start here to get going with Adwords Scripts.

Was this helpful? Subscribe to my mailing list to receive updates on how to boost your career with Adwords automation.

Join my list to automate your way to PPC success

* indicates required


7 Reasons Why You Should Be Using Adwords Scripts

“Why would I go over all the trouble of setting up an Adwords Script in the first place?”

Great question. Asking the “Why” before the “What” and “How” keeps you on track. It helps you focus on the stuff that really matters when you take on a new project. Learning how to use Adwords Scripts is no exception.

There are at least seven reasons why you will benefit from using Adwords Scripts:

  1. You can automate the tedious monotonous PPC tasks that just take hours to finish
    Think sifting through search term reports, filtering endless excel sheets, clicking around like a ferret on speed trying to find the ad groups that don’t yet have price extensions, applying guesstimated bid modifiers all over the place, adding your keywords as a negative in your DSA campaigns, negating keywords like crazy in your Shopping campaigns, Fixing Capitalization Mistakes in Your Ad Copy, etc…etc…Oh, and did I mention the everlasting checks of monthly budget spent?
  2. Automatically increase your account performance
    Automatically increase bids on cheap high conversion keywords, stop ads from showing for irrelevant search terms, discover bad performing keywords without fail, how about self-activating ads that mention the rain when weather conditions are wet. The list goes on and on…
  3. Make fewer mistakes
    Send less (paid!) traffic to broken links, receive an alert if someone in your team mistakenly paused whole campaigns, monitor Google’s latest AI “improvements”,   automagically pause campaigns if your monthly budget runs out, receive an SMS if billing issues occur.
  4. Make adjustments while you sleep
    Immediately pause ad groups for products that just ran out of stock. Pause all campaigns if your website is down. All from the comfort of your bed.
  5. Spend less time on reporting and analyzing, more on strategy
    Answer questions like “How does my performance vary by hour of the week” in the split of a second.
  6. Help and impress your colleagues and the Boss
    Share broken links and newly discovered keywords with your SEO colleagues, help your non-techy PPC teammates build campaigns and ad groups from a Google Sheet, show your boss graphs on how you beat the competition over time.
  7. Improve your career opportunities
    Increase your value, get a salary raise, open up new career opportunities in adjacent fields, get selected for a better job.

So now you know “Why” you should get started with Adwords Script. Read my “3 Ways to Get Started with Adwords Scripts” on the “How” to get started using scripts in less than 30 minutes.

Scripts are like an extra pair of hands. Once you get a feel for what is possible ( a LOT!) you can’t live without them.

Was this helpful? Subscribe to my mailing list to receive updates on each of the benefits mentioned above.

Join my list to automate your way to PPC success

* indicates required


A Good Book for learning Adwords Scripts. Does it even exist?

Books on Adwords Scripts
Books on Adwords Scripts?

“Is there a good book out there that teaches how to use and create Adwords Scripts?”

Short Answer: No.

Believe me. I’ve spent many unbillable hours searching for a book to finally get started using Adwords Scripts. If found none. Zero.

While there are many books out there on learning the JavaScript programming language, none of them is tailored to Adwords Scripts specifically or even mentions the topic.

Also, there are a lot of books on Adwords in general, however none of them addresses Adwords Scripts in detail.

So, no book.
This is actually the reason I decided to write one myself (signup for my newsletter below for updates on the progress).
This does not mean you won’t be able to learn to use/edit/write Adwords Scripts today though!

Here are my tips on getting started today. With or without books.

1. Learn the basics of JavaScript

If you are not already familiar with the programming language JavaScript head over to the JavaScript course on CodeCademy. This is an easy interactive course that will teach you the basic concepts of the language. (Read more on the use of CodeCademy for Adwords Scripts for further details)

If you really prefer a (physical) book to learn the JavaScript language I recommend a paperback copy of A Smarter Way to Learn Javascript. The great thing about this book is that it has interactive exercises at the end of each chapter that will really make sure you grasp the material. After that, try Eloquent Javascript. Note: the book is also available online in PDF format, for FREE.

2. Start fooling around with some basic Adwords Script examples

After familiarising yourself with the basics of JavaScript or if you are already familiar with the language of JavaScript, I recommend you start playing around with different things inside the AdWords Script Editor. Since there is no course specifically on Adwords Scripts (yet) you’ll have to start digging into AdWords Scripts on your own.

Learn about the concept of Iterators and Selectors. Start iterating over your own campaigns/ad groups and keywords. Report on some statistics. Log the results of your script and look at the results of what you are doing in Preview mode. Copy-paste some of the Google code samples and edit parts of the code.  If you feel confident find some more prebuilt scripts to start screwing around with. Have some fun!

Was this helpful? Subscribe to my mailing list to receive updates on my Book on Adwords Scripts and tips on how to learn JavaScript for Adwords Scripts.

Join my list to automate your way to PPC success

* indicates required


Is Codecademy a good place to start learning the language of Adwords Scripts?

You already know that learning the JavaScript programming language is a great way to get started with Adwords Scripts. To get the most out of the enormous potential of Adwords Scripts you need at least a decent understanding of JavaScript.

Codecademy looks like a great place for novices to start to learn and understand the language. But is it, really? And if so, how do you make the most out of it?

What is Codecademy?
Codecademy (not spelled “code academy”) is an online interactive platform that offers free coding classes in 12 different programming languages including JavaScript.

Is the Codecademy JavaScript course a good way to learn JavaScript?
The course is a decent start if you want to learn the basic concepts and syntax of JavaScript. No need to download or install anything, and no need to wait for a book to be delivered to your doorstep.  The course is FREE, it’s completely online, it’s interactive and FUN, it’s not that hard and you can finish it in roughly 10 hours. Finishing the course enables you to immediately start using Adwords Scripts by simply copy-pasting scripts and then start fooling around with the code.  That makes Codecademy a great resource to give you a good grasp of the basics of the language of Adwords Scripts and get started using them.

However, if you really want to learn how to program Adwords Scripts for yourself I would say no. Codecademy does not teach you the mindset of programming. Being a programmer is more than simply being able to tinker with syntax. It’s about having a particular mindset, where you are able to systematically break down a problem into individual and logical steps, and then recreate that in a language that the computer understands. This is a tough skill and is hard to acquire. Codecademy does not do a decent job in this respect. If you really want to dig in and learn to program Adwords Scripts yourself I would recommend learning javascript through courses like Eloquent Javascript.

Is Codecademy a good way to learn JavaScript for Adwords Scripts?
Like all the current JavaScript courses currently out there, Codecademy is not tailored to the needs of a PPC expert managing Adwords. Again, it will teach you the basics of JavaScript. But it will not teach you anything about the Adwords Scripts library, its objects, iterators and selectors. These are concepts you will need to familiarize yourself with in some other way (you can subscribe to my newsletter below to learn how). Also, if you already know the basics of JavaScript, Codecademy will not move you forward in using Adwords Scripts.

How to make the most out of Codecademy?
Here’s my advice on how to use Codecademy to get started learning Adwords Scripts.

If you already have some experience with JavaScript simply scan through the lessons and complete exercises to reconfirm your knowledge if you feel like.

If you’re a non-technical type, JavaScript just feels like Gibberish to you, you’re completely new to programming or you’re in the infancy of learning JavaScript, take these steps:

  1. Create an account (for FREE)
  2. Sign up for the Original JavaScript course on Codecademy
    NOTE: don’t go for the new Introduction to JavaScript, that course is based on a new version of JavaScript and best practices that most Adwords Scripts do not use. It will unnecessary confuse you.
  3. Get started with the course and try to finish one lesson each day. Do all the exercises. This will keep you moving and motivated.
  4. Don’t pay too much attention to the web development side of JavaScript, focus on the syntax of the language and its basic concepts like variables, functions, control flows (if-then statements), loops (for-while loops), objects and arrays.
  5. After finishing the course, celebrate! You just introduced yourself to one of the most powerful skills of current day digital marketers; programming. Go ahead, pop that bottle.

Now that you’ve learned the basic concepts of JavaScript you’re ready to start playing around with different things inside the AdWords Script Editor. Learn about Iterators and Selectors. Start iterating over your campaigns/ad groups and keywords. Log the results of your script and look at the results of what you are doing in Preview mode. Copy-paste some of the Google code samples and edit parts of the code. Have some fun!

Was this helpful? Subscribe to my mailing list to receive updates on how to learn JavaScript for Adwords Scripts.

Join my list to automate your way to PPC success

* indicates required


3 Ways to Finally Get Started with Adwords Scripts

“Ok, I want to use Adwords Scripts, but how on earth do I even get started?”

Well, as with everything in PPC, it depends. There are basically three ways to get started with scripts, and the best way for you depends on your specific situation.

Option 1: Copy-Paste publicly available scripts

Googling for scripts written by others is a perfect way to easily get you started in no time. You don’t have to figure everything out yourself and most scripts are easily modified/configured to your needs.

The PROS

The CONS

  • Although there are many scripts out there, the set is limited. Once you get a feel for what is possible and realize scripts can do almost ANYTHING  you’ll probably come up with use cases that aren’t covered by the free ones.
  • Many of the scripts that are freely available aren’t maintained and are not supported. This means the code can be out of date and or dysfunctional.
  • Black Box. If you simply copy-paste scripts without reading the code you don’t know what is really going on if you execute the script. Do you really trust the script to do only the things you want it do, and do nothing more?

That brings us to our next option.

Option 2: Write your own first and easy script

If you write your scripts yourself, you’ll definitely know what is going on.  This is also a great way to start learning a new skill that potentially will skyrocket your career. (PPC skills + Automation skills = $$$)

The PROS

  • Almost endless possibilities to automate many tedious, repetitive PPC tasks. Customized to your exact needs. You will be able to write/enhance/edit scripts to automate processes that are unique to your business.
  • You’re in full control; the scripts does exactly what you want it to do.
  • It’s FREE (well, sort of). The only expense is your time, not $.
  • Loads of free resources to start learning Adwords Scripts. Here’s a great first script example that teaches you about basic Javascript concepts.

The CONS

  • Programming skills and Javascript knowledge are required
  • It can be hard to come up with, and write Scripts yourself
  • Oh yes, you need to spend time maintaining the code, which can be tedious.
Option 3: Have someone else write one for you

Why waste time and energy if someone else can do it for you? Hiring freelancers to write scripts for you is a great way to get started if you really have no clue where to start, the language of javascript sounds like ancient Greek to you, or you just don’t feel like spending any time in code yourself.

The PROS

  • Again, almost endless possibilities to automate many tedious, repetitive PPC tasks. Customized to your specific needs.
  • You do not need to code anything yourself
  • Upwork has some Freelance javascripts developers who specialise in Adwords. Just describe your needs and get him/her to write and help you run your first script.

The CONS

  • You need to find a good programmer who knows about Adwords
  • You need to be able to communicate with developers
  • Cash out $

 

There you have it. Three ways to get started with your first script in less than 30 min.

Was this helpful? Subscribe to my mailing list to receive updates on each of the steps mentioned above.

Join my list to automate your way to PPC success

* indicates required


A Script to receive Daily Budget Overdelivery Alerts

Here’s a script that will alert you if and when the latest Daily Budget change by Google will cause Google to overdeliver and spend more than your daily budget.
The script will compare the anticipated ad spend based on your campaign daily budget settings with the actual ad spend.
It will check for overdelivery in any of three periods: yesterday, last week and last month.
In case of big differences (overdelivery by Google) it will report an alert, log the alert in the specified Google Sheet and inform you about the alert via email

Here’s what the output will look like:

Be sure to create a new empty spreadsheet and add the url to the script. Also add your email adress. (lines 28 and 29)
You can also set the threshold variables to whatever percentage of overdelivery is acceptable to you. (lines 36 to 38)

You can schedule the script to run daily. If you do so, change the ‘firstRun’ to false (line 33).

// Copyright 2017, Nils Rooijmans, All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


/**
* @overview:
* For each campaign that is NOT labeled 'noBudgetAlert' this script will compare the anticipated ad spend based on daily budget settings with the actual ad spend. 
* In case of big differences (overdelivery by Google) it will report an alert, log the alert in the specified Google Sheet and inform about the alert via email
* 
* For the MCC version please contact Nils Rooijmans [nils@nilsrooijmans.com]
*
* @author:  Nils Rooijmans [nils@nilsrooijmans.com]
* @version: 1.0
*/

// 
var SPREADSHEET_URL = "[REPLACE WITH YOUR SPREADSHEET URL]";  //insert a new blank spreadsheet url, replace everything between and including the square brackets
var EMAIL = "[REPLACE WITH YOUR EMAIL]"; //insert your email, replace everything between and including the square brackets

var CAMPAIGNLABEL = "noBudgetAlert";  //campaign level label for campaigns to ignore

var firstRun = true; // set to false if you schedule the script to run on daily basis, set to true for first run or if you run only once

// Config variables to set the percentage of overdelivery allowed before an alert is sent
var dailySpendAlertThreshold = 0.2; // alert if overdelivery is greater than 20% of daily budget
var weeklySpendAlertThreshold = 0.1; // alert if overdelivery is greater than 10% of 7 times the daily budget (for the 7 days before today)
var fourWeeklySpendAlertThreshold = 0.05; // alert if overdelivery is greater than 5% of 28 times the daily budget (for the 28 days before today)


function main() {  

  var accountAlert = false;
  var campaignAlert_dailyCheck = false;
  var campaignAlert_weeklyCheck = false;
  var campaignAlert_fourWeeklyCheck = false;
  
  var adSpendYesterday = 0;
  var adSpend1to7DaysAgo = 0;
  var adSpend1to28DaysAgo = 0;
  var differenceDailyCheck = 0;
  var differenceWeeklyCheck = 0;
  var differenceFourWeeklyCheck = 0;
  
  var d = Utilities.formatDate(new Date(), AdWordsApp.currentAccount().getTimeZone(), "MMM dd,yyyy");
  var dayOfTheWeek = new Date(d).getDay(); 
  var dayOfTheMonth = new Date(d).getDate();

  //prepare the sheet
  var ss = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
  var sheet = ss.getActiveSheet();
  if (sheet.getRange('A1').isBlank()) {
    sheet.appendRow([
    "Date", 
    "Account Name", 
    "Campaign Name", 
    "Ad Spend Yesterday", 
    "Anticipated Spend", 
    "Difference", 
    "Ad Spend 1 to 7 Days Ago", 
    "Anticipated Spend", 
    "Difference", 
    "Ad Spend 1 to 28 Days Ago", 
    "Anticipated Spend", 
    "Difference"
    ]);
  }
  
  // prepare contents of email
  var html = [];
  html.push(
    "<html>",
    "<body>", 
    "<p>Alerts are logged in sheet: ", SPREADSHEET_URL ,"</p>",
    "<p>----------------------------------------------------</p>",
    "<p>OVERDELIVERY ALERTS FOR:</P>",
    "<P>ACCOUNT - CAMPAIGN</p>",
    "<p>----------------------------------------------------</p>"
  );  
 
     
  // if not already created, create label used to Ignore campaigns
  // this is necessary for the script to run even if no campaign has been labeled
  var labelName;
  var labelExists = false;
  var labelIterator = AdWordsApp.labels().get();
  while (labelIterator.hasNext()) {
    labelName = labelIterator.next().getName();
    if (labelName.localeCompare(CAMPAIGNLABEL) == 0){labelExists = true; break;} else {labelExists = false}
  }
  if (labelExists == false) {
    AdWordsApp.createLabel(CAMPAIGNLABEL);
    Logger.log("labelCreated");
  } else {
    Logger.log("labelExists");
  } 
  
  
  // Let's check the campaigns for overdelivery
  Logger.log("Checking account: "+AdWordsApp.currentAccount().getName());    
  
  var campaignSelector = AdWordsApp.campaigns()
     .withCondition("LabelNames CONTAINS_NONE ['" + CAMPAIGNLABEL + "']")
     .withCondition("Status = ENABLED")
     .forDateRange("YESTERDAY");
  
  var campaignIterator = campaignSelector.get();
  
  while (campaignIterator.hasNext()) {
    var campaign = campaignIterator.next();
    Logger.log("    Checking Campaign: "+campaign.getName());

    var campaignAlert_dailyCheck = false;
    var campaignAlert_weeklyCheck = false;
    var campaignAlert_fourWeeklyCheck = false;
    
    var anticipatedDailyAdSpend = campaign.getBudget().getAmount();
    var anticipatedWeeklyAdSpend = 7 * anticipatedDailyAdSpend;
    var anticipatedFourWeeklyAdSpend = 28 * anticipatedDailyAdSpend;

    // daily check
    //Logger.log("DAILY CHECK");
    adSpendYesterday = campaign.getStatsFor("YESTERDAY").getCost();
    differenceDailyCheck = (adSpendYesterday-anticipatedDailyAdSpend)/anticipatedDailyAdSpend;
    if (differenceDailyCheck > dailySpendAlertThreshold ) {
       campaignAlert_dailyCheck = true;
       Logger.log("DAILY overdelivery spend alert");
    }
    
    // weekly check  
    if (dayOfTheWeek == 1 || firstRun){  // if not the firstRun this check runs only on mondays
      //Logger.log("WEEKLY CHECK");
      adSpend1to7DaysAgo = campaign.getStatsFor(dateBefore(7),dateBefore(1)).getCost();
      differenceWeeklyCheck = (adSpend1to7DaysAgo-anticipatedWeeklyAdSpend)/anticipatedWeeklyAdSpend;
      if (differenceWeeklyCheck > weeklySpendAlertThreshold ) {
         campaignAlert_weeklyCheck = true;
         Logger.log("WEEKLY overdelivery spend alert");
      }
    }

    // 4 weekly check
    if ((dayOfTheWeek == 1 && dayOfTheMonth < 8) || firstRun){ //if not the firstRun this check runs only on the first monday in a month 
      //Logger.log("MONTHLY CHECK"); 
      adSpend1to28DaysAgo = campaign.getStatsFor(dateBefore(28),dateBefore(1)).getCost(); 
      differenceFourWeeklyCheck = (adSpend1to28DaysAgo-anticipatedFourWeeklyAdSpend)/anticipatedFourWeeklyAdSpend; 
      if (differenceFourWeeklyCheck > fourWeeklySpendAlertThreshold) {
         campaignAlert_fourWeeklyCheck = true;
         Logger.log("4-WEEKLY overdelivery spend alert");           
      }   
    }
  
    // add alerts to sheet  
    if (campaignAlert_dailyCheck||campaignAlert_weeklyCheck||campaignAlert_fourWeeklyCheck) {

      accountAlert = true;
        
      sheet.appendRow([
        d, 
        AdWordsApp.currentAccount().getName(), 
        campaign.getName(), 
        adSpendYesterday, 
        anticipatedDailyAdSpend, 
        (differenceDailyCheck*100).toFixed(1)+"%", 
        adSpend1to7DaysAgo, 
        anticipatedWeeklyAdSpend, 
        (differenceWeeklyCheck*100).toFixed(1)+"%", 
        adSpend1to28DaysAgo, anticipatedFourWeeklyAdSpend, 
        (differenceFourWeeklyCheck*100).toFixed(1)+"%"
      ]);  
      
      Logger.log("ALERT ADDED TO SHEET");
      
      if (campaignAlert_dailyCheck) sheet.getRange(sheet.getLastRow(), 6).setFontColor("red");
      if (campaignAlert_weeklyCheck) sheet.getRange(sheet.getLastRow(), 9).setFontColor("red");
      if (campaignAlert_fourWeeklyCheck) sheet.getRange(sheet.getLastRow(), 12).setFontColor("red");
      
      html.push(  
        "<p>" + AdWordsApp.currentAccount().getName() + " | " + campaign.getName() + "</p>");         
    }
  }  

  if (accountAlert) { // if there is any alert for any of the campaigns , send email
    MailApp.sendEmail(EMAIL, "Overdelivery Alerts", "", {htmlBody: html.join("\n")});
  }

}
  
function dateBefore(days){ 
  var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
  var now = new Date();
  var dateBefore = new Date(now.getTime() - days * MILLIS_PER_DAY);
  var timeZone = AdWordsApp.currentAccount().getTimeZone();
  return Utilities.formatDate(dateBefore, timeZone, 'yyyyMMdd');
}

Suggestions for Books on Adwords for PPC Professionals

“What good Google Adwords books are out there that will help me improve my PPC skills?”

Well, books have the risk of being outdated. A lot of digital marketing strategy remains the same over the years, but the tactics rapidly change. Books may not be the best way to learn about Adwords and PPC.  For myself I prefer online sources as they tend to be more up to date.

However, there is still a lot you can learn about Adwords and PPC by reading some or all of the recommended books listed below.

For the absolute beginners

Pay Per Click Search Engine Marketing For Dummies – Peter Kent

This book is a very easy read, also if you’re not a native English speaker. It covers the very basics of PPC.

Note: the basic concepts are timeless, however some parts of the content of the book are outdated.

Google Adwords for Dummies – Peter Kent

This book will really get you started using Adwords. It’s a much better way than trying to absorb all those Google ‘help’ pages. A comprehensive instruction manual on doing things the right way, (which is not necessarily Google’s way!)

Pay-Per-Click Search Engine Marketing: An Hour a Day –  David Szetela and Joseph Kerschbaum

This book covers a bit more detail on how to set up an account in Google and gives helpful hints and tools to build a solid well thought out PPC campaign. Great for training new employees as well.

David Szetala is a veteran in the PPC arena. He knows his stuff. I also recommend you subscribe and download his podcast ‘PPC Rockstars’ and start listening from the beginning for your education.

For intermediates

Ultimate Guide to Google AdWords – Perry Marshall

A great resource to provide a practical, comprehensive, step-by-step breakdown of the platform that enables you to confidently manage the Adwords platform on your own. This book covers more details than the ones before. Careful though as some might be outdated.

For the pros

Advanced Google AdWords – Brad Geddes

If you’ve been doing Adwords for hundreds or thousands of hours already this is your go-to destination to reach the next level. Brad truly is the leader in the space when it comes to Adwords education. He has been teaching Adwords for over 12 years and this book is the Adwords bible. The book is enjoyable and shows step by step instructions with screenshots that explain Brad´s detailed thinking and advanced tactics.

PS: i’m preparing a book on Adwords Scripts. Want to know more?

Join my list to automate your way to PPC success

* indicates required


The Best Adwords Script I Have Ever Used

“What is the best AdWords script you have ever used?”

Although i have many favorite scripts in my arsenal and they are all very useful there is one single clear winner for me. This is the script i install the first day when taking over a new account. It is also a great way to finally get started using Adwords Scripts.

I’m talking about a script that automatically alerts me if any of my landers are broken: the Broken Link Checker script, published by our friends at Google.

Broken links occur because of many reasons, most oout of your control. Not the least one is IT deploying new versions of the website without proper testing. Recognizable? Uhhh, yeah.

A click on a broken landing page url not only is a waste of your budget, it’s also a missed opportunity to convert. That visitor is never coming back! Next to that, it’s a negative brand experience that even might hurt future CTRs, and thus Quality Scores.

What makes this script my winning script?

My all-time favorite script enables me to do something that is practically impossible without automation. In this sense, it does not improve the efficiency of my work that much, since before using the script i just didn’t do this task at all. (Yes, fair to say i’ve spend buckets of coin on clicks to 404 error pages, especially from sitelinks).
It does however enormously improve the effectivity of my work. How so? Well, it reduces the amount of wasted ad spend in my accounts and reduces missed opportunities for increasing revenue.
More revenue, at fewer costs! That makes me a happy camper.

Next to that, the script is publicly available, open source and free to use.
It is easy to install, easy to configure and easy to run. You don’t need any scripting knowledge whatsoever to get started with this one.
It is well documented and continuously supported by Google developers. So no worries of running a script that malfunctions. No need to debug or maintain anything yourself.

So…do yourself a favor. Make sure all your links work correctly.
Install the script. Set it, forget it.

PRO TIP: let your fellow SEO colleagues know when you’ve discovered some broken links. They will thank and praise you for it.

And for all you working at an agency, here’s the MCC version of the script.

 

PS: i’m preparing a book on Adwords Scripts. Want to know more?

Join my list to automate your way to PPC success

* indicates required