Automation
Automating Lead Follow-Up with Google Sheets and Apps Script

The faster you respond to a new enquiry, the more likely you are to win it. Yet many businesses still copy leads from emails into spreadsheets by hand. In this guide you will build a simple, free system with Google Sheets and Apps Script that captures every website lead, alerts the right person and sends the lead an instant confirmation.
What you will build
- A website form that sends leads to a Google Apps Script web app.
- A Google Sheet that stores every lead with a timestamp.
- An email alert to the right team member based on the service requested.
- An automatic thank-you email to the lead.
Step 1: Create the sheet
Create a Google Sheet with a tab named Leads and these headers in row 1: Date, Name, Email, Company, Service, Notes, Owner.
Step 2: Add the Apps Script
In the sheet, open Extensions → Apps Script, delete the sample code and paste the following. Replace the example email addresses with your own.
function doPost(e) {
const data = JSON.parse(e.postData.contents);
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Leads');
const owners = {
'SEO': 'seo@yourcompany.com',
'Google Ads': 'ads@yourcompany.com'
};
const owner = owners[data.objective] || 'hello@yourcompany.com';
sheet.appendRow([new Date(), data.name, data.email, data.company, data.objective, data.notes, owner]);
MailApp.sendEmail(owner, 'New lead: ' + data.name,
'Service: ' + data.objective + '\nEmail: ' + data.email + '\nNotes: ' + data.notes);
MailApp.sendEmail(data.email, 'Thanks, we received your request',
'Hi ' + data.name + ',\n\nThanks for reaching out. We will get back to you shortly.\n\nThe Team');
return ContentService.createTextOutput('ok');
}
Step 3: Deploy it as a web app
- Click Deploy → New deployment and choose Web app.
- Set “Execute as” to yourself and “Who has access” to Anyone.
- Authorise the permissions and copy the web app URL.
Step 4: Connect your website form
Send your form fields to the web app URL with a small piece of JavaScript. Using a plain-text content type avoids browser cross-origin restrictions.
fetch('YOUR_WEB_APP_URL', {
method: 'POST',
mode: 'no-cors',
headers: { 'Content-Type': 'text/plain;charset=utf-8' },
body: JSON.stringify({ name, email, company, objective, notes })
});
Step 5: Make it robust
- Validate input on the form before sending, and again in the script.
- Block spam with a hidden honeypot field that real visitors never fill in.
- Watch your quotas. Google limits how many emails Apps Script can send per day, so larger teams may need a CRM or email service.
- Respect privacy. Only collect what you need and mention it in your privacy policy.
Where to go next
Once leads flow into a sheet, you can add lead scoring, WhatsApp alerts, CRM syncing with HubSpot or Salesforce, and live dashboards. Our Automation and CRM service builds and maintains systems like this for you. Book a free audit to map your lead workflow.
Want help putting this into practice?
Book a free 30-minute marketing audit and get a clear plan for your website, ads and automation.
Keep reading