| # | Name | Phone | Property | Budget | Source | Status | Date |
|---|---|---|---|---|---|---|---|
No leads yetLeads from the website form or manual entries will appear here. | |||||||
| # | Name | Phone | Property | Budget | Source | Status | Date | Actions |
|---|
Add New Lead
Manually enter a lead — it will be saved locally and synced to Google Sheets.
Setup & Connect
Follow these steps once to connect the CRM and website form to your Google Sheet.
Create a Google Sheet
Open sheets.google.com and create a new sheet named Vihan Leads. Add these headers in Row 1 exactly:
Timestamp | Name | Phone | Email | Property Type | Budget | Message | Source | Status | Notes
Create a Google Apps Script
In the Google Sheet, go to Extensions → Apps Script. Delete any existing code and paste the script below, then click Deploy → New Deployment → Web App (Execute as: Me, Who has access: Anyone).
▶ Show Apps Script Code
const SHEET_NAME = 'Vihan Leads';
function doPost(e) {
try {
const data = JSON.parse(e.postData.contents);
const sheet = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName(SHEET_NAME);
if (data.action === 'addLead') {
sheet.appendRow([
new Date().toLocaleString('en-IN'),
data.name || '',
data.phone || '',
data.email || '',
data.propertyType || '',
data.budget || '',
data.message || '',
data.source || 'Website Form',
data.status || 'New',
data.notes || ''
]);
}
return ContentService
.createTextOutput(JSON.stringify({success:true}))
.setMimeType(ContentService.MimeType.JSON);
} catch(err) {
return ContentService
.createTextOutput(JSON.stringify({success:false,error:err.message}))
.setMimeType(ContentService.MimeType.JSON);
}
}
function doGet(e) {
const sheet = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName(SHEET_NAME);
const rows = sheet.getDataRange().getValues();
const headers = rows[0];
const leads = rows.slice(1).map(r => {
const obj = {};
headers.forEach((h,i) => obj[h] = r[i]);
return obj;
});
return ContentService
.createTextOutput(JSON.stringify(leads))
.setMimeType(ContentService.MimeType.JSON);
}
Paste your Web App URL here
After deploying, copy the Web App URL and paste it below. This connects both the website form and this CRM to your sheet.
Update the website HTML
In vihan-property.html, find this line near the bottom and replace https://script.google.com/macros/s/AKfycbxNmRQwJej9Irmzbx4-24Ihwiq02S6jrIpAeFdSbT6ywuTfzfXWG6YrRDhnST4Y0-r6/exec with the same Web App URL:
const SHEET_URL = 'https://script.google.com/macros/s/AKfycbxNmRQwJej9Irmzbx4-24Ihwiq02S6jrIpAeFdSbT6ywuTfzfXWG6YrRDhnST4Y0-r6/exec';