AdWords Script: Emergency Stop

When managing large scale PPC campaigns it sometimes may become necessary to pause all the activity for a period of time. This could be due to website downtime or budget constraints for example. When this is done manually, this can be a very labour intensive task, depending on the number of accounts and campaigns involved.

To solve this problem we developed an AdWords script that helps you to pause and reactivate all campaigns within one or several AdWords accounts – immediately or on a scheduled date. The script will remember what campaigns it paused and will only reactivate those same campaigns. Previously paused campaigns remain paused. It also sends e-mail notifications about what actions were taken.

AdWords accountImage: An AdWords account after the script has run. You can easily recognise the campaigns paused by the script looking at the label “EmergencyStop”.

Disclaimer

Using the script in an incautious way can influence your traffic heavily. Use with care and at own risk.

Here is how you can leverage the script.

Step 1: Create a Copy of the Configuration Spreadsheet

All necessary settings can be comfortably adjusted using a simple Google spreadsheet.

Spreadsheet

Log in to Google using the same account as your AdWords user. That way, the AdWords script you apply in in step 3 will have rights to access the configuration. Make a copy of this spreadsheet and rename it as you like.

Copy the URL of your configuration spreadsheet. You will need it in Step 3.

Note: You can share the configuration spreadsheet with your colleagues by clicking the ‘Share’ button. Make sure Link Sharing is “Off – only specific people can access”. You can learn more about Google spreadsheet security settings here.

Step 2: Configure the Emergency Stop Spreadsheet

Specify the AdWords accounts involved by using their ids in the Settings tab.

AccountId: The account id with dashes: 000-000-0000

Account Name: An arbitrary name – it will be used in the notification e-mail.

Notification Email: Enter one or several (separated by comma) to a receive summaries about how many campaigns were paused by the script.

Immediate Stop

If you want to pause all campaigns of an account immediately, change the value in the column Emergency Stop to “yes”. This will take effect during the next execution of the script (configured in Step 5) – all active campaigns will be paused and labeled. Vice versa, to reactivate all the campaigns paused by the script, set the Emergency Stop back to “no”.

The Immediate Stop will not take effect if you have entered values in the Pause and Activate columns.

Scheduling

Instead of using an immediate Emergency Stop, you can also configure the script to pause and re-activate the campaigns based on a date and time.

  • The Activate date has to be after the Pause
  • If any of the dates is in the past or today, the cell’s color will change to yellow, indicating that the day is active.

Attention: Scheduling the emergency stop by entering a pause and an activation date/time will override the immediate emergency stop function.
 If you want to use the immediate emergency stop function, remove any dates from the scheduling section!


Keep in mind: The configuration will take effect on your AdWords accounts only after steps 3-5 have been applied.

This following table summarises how the script acts on the campaigns.

TableStep 3: Create the AdWords Script

Scripts at the MCC-Level can be accessed using the “Bulk Operations” (NOT to be confused with scripts on the account level).

Scripts

Add a script, delete the default example code, then copy and paste the following code (click to download).

 

Code

 

Then replace the URL of the SPREADSHEET_URL to direct to your configuration spreadsheet from step 1:

Spreadsheet URL

Finally, name the script as you like, and hit the Save button.

Step 4: Authorise the Script

The script should now be ready to run. Simply click “Preview” to run the script for the first time. A few questions will pop up about administrative privileges, which must all be confirmed. Once this is done, the script should create a tab for all of the accounts entered in the spreadsheet. For this step, it may be necessary to run the preview once more.

Authorize

Step 5: Configure the AdWords Scheduler

You can select a frequency for the script in the AdWords Interface so that it runs regularly. We recommend an hourly execution. Individual accounts can be excluded at any time by selecting “no” in the “Activated” column. The script then ignores these accounts the next time it runs. In case of a website downtime you can also run the script immediately by clicking on Run in the interface.

Configure

Limitations:

If all of your AdWords accounts surpass approx. 3000 campaigns, you might have to create an additional spreadsheet configuration (Step 1 – 2) and duplicate the second script (Steps 3-5) – this is because execution time is limited by Google.

Good luck and: be careful.

Copyright 2015 crealytics GmbH

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 expressed or implied. See the License for the specific language governing permissions and limitations under the License.

ABOUT THE AUTHOR


Alexander Giebelhaus

Alexander Giebelhaus is part of crealytics` innovation development team.
With his expertise he supports our PPC campaign management teams.

  • Ali Gani

    Vielen Dank, das erleichtert uns so einiges, gerade zur Weihnachtszeit 😉

    • Heiko von Raußendorff

      Hi Ali,
      we haven’t thought about that. But of course you can use the scheduler for pausing adwords campaigns over christmas without being in the office.
      If you have any further feedback, let us know.
      Merry Christmas
      Heiko

  • Wind Rad

    When I create this script at account level by following all your instructions I get this error.

    ReferenceError: “MccApp” is not defined. (line 53)

    When I create this script at MCC level by following all your instructions I get these errors.

    15:14:12.171Document 12MLA–vbdzfZjb1jx8hft5aaHt8RM1MOo9WqEakdM50 is missing (perhaps it was deleted?) (line 30)

    15:14:13.254Document 12MLA–vbdzfZjb1jx8hft5aaHt8RM1MOo9WqEakdM50 is missing (perhaps it was deleted?) (line 30)

    Please advise if possible.

    Thank you very much!

    AM

    • Heiko von Raußendorff

      Hi AM,

      this script is an MCC Script. It cannot be run on account level.

      The second error seems to be an authorization issue.

      Please check
      1. Did you make a copy of the spreadsheet for your own and put the correct URL into the script (Line 25)?
      2. Make sure that the user for authorization of the adwords script has access (read/write) to the spreadsheet as well

      If you still see an error, please let me know.

      Heiko

      • Wind Rad

        Hi Heiko,

        Thank you very much for the quick reply.

        Yes it was a user issue. I am logged in with so many usernames that sometimes I have to turn everything off and log back in.

        It is working and it is the best Script ever. Now I can sleep at night…

        Thank you so very much for making this available.

        My best regards,

        AM

        • Heiko von Raußendorff

          Great…thanks for your feedback.

          Be aware that you still have to tell the script to pause your campaigns in the case of a website outage (scheduled or emergency).

          But you can react much faster and the reactivation is simple.

          Heiko

  • Thanks a lot for this .You are a savior.

    • Heiko von Raußendorff

      Glad to hear it helps.

      Thanks for the feedback.