New: Getform is now Forminit. Read the post ->
Back to all posts

How to Track Click IDs and UTM Parameters in HubSpot Forms

By Forminit in Guides • Published February 23, 2026

Short answer: HubSpot forms don’t auto-capture ad click IDs. To track them, you need hidden fields, custom JavaScript, and cookie workarounds — per parameter, per form. Or you can use Forminit, which auto-captures every click ID and UTM parameter out of the box, and send submissions to HubSpot via Zapier.


If you’re running paid ads and sending leads to HubSpot, you’ve probably hit this wall: the form submission arrives, but you have no idea which ad brought the visitor. No gclid, no fbclid, no UTM data. Just a name and email floating in your CRM with zero attribution context.

This is one of the most common complaints in the HubSpot community. And the workarounds aren’t pretty.

The problem with click ID tracking in HubSpot

HubSpot doesn’t natively auto-capture ad click IDs from URL parameters. If a visitor lands on your page from a Google Ad with ?gclid=abc123 in the URL, that value isn’t automatically stored anywhere in HubSpot unless you set it up manually.

Here’s what the standard HubSpot workaround looks like:

  1. Create a custom contact property in HubSpot (e.g., gclid)
  2. Add it as a hidden field on your HubSpot form
  3. Write JavaScript to extract the gclid from the URL on page load
  4. Store it in a cookie (because the parameter disappears when the user navigates to another page)
  5. Write more JavaScript to read the cookie and populate the hidden field before form submission
  6. Repeat for every click ID you want to track (fbclid, msclkid, ttclid, etc.)
  7. Repeat for every UTM parameter (utm_source, utm_medium, utm_campaign, utm_term, utm_content)

That’s ~60 lines of vanilla JavaScript per parameter, cookie management logic, hidden field configuration in every form, and testing across browsers. And if the visitor’s browser blocks third-party cookies (Safari, Firefox, Brave), your tracking can silently break.

As one HubSpot community member put it: tracking click IDs in HubSpot feels like a task that should be simple but quickly turns into a project.

What are ad click IDs and why do they matter?

A click ID is a unique identifier that an ad platform appends to the landing page URL when someone clicks an ad. It ties the visit back to the specific ad, campaign, and keyword that generated the click — making it essential for conversion attribution and ROAS reporting.

Here’s the full list of click IDs used by major ad platforms:

Click IDAd PlatformExample URL Parameter
gclidGoogle Ads?gclid=EAIaIQobChMI...
gbraidGoogle Ads (web-to-app, iOS)?gbraid=0AAAAAC...
wbraidGoogle Ads (app-to-web, iOS)?wbraid=0AAAAAC...
dclidGoogle Display & Video 360?dclid=CNX2j...
fbclidMeta (Facebook & Instagram)?fbclid=IwAR3x...
msclkidMicrosoft / Bing Ads?msclkid=a1b2c3...
ttclidTikTok Ads?ttclid=E.C.P...
twclidX (Twitter) Ads?twclid=abc123...
li_fat_idLinkedIn Ads?li_fat_id=a1b2c3...
ScCidSnapchat Ads?ScCid=abc123...
epikPinterest Ads?epik=dj0yJnU9...
rdt_cidReddit Ads?rdt_cid=abc123...
vmcidYahoo Ads?vmcid=abc123...

Without capturing these, you can’t close the loop between ad spend and form conversions. You see leads in HubSpot, but you can’t attribute them to the campaign that brought them in.

The easier approach: Forminit + Zapier + HubSpot

Instead of writing custom JavaScript, managing cookies, and configuring hidden fields on every form, you can use Forminit as your form backend and forward submissions to HubSpot automatically.

Here’s why this works:

Forminit auto-captures everything

When a visitor submits a form through Forminit, the SDK automatically captures and stores:

  • All click IDsgclid, fbclid, msclkid, ttclid, twclid, dclid, and more
  • All UTM parametersutm_source, utm_medium, utm_campaign, utm_term, utm_content
  • Referrer URL — where the visitor came from
  • Geolocation — country, city, and timezone based on IP

No hidden fields. No cookies. No JavaScript workarounds. It happens at the SDK level, automatically, on every submission.

Send submissions to HubSpot via Zapier

Once Forminit captures the full submission with attribution data, you can forward it to HubSpot as a new contact using Zapier:

  1. Go to Zapier and create a new Zap
  2. Trigger: Select ForminitNew Submission → choose your form
  3. Action: Select HubSpotCreate or Update Contact
  4. Map your Forminit fields to HubSpot contact properties — including click IDs, UTM parameters, referrer, and location
  5. Turn on the Zap

