Jake Fairbairn
Jake Fairbairn

Reputation: 223

Google Scripts Web App: How to View User Session

I am using Google Apps Script (GAS) to host a web app. I would like to be able to see the "session" so that if the user opens the page more than once, I can see the session information for the given user/browser. I currently control all that on the client side, but it would be MUCH neater if it were all on the server side (for example, what if an error occurs when fetching the page?). This is especially important for properly handling user logins... it's so ugly handling it all on the client side.

I'm used to applications like ASP, ASP.NET, and PHP which have sessions and session variables. Does GAS have anything like that for their web apps? Thanks!

EDIT: To be clear, I'm running the web app as Me, so I can't tell who is logged in by their Google account. Users don't need a Google account to access the page.

Upvotes: 0

Views: 802

Answers (1)

Spencer Easton
Spencer Easton

Reputation: 5782

Check out the video on using google analytics in google apps script. It was presented by one of the top App Script developers who uses this technique in his tools. It allows tracking users actions/errors individually and in aggregate.

https://youtu.be/r_S7NeidzI0?t=1869

Upvotes: 1

Related Questions