4

I have a container-bound Google Apps Script script.

I have the script deployed as a web app, set to execute as me with access granted to Anyone, even anonymous.

However, when I launch the script editor (from the Google Sheets Tools menu) and then choose "View -> Executions" I can see time driven and onEdit executions, but no Web App executions.

This section of Google's documentation suggests that I should also be able to see webapp executions:

The Execution type column shows what initiated the execution. Values include:
- Add On. The execution originated from an add-on.
- Execution API. The execution originated from an invocation of the Apps Script API.
- Time Driven. The execution was caused by a time event.
- Trigger. The execution originated from a trigger source.
- Webapp. The execution originated from a deployed web app.
- Editor. The execution originated from the Apps Script editor.

Does anyone know how to make them display or why they wouldn't display?

TheMaster
  • 45,448
  • 6
  • 62
  • 85
Iain Dooley
  • 308
  • 2
  • 9
  • Are your visitors anonymous or logged in? I am able to view WebApp executions for a container-bound when I visit my published [webapp link](https://i.imgur.com/DqbTVLZ.png). However, if I visit anonymously (i.e. private browser, no sign-in), then transcripts are unavailable. – tehhowch Mar 21 '18 at 04:08

1 Answers1

2

The Dashboard refers to https://script.google.com/home, not to the Script Editor's "View Execution Transcripts"

After clicking "My Executions": My Executions

After selecting a project:
A Selected Project

These transcripts are not the same as the method-by-method call stack that is available from the Script Editor.

Edit: Per documentation (and confirmed via experiment), executions initiated by anonymous users are not tracked, in graphs (mentioned in documentation), or in the Execution history (not documented):

  • Users The number of unique user (accounts) who ran the project one or more times over the specified time period. Anonymous users are not tracked and therefore are not reflected in the user count or graphs.
tehhowch
  • 9,645
  • 4
  • 24
  • 42
  • Yes that's what I'm referring to. I'm not referring to View -> Execution Transcript, I'm referring to View -> Executions which is analogous to going to the dashboard you show above then clicking "My Executions". It doesn't show webapp type, only time-driven and onEdit – Iain Dooley Mar 21 '18 at 03:35
  • @IainDooley I believe the issue is that your webapp hits are coming from anonymous users. – tehhowch Mar 21 '18 at 04:11
  • I have specified that the script should run as me though. Isn't it the case, that it will execute as me but allow anonymous access? In that case, is there a way to see executions run by anyone (not just me?) – Iain Dooley Mar 21 '18 at 04:53
  • I've done the same for my webapp that i used to get the image (on main question thread). When logged in, the executions appear. If anonymous, even though the triggered script runs as me, the execution history is not generated. A way around this is to log hits to a spreadsheet or other datastore - for example, in that webapp's `doGet`, I append the timestamp in a new row to a spreadsheet, and can get time-based statistics by querying this sheet. – tehhowch Mar 21 '18 at 05:01
  • unfortunately that doesn't deal with the potential that there are too many requests and the web app doesn't serve them, or if there is some error that prevents the entire thing from executing correctly. I want to be able to see what percentage (if any) of web requests are failing. – Iain Dooley Mar 21 '18 at 05:06
  • @IainDooley nope, it's just a simple workaround that works for me right now. You'll have to reach out to Google Support or file an enhancement request on the apps script issue tracker to get raw execution count statistics for even anonymous webapp hits. For those who are in a domain (e.g. g suite), where everyone is logged in, anonymous executions clearly aren't really a priority. – tehhowch Mar 21 '18 at 05:22
  • I called G-Suite support today to ask about this, who said they don't support google apps, and that I should submit a question on stack overflow ;) – Iain Dooley Mar 21 '18 at 10:20