Every form submission now lands in HubSpot with full attribution data attached. You can see exactly which Google campaign, Facebook ad set, or LinkedIn campaign generated each lead.

Set up the Forminit + HubSpot Zap →

View the full submission in Forminit

Every submission in Forminit has its own detail page in the dashboard. You can see:

  • All form field values
  • Sender information (name, email, phone)
  • Click ID source and value (e.g., gclid: EAIaIQobChMI...)
  • UTM parameters
  • Referrer URL
  • Geolocation (country, city, timezone)
  • Submission status (open, in progress, done)
  • Internal notes from your team

This gives your sales and marketing team a single source of truth for every lead — not just in HubSpot, but in a submission-level view that shows exactly how the visitor found you.

Forminit vs. HubSpot forms for click ID tracking

CapabilityHubSpot FormsForminit
Auto-capture gclidNo (manual setup)Yes
Auto-capture fbclidNo (manual setup)Yes
Auto-capture msclkidNo (manual setup)Yes
Auto-capture ttclid, twclid, dclidNoYes
Auto-capture UTM parametersPartial (requires config)Yes
Referrer URL trackingNoYes
Geolocation captureNoYes
Requires custom JavaScriptYes (per parameter)No
Requires cookie managementYesNo
Works with any frontendNo (HubSpot embed or API)Yes
Sends data to HubSpotNativeVia Zapier

How to set it up

1. Create a form in Forminit

Sign up at forminit.com and create a new form. You’ll get a form ID.

2. Build your form frontend

Use any HTML, React, Vue, Svelte, Astro, or framework of your choice. Point it at your Forminit endpoint:

<form id="lead-form">
  <input type="text" name="fi-sender-fullName" placeholder="Name" required />
  <input type="email" name="fi-sender-email" placeholder="Email" required />
  <input type="text" name="fi-sender-company" placeholder="Company" />
  <button type="submit">Get in Touch</button>
</form>

<p id="form-status"></p>

<script src="https://forminit.com/sdk/v1/forminit.js"></script>
<script>
  const forminit = new Forminit();
  const FORM_ID = 'YOUR-FORM-ID'; // ← Replace with your Form ID

  const form = document.getElementById('lead-form');
  const status = document.getElementById('form-status');

  form.addEventListener('submit', async function(event) {
    event.preventDefault();

    const formData = new FormData(form);
    const { data, error } = await forminit.submit(FORM_ID, formData);

    if (error) {
      status.textContent = error.message;
      return;
    }

    status.textContent = 'Submitted successfully!';
    form.reset();
  });
</script>

That’s it on the frontend. The Forminit SDK automatically captures all click IDs and UTM parameters from the URL — no hidden fields, no cookies, no extra JavaScript.

3. Connect to HubSpot via Zapier

Create a Zap that triggers on new Forminit submissions and creates or updates a HubSpot contact. Map the tracking fields (click IDs, UTMs, referrer) to your HubSpot contact properties.

Use the Forminit + HubSpot Zap template →

4. Done

Every lead that comes through your form now arrives in HubSpot with complete attribution data. No cookies, no JavaScript workarounds, no hidden field maintenance.

Frequently asked questions

Does HubSpot automatically track gclid?

No. HubSpot does not auto-capture gclid or any other ad click ID from URL parameters. You need to create a custom contact property, add a hidden field to your form, and write JavaScript to extract the value from the URL and store it in a cookie. This setup is required for each click ID you want to track.

What click IDs does Forminit auto-capture?

Forminit’s JavaScript SDK automatically captures gclid, fbclid, msclkid, ttclid, twclid, and dclid from URL parameters on every form submission. It also captures all five UTM parameters, the referrer URL, and geolocation data. No hidden fields or custom code required.

Can I send Forminit submissions to HubSpot?

Yes. Use Zapier to connect Forminit with HubSpot. Set Forminit as the trigger (new submission) and HubSpot as the action (create or update contact). You can map all fields including click IDs, UTM parameters, and location data to HubSpot contact properties.

Do I need a HubSpot paid plan to track click IDs with Forminit?

No. Since the tracking happens in Forminit (not in HubSpot forms), you don’t need any specific HubSpot plan for click ID capture. You only need a Zapier account to forward the data to HubSpot.

Further reading