Google Apps Script: WebApp [updated Dec 2021 – With thanks to Greg S]
In this tutorial, we will cover how you can get a unique temporary access key from a user accessing your WebApp that lasts for 30 days.
Temporary access keys allow you to track users as they use your WebApp over time while still providing anonymity to the user by providing only an access key to that user. Rather than, say, use their name or email address.
Why is this important? Well, you might want to limit the number of times a user submits a form on your WebApp. If you can get a user’s access key unique to them then you can store the number of attempts by the user and check it before the data is submitted.
For example, in a previous post, we created a chain story that we might want to limit the number of times our users contribute to our story to once a day.
NOTE! This tutorial is pretty much standalone. However, it will require some basic knowledge of Google Apps Script WebApp and HTML. Don’t worry if some basic setup parts are not covered in this tutorial, I’ll link to how to do these bits if you need some more instruction.
Let’s take a look at what we are going to make: