Reputation: 51
My girlfriend has a small business making cupcakes, cookies, cake pops, etc. and I want to create a relatively simple website for her. The website would have several pages with photos of different items people can order. Essentially I would like the site to act like a shopping cart, but instead of placing an order, it is just for getting a quote. My idea is that whenever they add something to the quote, the apps script will save the details to a spreadsheet. When they have finished and want to get their quote, they click a submit button which will send an email with the details that have been stored in the spreadsheet.
I can work out how to do almost everything required, except that I can't work out how to get some kind of session ID to link the records that I'm adding to the spreadsheet. Is there some way to retrieve a unique session ID that would accomplish what I'm after? Is what I'm doing even possible with Google Sites and Google Apps Script? Has anybody successfully done something similar? Any advice would be much appreciated.
Upvotes: 0
Views: 1471
Reputation: 7858
You can track the user's email address and use it as the key if they are a signed in Google user, and perhaps track the last time they've visited the script as well if you want "sessions" to clear after 24 hours, etc. There is no way to get a key for non-signed-in Google users. Also, consider UserProperties or ScriptDb for this instead of a spreadsheet.
Upvotes: 4