Should I write my own monitoring script and use Adwords API to pause the campaigns if my server is down, or there is a simple way to do it?

I don't want to use 3rd party software, because the task looks rather simple for that.

  • Personally the best method would be to avoid having your server go down, use better hosting or change the way you update / maintain the server. Commented Feb 3, 2013 at 14:53
  • 1
    Well, that sounds pretty reasonable. But you know, you never know when you may experience disk failure, or power outage. And this happens even with the most reliable hosting providers.
    – C-Blu
    Commented Feb 3, 2013 at 15:48
  • Answer Incoming. Commented Feb 3, 2013 at 17:49

2 Answers 2


Return of Investment

I don't believe that using an Adwords API to adapt to downtime on your hosting is the way forward. Instead you should be adjusting your Adword budget and budgeting for reliable hosting, that in some ways is fail proof. A server with greater uptime can be a better return of an investment than a adwords since well you could lose a sale.. Never mind being changed by Google for not even receiving the traffic.

You raised concerns about hardware fail in your comments which I'll now address.

Cloud Hosting

Hosting in this day and age is extremely safe and hardware fails do not happen on services that you pay for. With good VPS hosting on a Cloud such as provided from Rackspace you don't get hard drive fails or power issues since your files are hosted on fail proof raids and redundant power supplies. When a node or hard drive fails your files are shifted to new nodes since your instance is hosted on multiple servers while not relying on one server. So it is my honest opinion if you are concerned about downtime then simply your hosting is not good and you should consider using a almost fail proof system.

Good DNS Hosting

DNS can also go down but again there is many DNS providers that provide better up times and fail proof systems that ensure that your website is always online. For max up-time you want DNS that has DNSSEC and Active Fail-over, Again things like this pretty much remove the downtime possibility.

But this isn't what I asked

Please note I know that I haven't addressed your question with a way of using the API but it will be useful to tell you that I've worked with many clients with adword campaigns and I have never come across the issue with clients being concerned about being charged during down time, Clients never fact in downtime because DOWNTIME Is not an option for them and since your paying for traffic I'd also consider it being vital that making downtime non optional buy interments better practices to ensure that downtime does not happen.

  • This is not completely true, I host some sites on a linode, and hacking attacks, specifically the xmlrpc attack, started causing resource overload. This wasn't due to traffic, but to a vulnerability, and repeatedly caused my site(s) to go down until I got a fail2ban script in place for the xmlrpc vulnerability. After that, yeah it was back to normal...but occasionally things can go wrong, even on a good VPS
    – daaxix
    Commented Mar 27, 2015 at 22:28
  • @daaxux Question was regarding server uptime, not downtime as a result of being hacked. Good administration skills prevent most hacks. Commented Mar 27, 2015 at 23:08
  • 1
    the question was about turning off adwords in the event that a webserver goes down, and they do occasionally go down, even with good VPS and good administration as vulnerabilities evolve, the original question is not about uptime in the normal sense. Your answer doesn't address this case, which is part of the OPs question...
    – daaxix
    Commented Mar 27, 2015 at 23:12
  • Well the OP seemed happy enough to click ACCEPT. Fact is your server should never have any downtime. Good hosting, good dns, and administration = 99.9% uptime. If you suffer vulnerabilities from time to time, its because your using too many common scripts, or not checking 0 day vulnerabilities on common scripts and apps. Commented Mar 27, 2015 at 23:20
  • Also, its near impossible to get a website go down as a result of the hosting company with good hosting. Soon as a part fails your switch to another node, your server will be back online within a couple of minutes at the max. Commented Mar 27, 2015 at 23:22

It should be possible to do, but would take some implementation. You would need:

  1. A monitoring service that knows when your site is down
  2. The ability to trigger a program to run when the monitoring service detects that your site is down
  3. Access to the Google Adwords API
  4. A program that would use the API to list your campaigns and loop through them and pause all of them.

Here is a question on the Google product forums asking for a simple code to use the Adwords API to pause an account. There is a link that points to some example code that could be adapted:

This code example demonstrates updating a campaign's Budget using VB DotNet: http://code.google.com/p/google-api-adwords-dotnet/source/browse/trunk/examples/adwords/vb/v201109/BasicOperations/UpdateCampaign.vb You could adapt this code example to update the Campaign's status to paused: https://developers.google.com/adwords/api/docs/reference/latest/CampaignService.Campaign#status

Not the answer you're looking for? Browse other questions tagged or ask your own question.