Exporting Leads from any Landing Page to Google Sheets..

Mahmoud Ashraf
Nov 4 · 3 min read

As a product designer, part of my job is generating landing pages for the product that I’m working on, also this is a repetitive task which would consume too much time if it was your first time, or never done it before.

So how can you export all the leads to a sheet without using any premium tool, in simple steps? I made my research to solve this, succeeded to get it done many times and it was EPIC! Here i share with you how to get there faster as i have done!

Follow those steps to make this happen :)

1. Setup you google sheet file

Open google sheet > create new sheet,

and then start to name column for each form field you will be collecting and make sure that the name of the cell in the spreadsheet is match with the name of the form input. It’s case-sensitive, so choose your names carefully!

2. Configuring google script

Now let’s get started to run google script so

  • Open tools > script editor

It will open for you a script editor, clear all and make a copy/paste of this scrip

Save the script and give it an appropriate name,

  • Then go to the Run > Run function > myFunction
  • And go to the Run > Run function > Setup

and you will be asked to give google scripts to use your Google account.

Select you email and confirm it then give access..

Once you’ve given your authorization,

  • Go to the Publish > Deploy as web app

You will be presented with the URL for your web app. This is where we’ll be sending our AJAX request so copy that URL and save it for later.

3. Open your landing page HTML code

There’s no need to do anything fancy with your form — just make sure that each input’s name matches the name you used as column names in your spreadsheet.

Make sure the name of each input matches the name of each column in your google sheet.

4. Run JavaScript code to your landing page

Finally, we’ll connect our HTML form with our Google Script with a little JavaScript/jQuery. Nothing is too crazy here, either. We’re preventing the form from submitting normally and instead constructing an AJAX request to the URL for our web app/script that we obtained earlier.

5. Testing landing page form

Finally, it should be working now! Now you can make this for every landing you create , it might take some time at first, but it is really worth it!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade