Read a Random Post

How-To: Get Email Alerts When Any Google Document is Updated


Consider you are a teacher working on assignment question paper which you have created in Google Docs and shared with your students. You want to automatically send out notification whenever you edit the document Or say you’re a Project manager working with your associates to prepare a presentation and wants to be informed when updates are made.

Google Docs does have notification feature but it’s supported only in spreadsheets. But what when you want this feature in a Google Document, Slides, Form or Drawing?

You can use add-ons/extensions to monitor file changes but they are browser restricted and you should be physically available before the system to get notified of changes. Privacy is another big concern. How about creating our very own solution with Google Script?

Get Email Notifications When Any Google Document is Updated or Modified

How To Get Email Notification When Any Google Document is Modified?


Meet Google Doc Monitor script which will help you monitor literally any file in your Google Drive account and send automatic email notifications to any recipients you want whenever it’s edited or updated.

Let’s get started.

1. Finding ID of File you Want to Monitor

  • Log in to your Google Doc account.
  • Open the file you wish to track for updates.
  • From address bar note down the unique ID of the file.

Example URL: https://docs.google.com/document/d/1GE8N1Jv-eDquicjb5DrnO91SkNVY-Or1M0DKb_UZQtc/edit
File ID: 1GE8N1Jv-eDquicjb5DrnO91SkNVY-Or1M0DKb_UZQtc

How to Find File ID in Google Docs

2. Installing the Script

  • Click here to open Google Doc Monitor Script (Version 2). Next select File-> Make a copy
  • Select Tools-> Script Editor. Then Resources-> Advanced Google Services. Scroll down and toggle Drive API to on. Click on the Google Developers Console link on the bottom. Select Drive API under Google Apps APIs. Press Enable API. Close the page. Finally click OK from the previous pop-up.
  • How Enable Drive API from Advanced Google Services

  • Now configurations are all done. Go back to the sheet and select Google Doc Monitor menu-> Authorize. Click continue and then Accept. This is an one time activity.
  • Copy, paste the File ID which you noted down previously in cell C6.
  • Enter email id of recipients to whom update notifications should be sent in cell C8. You can enter multiple id’s separated by comma.
  • Note: By default alerts will be sent to all editors of the documents. If you don’t want to send to any additional people other than editors just leave the cell C6 blank.

    Get Email Alerts When Any Google Document is Edited

  • Select Google Doc Monitor menu-> Initialize
  • Finally select Google Doc Monitor menu-> Start Monitoring
  • That’s it. Here on the concerned file will be monitored for any changes or updates and notifications will be sent as and when it happens. Polling is done once per hour.

    Note: You can close the sheet once setup is done, monitoring will be done behind the scenes.

So did it work for you? Drop in if you have any queries or feedback’s.

