Google Apps Script · Web App

SmartForm

GPS-Enabled · Auto Dark Mode · Instant Alerts

A production-ready customer onboarding form for ISPs. Captures GPS coordinates with two-phase refinement, saves to Google Sheets, and sends instant webhook notifications — all from a single HTML file.

Features

📍

Smart GPS Tracking

Two-phase location capture with silent background refinement. Phase 1 locks instantly, Phase 2 improves accuracy invisibly.

🔐

Permission-Aware

Checks GPS permission state before auto-starting. Never shows intrusive popups on first visit — uses the Permissions API.

🌙

Auto Dark Mode

Follows system dark/light preference automatically using CSS media queries. Zero JavaScript, zero config.

📊

Google Sheets Storage

Every submission saved with timestamp, GPS coordinates, accuracy, Google Maps link, and selected package.

🔔

Instant Notifications

Webhook integration with Make.com, Zapier, or any endpoint. Perfect for Telegram/Slack/Email alerts.

🛡️

Resilient Backend

Sheet data saved first, webhook wrapped in try-catch. If notifications fail, customer data is never lost.

BD Mobile Validation

Pattern-validated 11-digit Bangladesh numbers (01x format) with inline error messages. Easily customizable for any country.

🔄

Multi-Submit Ready

"Submit Another" button resets the form and auto-starts GPS again — no page reload needed for field agents.

Screenshots

Light Mode

☀️ Light Mode

Dark Mode

🌙 Dark Mode

Success Screen

✅ Success

Prerequisites

Google Account required
Google Sheet required
Webhook URL optional

Installation & Setup

1

Create a Google Sheet

Create a new Google Sheet with headers: Timestamp, Name, Mobile, Address, Installation Date, Map Link, GPS Data, Package

2

Set Up Apps Script

Go to script.google.com → New Project. Paste code.gs and create an HTML file named Index with the contents of index.html.

3

Configure Credentials

Open code.gs and replace the placeholder values with your own.

// code.gs
var WEBHOOK_URL = "YOUR_WEBHOOK_URL_HERE";
var SHEET_URL = "YOUR_GOOGLE_SHEET_URL_HERE";
4

Deploy as Web App

Click Deploy → New deployment → Web app. Set execute as "Me" and access to "Anyone". Copy the web app URL — that's your form link.

// Your deployed form URL
https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec
5

Set Up Webhook (Optional)

Connect Make.com or Zapier to receive instant alerts via Telegram, Slack, Email, or Discord on every new submission.

Architecture

📍 GPS Flow

Page Load │ ├─ Granted → Auto-start GPS ├─ Prompt → Wait for tap └─ Denied → Show help message GPS Capture │ ├─ Phase 1 → Instant lock (1-5s) └─ Phase 2 → Silent refine (≤20m)

📊 Data Flow

Form Submit │ ├─ 1. Save to Sheet ✓ │ Always succeeds first │ └─ 2. Send Webhook 🔔 try-catch wrapped If fails → logged only User still sees success