惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
D
Docker
GbyAI
GbyAI
Y
Y Combinator Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Blog — PlanetScale
Blog — PlanetScale
P
Palo Alto Networks Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V
Vulnerabilities – Threatpost
I
InfoQ
Simon Willison's Weblog
Simon Willison's Weblog
博客园_首页
T
Threat Research - Cisco Blogs
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
阮一峰的网络日志
阮一峰的网络日志
O
OpenAI News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Forbes - Security
Forbes - Security
AWS News Blog
AWS News Blog
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
S
Security Affairs
H
Heimdal Security Blog
Engineering at Meta
Engineering at Meta
T
Troy Hunt's Blog
T
Tenable Blog
MongoDB | Blog
MongoDB | Blog
H
Hacker News: Front Page
IT之家
IT之家
N
News and Events Feed by Topic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
S
Secure Thoughts
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Last Watchdog
The Last Watchdog
S
Security @ Cisco Blogs
NISL@THU
NISL@THU
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How to Track Where Your Form Submissions Are Coming From Using Your Own HTML Form
Allen Jones · 2026-04-29 · via DEV Community

You already have a contact form on your website.

Maybe it is a simple three-field form on your portfolio. Maybe it is a detailed quote request form on your business site.
Maybe it is a registration form you built yourself in React or plain HTML.

It is working. Submissions are arriving.
People are filling it in.

But here is the question you probably have not thought to ask:

Where are these people coming from?

Did they find your site through a Google search? Did someone share your link in a WhatsApp group? Did they click a link in your email newsletter? Did they come from your Instagram bio?

If you do not know the answer, you are making marketing decisions blindly. You are spending time on channels that might not be sending you any leads while ignoring the one channel sending you your best customers.

This guide shows you how to add UTM tracking to your existing HTML form using Formgrid, so every submission automatically shows you exactly where it came from.


What You Need Before Starting

A Formgrid account:
Sign up for free at formgrid.dev
No credit card required
An existing HTML form on your website:
Any HTML form works, whether it is
a contact form, a quote request form,
a registration form, or anything else
A basic understanding of HTML:
You just need to be able to add
a few lines to your existing form


How UTM Tracking Works With Your Own HTML Form

When someone arrives at your page
through a tracked link like this:
https://yourwebsite.com/contact
?utm_source=twitter&utm_medium=social

The UTM parameters are in the page URL. Your form needs to read those parameters from the URL and include them in the
submission, so Formgrid knows where the person came from.

There are two parts to setting this up:
Part 1:
Add hidden fields to your HTML form
to carry the UTM data
Part 2:
Add a small JavaScript snippet that reads the UTM parameters from the URL and fills those hidden fields automatically before the form submits

The person filling in your form sees nothing different. They fill in their name, email, and message as normal. The UTM data is captured invisibly in the background.


Step 1: Connect Your Form to Formgrid

If you have not already done this, replace your form action URL with
your Formgrid endpoint. One line change. Everything else stays exactly as it is.

<form 
  action="https://formgrid.dev/api/f/your-form-id" 
  method="POST"
>
  <input 
    type="text" 
    name="name" 
    placeholder="Your Name" 
    required 
  />
  <input 
    type="email" 
    name="email" 
    placeholder="Your Email" 
    required 
  />
  <textarea 
    name="message" 
    placeholder="Your Message"
  ></textarea>
  <button type="submit">Send</button>
</form>

Enter fullscreen mode Exit fullscreen mode

Go to formgrid.dev and sign up. Create a new form and copy your endpoint URL from the form details page.

Formgrid signup page

Formgrid endpoint URL on form details page

Paste that endpoint URL into your form action attribute. Your form now sends submissions to Formgrid.


Step 2: Add Hidden UTM Fields to Your Form

Add three hidden input fields inside your form. These fields are invisible to the person filling in your form, but they carry the UTM data to Formgrid when the form is submitted.

<form 
  action="https://formgrid.dev/api/f/your-form-id" 
  method="POST"
>
  <input 
    type="text" 
    name="name" 
    placeholder="Your Name" 
    required 
  />
  <input 
    type="email" 
    name="email" 
    placeholder="Your Email" 
    required 
  />
  <textarea 
    name="message" 
    placeholder="Your Message"
  ></textarea>

  <!-- Hidden UTM tracking fields -->
  <!-- These are invisible to the user -->
  <input 
    type="hidden" 
    name="utm_source" 
    id="utm_source" 
  />
  <input 
    type="hidden" 
    name="utm_medium" 
    id="utm_medium" 
  />
  <input 
    type="hidden" 
    name="utm_campaign" 
    id="utm_campaign" 
  />

  <button type="submit">Send</button>
</form>

Enter fullscreen mode Exit fullscreen mode

The three hidden fields are:
utm_source:
Where the traffic came from
Examples: twitter, whatsapp,
instagram, newsletter, google
utm_medium:
How the traffic arrived
Examples: social, email, paid, organic
utm_campaign:
Which specific campaign sent them
Examples: summer_launch, instagram_bio,
newsletter_april


