You can’t stay looking at your machine’s monitor to keep an eye on websites uptime. So, there are some cool sites which actually help you keep track of your sites uptime or downtime. Helping you cross check the reasons behind your site’s service downtime. As unavailability of site can hit your visitor count.

Although there are many websites which give uptime and downtime services they charge for SMS reminders. So here is a cool (Hack)setup provided by amit agarwal of Digital inspiration(Labnol) fame, to monitor website’s uptime using Google Docs.


First head to download this copy  of the Google Docs Spreadsheet. Then change the website URL to your website and the email address to your email. That’s the email you’ll be notified for uptime and downtime. Also change SMS notifications to yes.

  • Put your website URLs in cell B2 (comma separated) and your email address in cell B3. If you wish to be alerted by text messages, just replace No with Yes in cell B4.
  • You’ll find a new Website Monitor menu in your Google Docs toolbar. Click Initialize and you’ll get a pop-up asking for authorization. Grant the necessary access.
  • Go to the Website Monitor menu again and choose “Start” to begin the monitoring process.  Close the Google Sheet.

Then in the Google Docs menu, you’ll need to go to Tools –> Script Editor . Google uses JavaScript for this scripting. Then on script editor find // Setup trigger that runs every 5 minutes
You can change timer to 1 or 5 or 10 or 15.Save the trigger and authorize Google Docs, then re-save.
Now again go to Website Monitor menu in your Google Docs toolbar. Click Initialize and you’ll get a pop-up asking for authorization. Grant the necessary access.
Go to the Website Monitor menu again and choose “Start” to begin the monitoring process.  Close the Google Sheet.
Here is a snapshot how it looks. I had created a dummy url to check the uptime.
For more hacks and tutorials please visit : Amit Agarwal’s Digital Inspiration
If you are receiving the SMS notifications then please ensure that your phone number is associated with Google Calendar. Here are the steps to associate your phone with Google Calendar

Register your mobile phone on Google Calendar

To register your mobile phone with Google Calendar, you need to obtain a verification code. Here’s how:
  1. Click the gear icon at the top of any page and select Settings from the drop-down menu
  2. Click the Mobile Setup tab
  3. Select your country from the Country drop-down menu
  4. Enter your phone number in the Phone number field
  5. Select your carrier from the drop-down menu, if applicable. If you see the link See Help Center for supported providers, please check if your provider is supported before requesting your verification code.
  6. If your carrier is supported, click the Send Verification Code button, and you’ll get a text message on your phone
  7. Once you receive this message, enter the code you received in the Verification code field and click the Finish setup button
  8. Click Save
Also check the entire code script which works behind in this hack
/**   Website Monitor 4.0 by Digital Inspiration    **/
/** ========================================== **/

/** Published by Amit Agarwal on 02/14/2013 **/
/** Last updated by @labnol on 10/15/2013 **/

/** Details at **/

/** Support: [email protected] twitter: @labnol **/

function onOpen() {

var sheet = SpreadsheetApp.getActiveSpreadsheet();

var menu = [
{name: "Step 1: Initialize", functionName: "init"},
{name: "Step 2: Start ", functionName: "init"},
{name: "Uninstall (Stop)", functionName: "removeJobs"}

sheet.addMenu("Website Monitor", menu);

function init() {


var sheet = SpreadsheetApp.getActiveSpreadsheet();

var urls = sheet.getSheets()[0]

urls = urls.replace(/s/g, "").split(",");

var time = (new Date()).getTime();

var db = ScriptDb.getMyDb();

for (i=0; i<urls.length; i++) {{url: urls[i], status:200});

// Setup trigger that runs every 5 minutes



sheet.toast("Google Docs will now monitor your website(s). "
+ "You can exit this sheet!", "Initialized", -1);

function websiteMonitor() {

var db = ScriptDb.getMyDb();
var results = db.query({});

while (results.hasNext()) {

var item =;
var code = -1;

try {
var response = UrlFetchApp.fetch(item.url);
code = response.getResponseCode();
} catch(error) {}

item.status = alertUser(item, code);;



function alertUser(item, code) {

var status = item.status;

// Status unchanged
if (code === status) {
return code;

// Site was up previously but is now down
if ((code === -1) && (status === 200)) {
// Run another check after 1 minutes to prevent false positives
return -2;

// Site was down previously but up on second check
if ((code === 200) && (status === -2)) {
return code;

// Site was down previously and is down again
if ((code === -1) && (status === -2)) {
logMessage(item.url, "Down");
return code;

// Site was down previously but up again
if ((code === 200) && (status === -1)) {
logMessage(item.url, "Up");
return code;

return 200;

function logMessage(url, message) {

var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

var row = sheet.getLastRow() + 1;
var time = new Date();

sheet.getRange(row,2).setValue(message + " : " + url);

var alert = "Site " + url + " is " + message.toLowerCase();

MailApp.sendEmail(sheet.getRange("B3").getValue(), "Site " + message, alert);

if (sheet.getRange("B4").getValue().toLowerCase() == "yes") {
time = new Date(time.getTime() + 15000);
CalendarApp.createEvent(alert, time, time).addSmsReminder(0);


function secondCheck() {

var triggers = ScriptApp.getProjectTriggers();
for (var i=0; i<triggers.length; i++) {
if (triggers[i].getHandlerFunction() == "secondCheck") {



function quickCheck() {

function removeJobs(quiet) {

// Clean the database

var db = ScriptDb.getMyDb();

while (true) {
var result = db.query({});
if (result.getSize() == 0) {
while (result.hasNext()) {

// Delete all Script Triggers

var triggers = ScriptApp.getScriptTriggers();

for (i=0; i<triggers.length; i++) {

// Inform the user, default is "YES"

if (! quiet) {

var sheet = SpreadsheetApp.getActiveSpreadsheet();

sheet.toast("The program has stopped. You can choose Start under Website Monitor "
+ "menu anytime later to resume website monitoring!", "Uninstalled", -1);


// Written by Amit Agarwal [email protected]
// Twitter: @labnol

4 thoughts on “Using Google Docs to check your websites uptime using SMS reminders”

  1. Invariably, this is a helpful information. Its important for the Internet marketer to monitor increase up-time and downtime of the website.

    Time lost in downtime can affect the success of the site. Well, its good to have this tutorial shared.

    It seems easy and thankfully it can be achieved with Google account. Google Docs and the corresponding SMS reminders could be time saving! Thanks for sharing this piece!

    This comment was shared in – the content syndication and social bookmarking website where this post was found and "kingged".

    Sunday – contributor

  2. I actually saw this tutorial on Amit Agarwal of Digital Inspiration's website sometime last year and implemented it on my website and since then i can easily get notified when my site is down so i can take actions to get it running once more.

    it is very important as well to keep an eye on your host's server uptime so as to know how they perform for you to know if you will continue using them or leave for a better hosting.

    I found this post on and also left a comment on it.

  3. Any thoughts as to what this would look like if it were to include other return codes, such as PHP login codes like 300? Has anyone seen versions like this?

Leave a Comment

Scroll to Top