Recently I wrote a Google Script Web App that generated JavaScript code and needed to run on a Google Site. Even though I tested everything both on my computer and on my phone I didn’t realize that if someone tried to access the same code while logged in as a different Google user they would get an error saying the following:

Google Docs encountered an error. Please try reloading this page, or coming back to it in a few minutes.

To learn more about the Google Docs editors, please visit our help center.

We’re sorry for the inconvenience.
– The Google Docs Team

Needless to say, this error is quite annoying especially since when investigating this further all it really tells you is that it is a 500 error. Fortunately I had encountered this before and remembered that this occurs when the person who is trying to access the Google Script Web App while they are logged into another Google account. On the other hand this error doesn’t seem to occur when you are not logged into a Google account.

The Solution

Let’s say that the Google Script Web App that is to be accessed is at https://script.google.com/macros/s/ABcdefgHi0JKlmn1OPQ23RS4TUVWXYzA_5BCdEfGHIjklmnO6pq_Rs7tuV8WxyZAbc9defg0hi/exec. In order to make this Web App available to anyone regardless of if they are logged into their Google account or not you can insert “a/gmail.com/” right before “macros/“. In other words, https://script.google.com/macros/s/ABcdefgHi0JKlmn1OPQ23RS4TUVWXYzA_5BCdEfGHIjklmnO6pq_Rs7tuV8WxyZAbc9defg0hi/exec would become https://script.google.com/a/gmail.com/macros/s/ABcdefgHi0JKlmn1OPQ23RS4TUVWXYzA_5BCdEfGHIjklmnO6pq_Rs7tuV8WxyZAbc9defg0hi/exec.

It is really just that simple. Hopefully this easy solution helps you out and as always, happy coding!!! šŸ˜Ž

Categories: Blog

Leave a Reply

Your email address will not be published. Required fields are marked *