Step 3: Add the JavaScript Snippet

Add this script immediately after your closing form tag. It reads the UTM parameters from the page URL and populates the hidden fields automatically before the form is submitted.

<script>
  (function() {
    // Read UTM parameters from the 
    // current page URL
    var params = new URLSearchParams(
      window.location.search
    )

    // Get each UTM value from the URL
    var utmSource = 
      params.get('utm_source')
    var utmMedium = 
      params.get('utm_medium')
    var utmCampaign = 
      params.get('utm_campaign')

    // Populate the hidden fields 
    // if the values exist
    if (utmSource) {
      var sourceField = 
        document.getElementById('utm_source')
      if (sourceField) 
        sourceField.value = utmSource
    }

    if (utmMedium) {
      var mediumField = 
        document.getElementById('utm_medium')
      if (mediumField) 
        mediumField.value = utmMedium
    }

    if (utmCampaign) {
      var campaignField = 
        document.getElementById('utm_campaign')
      if (campaignField) 
        campaignField.value = utmCampaign
    }
  })()
</script>

Enter fullscreen mode Exit fullscreen mode

This script runs automatically when the page loads. If the URL contains UTM parameters, it fills the hidden fields silently. If there are no UTM parameters in the URL, the hidden fields stay empty, and the submission goes through normally.


Your Complete Form With UTM Tracking

Here is the full form with everything
in place:

<form 
  action="https://formgrid.dev/api/f/your-form-id" 
  method="POST"
>
  <input 
    type="text" 
    name="name" 
    placeholder="Your Name" 
    required 
  />
  <input 
    type="email" 
    name="email" 
    placeholder="Your Email" 
    required 
  />
  <textarea 
    name="message" 
    placeholder="Your Message"
  ></textarea>

  <!-- Hidden UTM tracking fields -->
  <input 
    type="hidden" 
    name="utm_source" 
    id="utm_source" 
  />
  <input 
    type="hidden" 
    name="utm_medium" 
    id="utm_medium" 
  />
  <input 
    type="hidden" 
    name="utm_campaign" 
    id="utm_campaign" 
  />

  <button type="submit">Send</button>
</form>

<script>
  (function() {
    var params = new URLSearchParams(
      window.location.search
    )

    var utmSource = 
      params.get('utm_source')
    var utmMedium = 
      params.get('utm_medium')
    var utmCampaign = 
      params.get('utm_campaign')

    if (utmSource) {
      var sourceField = 
        document.getElementById('utm_source')
      if (sourceField) 
        sourceField.value = utmSource
    }

    if (utmMedium) {
      var mediumField = 
        document.getElementById('utm_medium')
      if (mediumField) 
        mediumField.value = utmMedium
    }

    if (utmCampaign) {
      var campaignField = 
        document.getElementById('utm_campaign')
      if (campaignField) 
        campaignField.value = utmCampaign
    }
  })()
</script>

Enter fullscreen mode Exit fullscreen mode

That is the entire setup. No libraries.
No build tools. No dependencies. Just
three hidden fields and ten lines of vanilla JavaScript.


Step 4: Create Your Tracked Links

Now that your form is ready to capture UTM data, you need to create tracked versions of your page URL to share in different places.

Your normal contact page URL:
https://yourwebsite.com/contact

Your tracked versions:
For Twitter:
https://yourwebsite.com/contact
?utm_source=twitter&utm_medium=social
For WhatsApp:
https://yourwebsite.com/contact
?utm_source=whatsapp&utm_medium=social
For your email newsletter:
https://yourwebsite.com/contact
?utm_source=newsletter&utm_medium=email
For Instagram bio:
https://yourwebsite.com/contact
?utm_source=instagram&utm_medium=social
For LinkedIn:
https://yourwebsite.com/contact
?utm_source=linkedin&utm_medium=social

Share the right link in the right place. The person clicking the link arrives at your normal contact page. They see nothing different. But when they submit your form, Formgrid records exactly which link they clicked.


Step 5: See Where Your Submissions

Are Coming From

When submissions arrive in your Formgrid dashboard, each one shows you exactly where it came from.

Open any submission, and you will see:
Source: twitter via social

Or:
Source: whatsapp via social

Or:
Source: newsletter via email

After a few weeks of sharing tracked links, you can see at a glance which channel is sending you the most submissions and which channel is sending you leads that actually convert.


Using This With React or

Other Frameworks

If your form is built in React or another JavaScript framework, the
approach is the same, but you read the URL parameters using the
framework's router or the native browser API.

React example:

import { useEffect, useState } from 'react'

