If you're running paid campaigns, organic content, or multi-channel outreach, you already know that identifying which source drove a conversion is half the battle. Hidden form fields solve this problem elegantly. They capture tracking data like UTM parameters, referral sources, ad campaign IDs, and session metadata automatically, without asking your leads to fill in a single extra field.
The result: every form submission arrives pre-tagged with the context your sales and marketing teams need to act on it intelligently. A lead from a branded Google search gets treated differently than one from a cold display ad, and your team should know the difference before they pick up the phone.
This guide walks you through the complete setup process, from understanding what hidden fields actually do, to configuring them in your form builder, to verifying that your data is flowing correctly into your CRM or analytics stack. Whether you're trying to attribute revenue to a specific campaign, qualify leads based on their entry point, or simply stop losing context between your ads and your pipeline, hidden form fields are the foundational tracking layer you need.
By the end of this guide, you'll have a fully functional hidden field tracking system running on your forms. Let's get into it.
Step 1: Understand What Hidden Fields Capture (and Why It Matters)
Before touching a single form, it helps to understand exactly what you're working with. Hidden form fields are standard HTML input elements with the attribute type="hidden". They exist in your form's DOM, they submit with the form just like any visible field, but they are never rendered visibly to the user. Your lead never sees them, never interacts with them, and never has to think about them.
The most valuable data types to capture with hidden fields include:
UTM Source: Identifies where the traffic came from, such as Google, LinkedIn, or a newsletter.
UTM Medium: Describes the marketing channel, such as CPC, organic, or email.
UTM Campaign: Names the specific campaign driving the traffic.
UTM Term: Captures the paid keyword that triggered the ad.
UTM Content: Differentiates between multiple links in the same campaign, useful for A/B testing creatives.
Referrer URL: The full URL of the page that sent the visitor to your site.
Landing Page URL: The exact URL where the visitor first arrived on your site.
GCLID / FBCLID: Auto-generated click identifiers from Google Ads and Meta Ads respectively, essential for platform-level conversion tracking.
Why does this matter for lead qualification? Knowing a lead came from a branded search term signals high intent. Knowing they came from a cold display ad suggests they may need more nurturing. That context shapes how your sales team prioritizes their outreach, and it's context you can only capture automatically with hidden fields.
There are two types of hidden fields worth distinguishing. Static hidden fields contain hardcoded values that never change, useful for things like form version tags or internal labels. Dynamic hidden fields are populated via JavaScript at page load, reading values from URL parameters or cookies. For tracking purposes, dynamic fields are almost always what you want.
One common point of confusion: hidden fields are not the same as conditional fields. Conditional fields hide or show based on user input. Hidden fields are always invisible, regardless of what the user does. Keep that distinction clear as you build.
Step 2: Map Your Tracking Parameters Before Touching Any Form
The biggest mistake teams make is jumping straight into their form builder without a plan. You end up with inconsistently named fields, broken CRM mappings, and attribution data that doesn't connect to anything useful. A tracking parameter map prevents all of that.
Start with a parameter audit. List every UTM parameter your team currently uses across channels. If your marketing team uses a spreadsheet to manage UTM links, pull that up now. You want a complete picture of what you're already tagging before you decide what to capture.
Next, build a simple three-column parameter map:
1. Parameter name — the URL parameter itself, such as utm_source or utm_campaign.
2. Hidden field name in your form — what you'll name the field in your form builder.
3. Destination field in your CRM — the exact property name in your CRM where this value should land.
This document becomes your source of truth throughout the entire setup. When something breaks later, and occasionally something will, this map is where you start debugging.
Decide which parameters are mandatory versus optional for your reporting. UTM source, medium, and campaign are typically non-negotiable for any team running paid or organic campaigns. UTM term and content may be optional depending on your reporting depth. GCLID and FBCLID are mandatory if you're running Google Ads or Meta Ads and want platform-level attribution.
Speaking of paid ad platforms: GCLID and FBCLID require separate handling compared to standard UTM parameters. These auto-appended identifiers only appear on the initial landing URL and disappear as the user navigates. That means you need to capture and store them in a cookie immediately on landing, then read from the cookie when the form loads. More on that in Step 4.
You also need to decide whether you're capturing first-touch or last-touch attribution. First-touch credits the original source that brought the visitor to your site. Last-touch credits the most recent source before the form submission. This decision affects your JavaScript approach: last-touch reads directly from the current URL parameters, while first-touch requires reading from a stored cookie. If you're unsure, first-touch is generally more useful for understanding what initially drove awareness.
The success indicator for this step is simple: you have a documented list of every hidden field you plan to add, what it captures, and exactly where the data goes in your CRM. Don't move to Step 3 without it.
Step 3: Add Hidden Fields to Your Form Builder
With your parameter map in hand, it's time to open your form builder and start adding fields. The process is straightforward in a modern platform like Orbit AI. Navigate to your form, open the field selector, and choose the Hidden Field type. You'll add one hidden field per tracking parameter, following the names from your parameter map exactly.
Naming conventions matter more than most people realize. Use underscores instead of spaces. Match your CRM field names wherever possible. So the field that captures UTM source should be named utm_source, not "UTM Source" or "source" or "utm source". Inconsistency here creates mapping problems downstream that are tedious to diagnose.
For each hidden field, you'll set its default value behavior. For dynamic fields that will be populated by JavaScript, leave the default value empty. For static fields, hardcode the value directly in the builder. A good example of a static hidden field: a field named form_version with the value v2, so you can distinguish submissions from different versions of the same form in your analytics.
Here's a practical tip that pays dividends even if you're not running paid campaigns: add a hidden field for landing_page_url. This captures the exact URL where the visitor arrived on your site. For organic attribution, it tells you which blog post or landing page drove the conversion. For paid campaigns, it confirms which page your ad was pointing to. It's a low-effort addition with high long-term value.
A few common pitfalls to avoid at this stage:
Spaces and special characters in field names: These break JavaScript population and CRM field mapping. Stick to lowercase letters, numbers, and underscores.
Combining multiple values into one field: Don't try to stuff utm_source and utm_medium into a single field. Keep them separate. Your CRM and reporting tools expect individual, structured values.
Forgetting to save: Sounds obvious, but always confirm your hidden fields are saved and appear in a test preview of the form before moving on.
For Orbit AI users, hidden fields are available directly in the form builder under the field settings panel. Once added, they'll appear in your form's field list and in the submission data, ready to receive values from the JavaScript you'll write in the next step.
Step 4: Write the JavaScript to Populate Fields Dynamically
This is where the setup becomes genuinely powerful. The JavaScript that populates your hidden fields is the engine of your entire tracking system. Here's the core mechanism: when the page loads, a script reads the URL query string using window.location.search, parses the individual parameters, finds the matching hidden input fields in your form by their name attribute, and sets their values.
Conceptually, the logic looks like this:
1. Parse the current page URL to extract all query parameters into a key-value object.
2. For each tracking parameter you want to capture (utm_source, utm_medium, etc.), check if it exists in the URL.
3. If it exists, find the hidden input field with the matching name and set its value.
4. If it doesn't exist in the URL, check whether a stored cookie contains the value (for first-touch attribution).
That last point brings us to cookie-based population. For first-touch attribution, you want to store UTM values in a browser cookie the moment a visitor first arrives on your site with UTM parameters in the URL. Then, when the visitor eventually reaches your form, even if they've navigated through several pages, the script reads from the cookie rather than the URL. This ensures you capture where they originally came from, not just where they were when they converted.
GCLID and FBCLID require this exact approach. Google Ads appends the GCLID to your landing page URL automatically when auto-tagging is enabled. Meta does the same with FBCLID. But these identifiers only live in that initial URL. The moment the user clicks to another page, they're gone. Your script needs to detect them on landing, store them in a cookie immediately, and read from that cookie when the form loads.
On script placement: this matters more than most developers expect. Your tracking script must execute before the form renders. Place it in the page <head> or immediately before your form embed code. If the script loads after the form, the hidden fields will already exist in the DOM with empty values, and your script may not fire in time to populate them before submission on fast connections. This is one of the most common causes of blank hidden fields in production.
Before going live, test your script by manually appending parameters to your form page URL. Something like ?utm_source=test&utm_medium=guide&utm_campaign=setup appended to the URL should immediately populate your hidden fields. Open browser DevTools, navigate to the Elements or Inspector panel, find your hidden input fields, and confirm their value attributes contain the expected data. This takes two minutes and saves hours of troubleshooting later.
A note on privacy: capturing referrer URLs and session data may constitute personal data processing under GDPR depending on your jurisdiction and data type. Ensure your cookie consent mechanism covers tracking cookies used for hidden field population, and review your privacy policy accordingly. Orbit AI's compliance documentation at orbitforms.ai provides guidance specific to their platform.
Step 5: Connect Hidden Field Data to Your CRM and Analytics Stack
Your hidden fields are now capturing data. The next step is making sure that data lands somewhere useful. This is where your parameter map from Step 2 earns its keep.
Start with your CRM mapping. Every hidden field needs a corresponding property in your CRM where its value will be stored. If your CRM has a contact property called utm_source, your hidden field named utm_source should map directly to it. The naming alignment you built into your parameter map makes this configuration straightforward.
For Orbit AI users, the platform's native workflows and Zapier integration handle this routing. When configuring the integration, you'll see your form's fields listed, including your hidden fields. Map each hidden field to its corresponding CRM property, making sure the values are included in the submission payload that gets sent to your CRM. Don't assume they're included by default; verify the mapping explicitly during configuration.
Once the integration is configured, send a test submission. Use a URL with UTM parameters appended, fill out the form, and then check the resulting CRM contact record. Confirm that each UTM value appears in the correct CRM field. If any fields are empty or incorrect, the issue is almost always either a field name mismatch or a mapping that wasn't saved properly.
With UTM data in your CRM, you can build segmentation and lead scoring rules that reflect actual acquisition context. Leads arriving from a high-intent branded search campaign can be routed to your paid acquisition pipeline automatically. Leads from a top-of-funnel content campaign can be enrolled in a nurture sequence. This kind of context-aware routing is only possible when your CRM has structured attribution data, which is exactly what hidden fields provide.
On the analytics side, pass form submission events to your analytics platform with hidden field values included as event properties. This creates a clean connection between your form conversion data and your campaign attribution reporting. Orbit AI's built-in analytics feature lets you cross-reference form conversion rates by traffic source, closing the loop between your tracking setup and the insights you actually need to make budget decisions.
The success indicator here: a test submission shows UTM data populated correctly in both your CRM contact record and your analytics event log, without any manual intervention required.
Step 6: Test, Validate, and Troubleshoot Your Setup
A tracking system that works in theory but fails silently in production is worse than no tracking at all. It gives you false confidence in your data. Run a structured QA process before declaring your setup live.
Test four distinct scenarios:
1. With UTM parameters present: Append a full set of UTM parameters to your form page URL and submit. Verify all values appear correctly in the form response log and CRM.
2. Without UTM parameters (blank state): Visit the form page directly with no URL parameters and submit. Hidden fields should submit empty or with default values, not with "undefined" or error strings.
3. With GCLID or FBCLID: Append a mock GCLID parameter to the URL and submit. Confirm the value is captured and stored correctly, simulating a paid ad click.
4. From direct traffic: Clear your cookies, visit the form directly, and submit. Confirm the system handles the absence of any tracking data gracefully.
For each test, use browser DevTools before submitting. Open the Inspector panel, search for your hidden input fields, and visually confirm their value attributes contain the expected data. This pre-submission check tells you whether the JavaScript is working correctly, separate from any CRM or integration issues.
After submission, check Orbit AI's response log to confirm that hidden fields are captured server-side with the correct values. Then check the corresponding CRM contact record. Create three to five test contacts using different UTM combinations and verify each one maps correctly.
Common issues and their fixes:
Fields showing blank: Almost always a script load order problem. Confirm your JavaScript executes before the form renders.
Fields showing "undefined": A parameter name mismatch. Your script is looking for a parameter name that doesn't match what's in the URL. Check your naming carefully.
CRM fields empty despite correct form data: The field mapping in your integration wasn't saved, or the field names don't match your CRM property identifiers exactly.
One practical tip: build a simple internal test URL sheet. Create one URL per channel type with UTMs pre-appended and share it with your team. Anyone can use these URLs to quickly re-test the tracking setup after a form update without having to reconstruct the parameters from scratch.
The success indicator: all four test scenarios produce correct data in the form response log and CRM without any manual intervention.
Your Tracking System Is Live — Here's What to Do Next
You've now completed the full setup. Your parameter map is documented. Hidden fields are named consistently and added to your forms. JavaScript is populating them dynamically from URL parameters and cookies. Your CRM mapping is configured and verified. Test submissions confirm data is flowing correctly end to end.
Before you move on, run through this quick checklist:
Parameter map documented: Every hidden field has a defined source parameter and CRM destination.
Hidden fields named consistently: Lowercase, underscores, matching your CRM property names.
JavaScript tested: Confirmed via DevTools that fields populate correctly from URL parameters and cookies.
CRM mapping verified: Test submissions show UTM data in the correct CRM fields.
All four QA scenarios passed: With UTMs, without UTMs, with GCLID/FBCLID, and direct traffic.
Your immediate next actions: tag all live campaign URLs with UTMs if you haven't already done so, update any existing forms on your site to include hidden fields, and brief your sales team on what the new CRM fields mean so they can use the attribution context in their outreach.
Long term, review your attribution data monthly. The goal isn't just to know which channels drive the most volume; it's to understand which channels produce the highest-quality leads. Hidden fields give you the data to answer that question with confidence.
Orbit AI makes this entire setup faster. The form builder supports hidden fields natively, built-in workflows connect directly to your CRM without extra middleware, and the analytics feature closes the attribution loop without requiring a separate tool. Start building free forms today and implement this tracking system on your live forms without the complexity of stitching together multiple platforms.










