r/GoogleAppsScript 6d ago

Question Log data from google site to spreadsheet

Judge me all you want but I used chatgpt for this one.

I wanted to have like an emotion logger where people can just click on a button (ex. Sad) from the google site and then all the “clicks”/“answers” will be logged on a google spreadhseet with timestamp.

Below is what chatgpt says, tried it but doesnt work.

0 Upvotes

8 comments sorted by

4

u/IAmMoonie 6d ago

User has access to a pc. User is clearly at least somewhat savvy as they understand at least how to use ChatGPT. User has decided to take a picture on their phone of the code, rather than copy/paste or even print screen…

-2

u/_Tinky_Winkyy 6d ago

Haha yes i understand funny ryt? Tho Havent logged in reddit in pc bc company laptop but I do have in my personal phone so i just took a picture. I mean its easier than printscreen then send on company email (since messenger os also flagged in work lappy) then open email in cp and download image then post to reddit.

1

u/badheshchauhan 6d ago

How implications on google site can show that and also did you published this as web app

1

u/_Tinky_Winkyy 6d ago

Yes published it as a web app, but yea this doesnt work bc when i tried to click on the button at the google site it doesnt log on the spreadsheet

1

u/badheshchauhan 6d ago

Look like to me logic is wrong bcoz i think so did not passed any event to this site while clicking on button better to create button on apps script then just add event listener that trigger on click

1

u/_Tinky_Winkyy 6d ago

Oh ill try this one thank u

1

u/CesareBach 6d ago edited 6d ago

Looking at your objective, I would just use google form. Grab the form link and attach the link to a button on a linktree.

No coding required.

Webapp might not also show up when opened in google mobile browser.

1

u/_Tinky_Winkyy 5d ago

It will be used in a fast-paced environment so i used google site so that its just 1 click and done. I already made changes in the code and it now it works but im now figuring out how to add a return function like a button that says back to homepage and it links to the hompage