Hey there stranger!

Sign up to get access.

Capture Emails from Website Form to a Google Sheet (Without Zapier)

About this Tutorial

Embed a little HTML into your site to capture Emails straight to a Google Sheet. I've written the apps script and the html and the javascript for you. As easy as copy and pasting. Use my referral link if you choose to use Carrd for this: https://try.carrd.co/kamphey

Featured Formulas

Video Transcript

00:00 Hello, welcome. Thanks for watching this video. We are going to embed a simple form into a website and get some data from that form into a Google sheet.
00:12 Now, I've done all of the coding and all of the JavaScript for you, so we're gonna need some JavaScript. We're gonna need some app script.
00:19 We're gonna have to deploy as a web app, and I'm gonna show you in this video, step by step, all of that.
00:25 But let me just show you what it is. This is a complete test that I did. I'm using card c a r r d.co.
00:32 It's a pretty cheap, I think, $19 a year for landing pages. If you have your own landing page and you can embed html and some Java script then you'll be totally fine.
00:45 You don't need card. But if you don't and you're like, I want to have this for some reason, go check out card and enjoy.
00:53 So, hi, have this form. This is what I created, and I'm gonna just put in a email address, right? We couldn't even put in submit that is going to submit to, it says here, you've successfully registered your email to this Google sheet.
01:12 There it is. So I can do that again. I'm gonna hit back. I'm gonna do andrew@bettersheets.co. Hit submit. And now you see here it is, I it is put into a Google sheet.
01:25 So I've gotten some form information on a website and I've put it into a Google sheet. Now what I'm using it for here is called email to sheets.
01:34 I'm grabbing sort of emails that people are gonna submit, and I would, I would think this is only good for like private groups or certain, like little events signups for events or reminders if you are really like hacking together a newsletter and you're like, Hey, I just need a, a simple form.
01:56 And that's it. Instead of signing up for MailChimp or Convert Kit or Sub, you don't want to do any of those.
02:02 You just want the list. Maybe you want to add a new feature and you're like, Hey, sign up here on this company page.
02:11 And you don't wanna mess with like embedding any thing beyond just a simple form to a Google sheet. This is, these are great use cases for that.
02:20 This so let's get started. So I have on here, once you get access to this sheet, which you should do, if you're a Better Sheets member, you can see below the sheet.
02:31 You can copy the sheet. That's the first step. I would say copy the sheet, watch this video that you're watching right now.
02:36 I'll link to it here as well. And then what we're gonna do is we need to deploy the code as web, a web app.
02:43 So let's go over to Extensions app script and I'll show you a little bit of the code. It's pretty simple once it shows up.
02:51 All right? It's a due post function. Due post. We get the url, we get parameters from the url, and we get the email that is already in the url.
03:02 What does that all mean? It means that we are going to insert all of this code. The last bit here, this script is we're, we're gonna have to put the URL of the web app here that it's gonna, I'm gonna, I've made that so easy for you.
03:18 Don't worry about that. But check out this form. It's just a send email form method post for email input. Email input type submit.
03:29 It has a button that says submit. It has a little form. That is it. If we go back to our sheet, it, this is all of it.
03:37 Over here on, on a card, I have literally gone up here, clicked the plus sign, clicked embed right here. That's all I did.
03:48 I'm gonna delete it now. But that's what I did. And then I selected code here for type, and I pasted the code that I'll show you later.
03:56 That is the whole step. So first things first is we need to get all of this function into a web app.
04:06 How do you do that? You go up here, you click deploy, new deployment, and you can really type any description you want.
04:13 You'll hit deploy over here. It'll say updating the deploy. You can see that I have a few versions, but all you need is this web app url.
04:21 Copy this, hit copy over here, hit copy, click done. We're done with this part. This you don't have to mess with.
04:28 This is just taking that URL that's gonna come in. It's gonna have a parameter of an email and it's gonna say email.
04:34 It's gonna find out what is that email and then it's gonna throw into your sheet. Right here. It's gonna put in the, the sheet called emails of value at the top it's gonna insert a row at the top.
04:46 It's gonna set the value as whatever someone entered and it's gonna enter a timestamp. That's the one extra thing that I added here.
04:53 It's a timestamp if you want that. Alright, now you got the web app deployed, right? That was super easy. That was like a couple clicks, right?
05:02 Go back to the sheet over here on code in C2 paste, paste the code the URL here. What this does is I've given you the entire code for the JavaScript.
05:16 All you need to get just that simple form and we're inserting substituting where I put in double like a bracket web app deployment url.
05:26 It's now gonna replace it with what's in c1. So you don't have to figure out where to put it. Just click one, select this c4 and this is the code you I embed done and dust it for you.
05:40 You can even send this to a developer and say, Hey, put this in. They can read this and they'll know exactly what to do.
05:47 In fact, if they wanna change this, they'll know how to change it. Add some CSS styling. Maybe they already have a form and you just want the email address to be captured.
05:57 They'll know how to take this and edit it for you very, very quick. Or you can just say, Hey, I just need a form that says, su submit your email on this page.
06:07 That's it. And then give 'em this and they'll be fine. Again, with card, we can do it ourselves. We can paste into this code, that entire thing.
06:17 Everything that I've written here for you, it's just a form id. It has a label, it has an input name, it has a submit button.
06:24 And then the script is a JavaScript function that says, just go take whatever information is in this form that somebody fills out, send it to this u url with the parameter email and then the, the data, what that is it.
06:39 We are done, done and dusted. And you're gonna have, you're gonna be able to hits done. You're gonna be able to click up here, publish changes, and it's all going to work, right?
06:50 Well, you can email me if you have any issues. Absolutely andrew@bettersheets.co. And I wanna express to you a few other use cases for this because that video is really fast, right?
07:02 We're seven minutes in and we have a little bit of app script. I can go through that. You can also take the course here on better sheets called Spreadsheet Automation 1 0 1.
07:11 We actually don't go into do Post. I'm gonna be creating, hopefully creating a new course that goes into creating web apps like this.
07:20 Very, very simple, but if you take the course spreadsheet automation 1 0 1, you should be able to, at the end of that, pretty much read a lot of this.
07:28 You might not know exactly what content service is cuz we don't go in it. We'd use mail app, we use spreadsheet app, and you're like, what is content service?
07:36 But you'll know where to look this up, where to figure out what content service is and you'll know what return is.
07:44 You might know this. Try-catch. I only did that because there were some times when I was getting an error and I was like, I just need to know what the error is.
07:53 And just like in spreadsheet automation 1 0 1, I talk about how you need to know what the error is and know why you get the errors to be able to fix 'em.
08:01 Seek errors if you remember that from spreadsheet automation 1 0 1. So any questions, email me, Andrew, better sheets.co. I hope you use this.
08:12 I have a couple more ideas of how to use it, right? What it really is, is any text. So I would advise you not to put this on a, any public facing site for very long.
08:24 I would put it up and take it down. So any kind of like short term events are great for it.
08:29 Again, if you're running a company if you have a service based company or you have a SaaS company and you're like, ah, I just want to get like some signups for like a week, we have like a waiting list.
08:39 You're like, I don't really wanna set up a MailChimp. I don't really wanna set up a convert hit. I just want to capture email addresses.
08:46 Maybe it's a new feature that you're rolling out or a up upgraded version. You're like, Hey, do I want to create a pro version?
08:53 Hey, anyone who wants to sign up for a pro version, I've written out on a, a simple card here, c a r r d.co.
09:00 I created a simple card. Be a little like, just put in your email address and we'll get back to you with more information when it's launched, right?
09:08 Great for product hunt launches, right? Sign up and we'll remind you of our product Hunt launch. Sign up for an event this weekend and great.
09:16 Get it right into a Google sheet. Sign up for a course, right? We're gonna run a little webinar and you know, you don't wanna sign up for Zoom.
09:22 You have maybe something else and you don't have a registration link. Put this in, send emails to those people who registered for it.
09:29 Capture that, but it also does not have to be email addresses. Here, let's do Hannah, Let's just hit submit and see what happens.
09:47 You, there it is. So I think I hit it button twice. You can capture names, data. If you have like a one thing, what is it called?
10:00 You, you have a one question survey. This is great for that. Have an entire webpage devoted a little sub-domain devoted to that survey.
10:08 And then say, enter the information. Enter the answer. You're gonna have timestamps in the answer. You might not know who said what.
10:14 So maybe it's like an anonymous survey. Easily. You can capture any data like that. If you find that you're trying to capture some certain information, some data that isn't working with this, let me know.
10:27 Happy to try to problem solve with you and, and figure it out. So in summary, we can capture email addresses with a very simple submit form.
10:36 Even one word or one question. Surveys can be used. This can be used for. What you're gonna have to do is watch this video.
10:43 Again, if you wanna get the step by step, you're going to de copy this sheet to your own Google Drive.
10:49 You will deploy the app script as a web app. You'll get that url. You're going to put that URL here on code C one.
10:59 This will get you that JavaScript, the form and the script. All of everything, not the JavaScript. Oh my God. The H T M L.
11:05 It'll get you the H T M L and actually yes and JavaScript to embed on your website. Again, you can embed it on a card.
11:13 You can embed it on any, any page builder that has embed embedable html or you can send this to a developer and they'll know exactly how to use this.
11:24 Just send them this final one, not this center one that has this web app deployment URL that won't work. You will actually have to put the URL in here.
11:32 So this second one will do it for you. And I do wanna point out I use the sub substitute filter here or filter formula here.
11:41 And, and I think it's a really cool use case of substitute where I was like, I know the, all of the other stuff and I just wanna subs get this one thing inserted into here.
11:51 I think that's a pretty cool use of substitute. But other than that we're not using any other features other than app script and the web app deployed.
11:59 And then, oh, if this is so cool, if you have any other quick, please feel free again to email me any questions.
12:06 I'm happy to help you work through this if you want any other features added to this as well. I am considering creating a product of this where it has a little bit more features or might have some more functionality to it.
12:20 Like adding more than one thing or an email or having some ki oh you might have to, if you do use it for like email signups, like you wanna sign up a an email list I would recommend adding CAPA or some other thing to your form.
12:37 Not in here, but on your webpage. Even show, don't even show that form until the CAPA's done. That's the on the last thing I would recommend because this is very insecure, but also it's not really going to get into your internal system.
12:52 So this might be very, a really good use case where you don't want people entering any information into your productions or database or anything.
13:00 You're like, ah, I just want it in a Google sheet. Gra, great use this. Thanks so much.