function ContactForm() {
  const [utmSource, setUtmSource] = 
    useState('')
  const [utmMedium, setUtmMedium] = 
    useState('')
  const [utmCampaign, setUtmCampaign] = 
    useState('')

  useEffect(() => {
    const params = new URLSearchParams(
      window.location.search
    )
    setUtmSource(
      params.get('utm_source') || ''
    )
    setUtmMedium(
      params.get('utm_medium') || ''
    )
    setUtmCampaign(
      params.get('utm_campaign') || ''
    )
  }, [])

  return (
    <form 
      action="https://formgrid.dev/api/f/your-form-id"
      method="POST"
    >
      <input 
        type="text" 
        name="name" 
        placeholder="Your Name" 
        required 
      />
      <input 
        type="email" 
        name="email" 
        placeholder="Your Email" 
        required 
      />
      <textarea 
        name="message" 
        placeholder="Your Message"
      />

      {/* Hidden UTM fields */}
      <input 
        type="hidden" 
        name="utm_source" 
        value={utmSource} 
      />
      <input 
        type="hidden" 
        name="utm_medium" 
        value={utmMedium} 
      />
      <input 
        type="hidden" 
        name="utm_campaign" 
        value={utmCampaign} 
      />

      <button type="submit">
        Send Message
      </button>
    </form>
  )
}

export default ContactForm

Enter fullscreen mode Exit fullscreen mode

Next.js example using useSearchParams:

'use client'

import { useEffect, useState } from 'react'
import { useSearchParams } from 'next/navigation'

function ContactForm() {
  const searchParams = useSearchParams()

  const utmSource = 
    searchParams.get('utm_source') || ''
  const utmMedium = 
    searchParams.get('utm_medium') || ''
  const utmCampaign = 
    searchParams.get('utm_campaign') || ''

  return (
    <form 
      action="https://formgrid.dev/api/f/your-form-id"
      method="POST"
    >
      <input 
        type="text" 
        name="name" 
        placeholder="Your Name" 
        required 
      />
      <input 
        type="email" 
        name="email" 
        placeholder="Your Email" 
        required 
      />
      <textarea 
        name="message" 
        placeholder="Your Message"
      />

      <input 
        type="hidden" 
        name="utm_source" 
        value={utmSource} 
      />
      <input 
        type="hidden" 
        name="utm_medium" 
        value={utmMedium} 
      />
      <input 
        type="hidden" 
        name="utm_campaign" 
        value={utmCampaign} 
      />

      <button type="submit">
        Send Message
      </button>
    </form>
  )
}

export default ContactForm

Enter fullscreen mode Exit fullscreen mode

The logic is identical in every framework. Read the URL parameters when the component mounts. Pass them as hidden field values. Formgrid handles the rest.


Testing Your Setup

Before sharing your tracked links, test that everything is working correctly.

Step 1: Open your contact page with
a UTM parameter in the URL:
https://yourwebsite.com/contact
?utm_source=test&utm_medium=testing

Step 2: Right-click on the page and inspect the hidden form fields. You should see:

utm_source value: test
utm_medium value: testing
utm_campaign value: (empty)

Step 3: Fill in the form and submit it.

Step 4: Open your Formgrid dashboard and find the submission. Open it and check that the source shows:
Source: test via testing

If you see the source on the submission, your setup is working correctly. If not, check that the hidden field IDs match the JavaScript and that the script is running after the form loads.


A Real Example: The Difference

This Makes

James runs a cleaning business. He shares his quote request form link in four places
every week:
His Instagram bio
A local business Facebook group
His monthly email newsletter
Google My Business profile

Before UTM tracking, he had no idea which channel was working. He was
posting on Instagram every day and sending a newsletter once a month.

After adding UTM tracking to his form, he checked his Formgrid dashboard
after one month:
Instagram: 3 submissions
Facebook group: 21 submissions
Newsletter: 8 submissions
Google My Business: 11 submissions

He was spending most of his time on Instagram, and it was sending him almost nothing. The Facebook group he checked once a week was sending him the most leads.

He shifted his time accordingly. More engagement in the Facebook group. Less Instagram posting. His monthly quote requests increased by 60 percent without doing any additional marketing.

That decision was only possible because he could see the data.


What Happens to the UTM Data

in Formgrid

Every submission that includes UTM data shows the source in the lead
detail view in your dashboard.

You also see it in the leads tab alongside each submission, so you
can see at a glance which channel each lead came from without opening
the full detail view.

Combined with Formgrid's lead pipeline, you can track both the source and the outcome of every lead:
Facebook group submissions:
21 total
15 contacted
9 converted (43% conversion rate)
Instagram submissions:
3 total
2 contacted
0 converted (0% conversion rate)

Facebook is not just sending more leads.
It is sending leads that actually become customers. Instagram is sending leads that go nowhere.

Without UTM tracking, you would never know that.


Getting Started

If you already have an HTML form on
your website:
Step 1:
Connect it to Formgrid by replacing
the form action URL
Step 2:
Add the three hidden UTM fields
Step 3:
Add the JavaScript snippet
Step 4:
Create tracked versions of your
page URL for each channel
Step 5:
Share the right link in each place

Total setup time: about 10 minutes.

From that point forward, every submission
automatically shows you where it came from.

👉 Start free at formgrid.dev

No credit card required. Free plan
available. UTM tracking works on all plans, including free.


Have questions about setting up UTM
tracking with your specific form or
framework? Email allen@formgrid.dev, and I will help you get it working.