88 Comments For This Post I'd Love to Hear Yours!

  1. Naveen says:

    Hello,

    Thats really a great thing which i was looking for a long time.
    But could you please tell me whether it can be applier for monitoring the folders, sub-folders and its file contents also ? or it is only possible to monitor the direct files ?

    Thanks in advances
    @NAVEEN

  2. Shana says:

    I’m having trouble with this. At the very end, when I choose “start monitoring,” it gives me the error message “The value you passed to everyMinutes was invalid. It must be either 1, 5, 10, 15 or 30.” How should I proceed?

  3. Shana says:

    thanks!

  4. Jon says:

    It appears by authorizing this document it gives access to all of my google documents. Am I reading this incorrectly? Seems like a large privacy concern.

  5. Katie says:

    What a great idea! Is there a way to set up notifications for just one editor of the document? Or does it have to be all editors?

  6. Carol A says:

    Seems like you are asking for a LOT of access into our documents when I push the authorization button. Can you tell me specifically what you will have access to if I authorize the script?

  7. kidmar says:

    I can’t get it to install.
    When I click on “Initialize” it gives me an error:
    Sorry! Error ReferenceError: “DocsList” is not defined. Occurred. Report @ http://techawakening.org/?p=3055

  8. spoko says:

    Getting the same error kidmar mentioned. Would love to try again once that’s fixed.

  9. JHermann says:

    How often do the notifications come? I loaded this a couple of hours ago and it’s still not sending any notifications when my co-workers make changes on the trigger document.

    • Updates are sent once per hour. But I believe there was a bug which was preventing updates from being sent out. It’s fixed now. Please make a new copy of the sheet and start over.

      Let me know how it turned out.

  10. samuel says:

    I’m using your great Google Sheet to get notification of documents changes. However, when I click on Initialize I get the following error:

    “Sorry! Error Exception: Access denied: DriveApp. Occurred. Report @ http://techawakening.org/?p=3055”

    Thanks

  11. matt says:

    For me, no errors, everything said it executed successfully. However, i’m not receiving any e-mails from it at all.

  12. Ronak says:

    Hi,

    Will user know what content is edited or he has to browse though the complete document.

    Thanks,
    Ronak

  13. greg says:

    Hi, Im trying with some docs, but it’s not working for me, no errors, I’m initializing the script, then changing a file, but no notifications received … 🙁 address and file ID verified twice.

  14. Jake says:

    I followed the instructions but my co-workers and I do not receive any email notifications.

  15. Dave says:

    How do I turn this off? It has sent me approximately 20 or 30 notices of changes made only one time several weeks ago. It works and works and works! If it only worked once per change, then I’d be stoked.

    Thanks so much,
    Dave

    • That’s odd. Am hearing it for the first time. The moment a new updated is made, flag is reset hence updates will not be sent then on. You can always turn off the app by selecting 4. Stop Monitoring.

      Anyhow am pushing version 2 of this app, you can try then. Thanks!

  16. Billie JO says:

    I’m not receiving the notifications. Everything sets up fine. No errors, but when I test it I receive nothing.

  17. Bert says:

    Hey! Tried the App and it works great! Only glitch is notifications are delayed by more or less 40 mins. I think it has something to do with timezone (maybe?). Notification sent to me indicates files was edited at Jan 04 2016 22:46:19 GMT -0600 (CST). But I edited the files at Jan 05 2016 12:46:00 UTC +0800 (CST). Anyway to address this?

    • Please update your time zone from Tools-> Script Editor-> File-> Project properties. And do spread the word. Thanks!

      • Bert says:

        Thanks! Will try this ASAP and give you guys feedback!

        • Bert says:

          Just tested and it works perfectly. Got an reasonable delay of 2 mins which I guess accounts for the time it compiles the changes made in the file. Would there be any conflicts if I were to use this script on multiple files?
          Thanks again!

          • Nope. You can create as many new copy of the script and track any number of files you want. And do share the word.

            If you really loved our app, buy us a coffee – http://techawakening.org/go/donate 🙂

          • Scott says:

            Yikes! Yeah, it’s rough to think committing multiple copies of files to track multiple documents. Name them “File A monitoring control file”, “File B monitoring control file”, etc.?

            Spreadsheets are simple to code for arrays and the like. This stuff belongs in a tabular form, for as many files as one wants.

            Time to refactor this thing. 😉

  18. hotDesksMD says:

    Great tool. Simple and does just what I needed it to do. Thanks.

  19. Colorado says:

    Hi, this worked great when I set up a test doc while logged in on my personal Gmail account.

    I use shared docs for work though, and we all log into company Google mail accounts via our company’s network. When I create a test file using my work account, I get the error “Sorry! Error Exception: Access denied: DriveApp. Occurred. Report @ http://techawakening.org/?p=3055” when I try to initialize the Google Doc Monitor. I am guessing it’s because I’m logged in using the company credentials. Is there a way to edit the script to get it to work on a corporate network?

    Thanks

    • P Rozal says:

      We’re facing the same issue. It works fine on a personal google drive account, but not on the corporate google drive. No change notifications were ever sent.

      Were you able to get this working for you through your corporate account?

      Thanks

  20. Ana says:

    Thanks so much for this! I was wondering if there is a way to make it so that each recipient only receives one email each time the sheet is updated. Currently each recipient is receiving two email alerts each time the sheet is updated. Thanks again.

  21. saps ibubapa says:

    never thought it is even possible to get notification if there is edited in doucument. thank for this article.

  22. gmadrone says:

    Hi,

    A co-worker and I tried to set up the script. We followed the instructions and neither of us has been getting any notifications. When I ran the script against a spreadsheet, here is the execution output. The URL is correct, but it doesn’t seem to be seeing my updates. I’ve made updates and then ran the script from the script editor, but no notification email is being sent. Can you see the problem? Thanks.

    [16-03-24 16:21:36:016 PDT] Starting execution
    [16-03-24 16:21:36:028 PDT] SpreadsheetApp.getActiveSheet() [0 seconds]
    [16-03-24 16:21:36:029 PDT] SpreadsheetApp.getActiveSpreadsheet() [0 seconds]
    [16-03-24 16:21:36:103 PDT] Sheet.getRange([C6]) [0.073 seconds]
    [16-03-24 16:21:36:146 PDT] Range.getValue() [0.042 seconds]
    [16-03-24 16:21:36:235 PDT] DriveApp.getFileById([1thjW8BVGudsRbyCYJBfMUCOjMfr_WpYTtzfEtlMqahI]) [0.086 seconds]
    [16-03-24 16:21:36:315 PDT] File.getEditors() [0.079 seconds]
    [16-03-24 16:21:36:315 PDT] File.getUrl() [0 seconds]
    [16-03-24 16:21:36:316 PDT] File.getName() [0 seconds]
    [16-03-24 16:21:36:318 PDT] Logger.log([DriveUser,DriveUserhttps://docs.google.com/a/google.com/spreadsheets/d/1thjW8BVGudsRbyCYJBfMUCOjMfr_WpYTtzfEtlMqahI/edit?usp=drivesdkAll CR submitters, []]) [0 seconds]
    [16-03-24 16:21:36:318 PDT] File.getLastUpdated() [0 seconds]
    [16-03-24 16:21:36:319 PDT] PropertiesService.getUserProperties() [0 seconds]
    [16-03-24 16:21:36:336 PDT] Properties.getProperty([timeStamp]) [0.016 seconds]
    [16-03-24 16:21:36:341 PDT] Logger.log([Thu Mar 24 2016 18:20:14 GMT-0500 (CDT) null, []]) [0 seconds]
    [16-03-24 16:21:36:342 PDT] Execution succeeded [0.194 seconds total runtime]

  23. gmadrone says:

    Hi,

    I’m following up on my previous post where I was not getting notifications. I put in some log entries and find that the line:
    var previousTimeStamp = userProperties.getProperty(‘timeStamp’);
    always returns null, so the if statement below is not going to get executed:
    if (previousTimeStamp) {
    if (Date.parse(currentTimeStamp) > Date.parse(previousTimeStamp)) {
    Do you know why previousTimeStamp is always returning null? Thank you.

  24. Siva says:

    Nice and handy script. Thanks a lot.

  25. Isabel says:

    Hello, when I hit Initialize, I get this error: Sorry! Error Exception: No item with the given ID could be found, or you do not have permission to access it. Occurred. Report @ http://techawakening.org/?p=3055

    The ID Is definitely correct and I have editing rights on the document.

  26. Aly J says:

    How long does it take for the notification email to come through? I’ve followed all steps correctly and still haven’t received any notification by email.

    Thanks,

  27. Jason says:

    This has been working well up until recently it just stopped. I think something changed on the google side. Can you help me to troubleshoot the why.

  28. Kevin says:

    Bonus Tip: How to Monitor for Folder Changes in Google Drive? The link is currently down

  29. anubhav says:

    Thank you so much for sharing this knowledge it could be helpful for us

    Regards
    Anubhav

  30. Delia says:

    Hi,

    I would like to know how I could do to send notifications only to the mail filled in the sheet and not to all editors of the documents.

    Thank you very much.

  31. Carly Penland says:

    Great Article. article , I am thankful for the facts ! Does anyone know if my assistant might find a blank a form form to complete ?

  32. kiruxo says:

    Great thing, one question – is it possible to change notification period.
    like this?
    ScriptApp.newTrigger(“montiorFile”).timeBased().everyMinutes(1).create();

  33. Brian Pugh says:

    Will your script send notifications of multiple docs?

    If it does, where to I paste the doc ids?

    Thanks for a great script!

  34. traci says:

    THIS.WAS.AWESOME.

  35. Angstony says:

    Oops, there was a typo in my previous post’s email address.

  36. Angstony says:

    Is it possible to change the email’s ‘From’ address to something that won’t get a reply, like say, ‘norelpy@mydomain.com’?

    Thank you so much for this, by the way. It’s almost perfect apart from getting unwanted replies to my gmail despite telling everyone it’s just for notifications and they shouldn’t reply to it.

  37. Leo says:

    Seems the link under “bonus tip” is broken. Could you check this? Thanks!!

  38. Mo says:

    Cool tool!
    Question: When I go to Authorize, I get the alert message:
    Techawakening.org needs your permission to access your data on Google.

    Does this mean that you will actually have permission to access my data?
    Is there a way to change this to replace Techawakening.org with my user name?

    Note: I’m not trying to avoid giving you credit… just don’t want the code to have permission to access my files.
    Many thanks,
    Mo

  39. Gabriel says:

    Hi!
    How can I test the app?
    I was waiting for the last two hours and received no notification after the document was modified.

    Thank you.

    • DrH says:

      I second your comment Gabriel — thanks.

      In contrast to what is suggested in the instructions above (under heading “2. Installing the Script”, “Click on the Google Developers Console link on the bottom”), at that step I didn’t see a “Google Developers Console link” but *did* see a “Google API Console” link and therefore clicked that one.

      From that point onwards I notice(d) multiple differences with what is suggested in the instructions above: in the resulting view, I couldn’t find (a link/heading?) “Google apps API’s”, and therefore pressed the button “API’S EN SERVICES INSCHAKELEN” [in my (Dutch) version of Google Chrome “Version 60.0.3112.101 (Official Build) (64-bit)”] instead. In the resulting view, “Drive API” was listed under “G Suite API’s”. After “[s]elect”ing “Drive API” there indeed, in the resulting view I wasn’t sure whether I’d still have to change something there — I pressed the “OK” button as well indeed. Then I continued to try and adhere to the instructions above as much as possible, but like Gabriel I haven’t received notifications of Doc updates.

      I am wondering whether I would need to obtain certain ‘additional’ rights still, e.g. by obtaining a “Google Developers” [account?] indeed, and/or/a.k.a. register for the “Google Cloud Platform”…?

      H.

  40. Silvering says:

    Hi there,

    I do not have edit permission on a document but I do have viewing access to it. I have installed and activated the script and so far there seems to be no problems (errors etc.).

    Obviously I won’t know if this works properly until the actual editor makes a change, but I thought it would be a good idea to check if anyone else has tried this and whether they’ve gotten emails when updates were made?

    Basically, I have set up this script on a document I do NOT own, and that i do NOT have edit permission on so… Will it still work?

  41. Mary Matteson Hardin says:

    Does this still work? I do not get notifications.

  42. Gan,

    We don’t have any access to your data. It’s accessible only to you.

  43. Jeremy Smith says:

    I am getting the following error…

    “Sorry! Error Exception: We’re sorry, a server error occurred. Please wait a bit and try again. Occurred. Report @ http://techawakening.org/?p=3055”

  44. Carlos Estrada says:

    Still working?, I´ve done all the process and it is succesful, but I don´t get notifications

  45. Carlos Estrada says:

    Still working?, I´ve done all the process succesfully but I don´t get notifications

  46. Keith says:

    thanks for the process!

    question.. can you make it so that you get an email right after you make the edit to the doc? Or, like 1 minute instead of 1 hour?

    thanks!

  47. Keith says:

    Is there a way to be notified at 1 minute instead of an hour?
    How would the code need to be edited?
    Thanks!

Leave a Comment Here's Your Chance to Be Heard!