Sheet Stories / Video Notes + ADDED: Email Notifications



ChatGPT Clone in Google Sheets Part 2

Create an Internal Google Sheets Add-on

Why Different Cell References in AI Integration in Sheets?

Show Sheet Tabs Based on Edit

Add Title Case to Google Sheets

Getting Started Coding in Apps Script

How to Power Testimonials with Google Forms and Sheets

Seek Errors When Coding Apps Script

Think Like a Programmer: Develop The Mindset of an Apps Script Coder

ChatGPT Clone in Google Sheets Part 1

Embed a Number in a Website from a Google Sheet

Create Navigation Like A Book or Presentation

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet


Hold a Giveaway Raffle in a Google Sheet

Capture Emails from Website Form to a Google Sheet (Without Zapier)

Embed a Headline in a Website from Google Sheets

Quickstart Tutorial OpenAI API in Google Sheets

Create a new Spreadsheet from just a Name in a Sheet.


Bjarne Asks: Can I show the Last Time of the Last Edit in a sheet?


Email Yourself a Cell from a Google Sheet, Every Day

OpenSea Data Inside Sheets

Create an Email Campaign Stats Calculator


Twitter App Clone in a Google Sheet

Dylan Asks: How to Automatically Delete Rows If Cell Contains Value

Highlight Row as You Move Your Cell Selection

Create a Timer with Apps Script

LinkTree in a Google Sheet


Password Protecting Data In a Google Sheet

Automatic Weekly Backup of Google Sheets

Create a CPM Custom Function (Create Better Calculators!)

Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script


What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users

Sync Two Tabs Without ImportRange()

Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.


Password Protecting Data In a Google Sheet Part 2 The Basics

Benoit Asks: How to Convert Case


Learn to Code in Google Sheets, For Programmers

Add a Checkbox to Turn on Dark Mode


Write Your First Script


Find Keywords in Any Column. Create quick search dropdown to find keywords


Basic CRM - Add a Powerful Script To Move Row Based on Status

How To Improve: 1,000 Business ideas: Business Idea Generator


Let's Make a Bookmarklet!


Troubleshooting Bitly in a Google Sheet Script


Unique Features - Design a Better Dashboard Part 2


How To Set Up Stripe Webhook to Google Sheets with Google Script


How to Edit a Macro


Sheet Stories / Video Notes + Clear 24 Hour Old Videos


Add A Timestamp to Task Lists (without Now Formula)


Make your Custom Functions Like Native Functions | Custom Function Autocomplete


Create a Changelog Between 2 Cells Custom Function | To learn Double For Loop


New Syntax for WhatChanged Formula in Google Script


How to Record Macros


2 Ways to Delete Lines Quickly (CAREFUL, it's a script!)


Deep Inside Dark Habits Google Script


How to Trigger Macros Daily


5 Ways to Create Coupon Codes | Create UUIDs

Create a Radio Button From Checkboxes Using Google Apps Script