How to Add UTM Parameters to Forms

Adding UTM parameters to forms is a simple way to track the effectiveness of your marketing campaigns and identify which efforts drive conversions. These parameters are small text snippets added to URLs that help you monitor traffic sources and campaign performance. By using hidden fields in forms, you can capture this data without disrupting the user experience. Here’s how you can do it:
- Understand UTM Parameters: These include
utm_source
,utm_medium
,utm_campaign
,utm_term
, andutm_content
. They track traffic sources, mediums, campaigns, keywords, and content variations. - Set Up Hidden Fields: Add hidden fields to your forms corresponding to the UTM parameters. Use JavaScript to store UTM data in cookies to ensure it persists across sessions.
- Ensure Consistency: Use lowercase for parameter values, replace spaces with underscores, and maintain a standardized naming convention to avoid fragmented data.
- Use Tools: Platforms like Reform simplify UTM tracking by auto-populating hidden fields and integrating with CRMs for seamless data flow.
- Test Thoroughly: Test your setup with sample URLs and verify that UTM data flows correctly into your analytics tools or CRM.
How to capture UTM Parameters in a Cookie and transfer them to a (hidden) Form Field
What Are UTM Parameters
UTM parameters are tracking codes you can add to the end of your URLs to figure out exactly where your website traffic is coming from. They don’t just track who’s visiting your site - they also follow the visitor’s journey from the first click all the way to a form submission. This means you can see which marketing campaigns are actually driving conversions, not just traffic.
UTM Parameter Basics
Here’s how UTM parameters work: you attach specific tags to your URLs, and analytics tools like Google Analytics use those tags to organize and analyze your traffic. To add UTM parameters, you start with a question mark at the end of your URL, followed by key-value pairs separated by ampersands.
Here’s an example of what a UTM-tagged URL looks like:
https://yourwebsite.com/landing-page?utm_source=facebook&utm_medium=social&utm_campaign=spring_sale
Each tag in the URL serves a specific purpose, creating a consistent system for tracking how your campaigns perform across different platforms. Let’s break down the five standard UTM parameters that make this possible.
The 5 Standard UTM Parameters
There are five main UTM parameters, each designed to track a specific aspect of your campaign performance:
- utm_source: This identifies where the traffic is coming from - think platforms like "facebook", "google", or "newsletter."
- utm_medium: This tells you how the traffic is being sent, such as "social", "email", "cpc", "organic", or "referral."
- utm_campaign: This links the traffic to a specific campaign, like "spring_sale_2024", "product_launch", or "webinar_promotion."
- utm_term: This is mainly used in paid search campaigns to track specific keywords, like "form_builder_software" or "lead_generation_tools."
- utm_content: This helps you differentiate between similar links within the same campaign - perfect for A/B testing or comparing different calls-to-action, like "red_button" versus "blue_button."
Why Collect UTM Data in Forms
Tracking UTM parameters through hidden fields in forms solves a common problem: losing attribution data. While analytics tools can show you where traffic comes from, they might lose track of the original source if someone converts during a later session or on a different device.
By capturing UTM data in forms, you can confidently attribute a lead to its original source. For instance, if a user first clicks a Facebook ad but completes the form days later after revisiting through a Google search, the UTM data ensures that Facebook gets the credit for the lead.
This kind of tracking isn’t just about clarity - it’s about making smarter marketing decisions. With precise data, you can calculate the ROI of each channel. If a specific UTM source consistently brings in high-quality leads or customers with a higher lifetime value, you can shift more of your budget there. On the flip side, if a source isn’t delivering, you can adjust or cut back on those efforts.
To make sure your data stays clean and usable, it’s essential to use consistent naming conventions. For example, always use lowercase for UTM values and standardize source names to avoid fragmented analytics. These small steps can make a big difference when analyzing your campaigns.
Setting Up Your Form to Collect UTM Parameters
Once you understand UTM parameters, the next step is configuring your forms to gather this data seamlessly. By using hidden fields, you can record campaign details without disrupting the user experience. Here's how to set them up effectively.
Adding Hidden Fields to Your Form
Hidden fields are a simple yet powerful tool for collecting UTM data. These invisible form elements automatically capture and submit information, like campaign sources and mediums, without requiring any action from users.
To track UTM parameters properly, create a hidden field for each parameter you want to monitor. The most common ones include utm_source, utm_medium, utm_campaign, utm_term, and utm_content. These fields will store the text strings from the UTM parameters embedded in your URLs.
Since UTM parameters only exist on the landing page, you’ll need to ensure they don’t get lost if users navigate away before submitting the form. Use JavaScript to save the UTM data in cookies when the page loads, so it can be retrieved later. Make sure the script runs after the DOM is fully loaded to avoid errors.
Data Consistency Best Practices
Setting up hidden fields is just the first step. To ensure your data remains clean and reliable, follow these consistency guidelines.
One key practice is to always use lowercase letters for all UTM parameters. UTM codes are case-sensitive, so inconsistencies like "Facebook" versus "facebook" can fragment your analytics data, making it harder to interpret.
Replace spaces in parameter values with underscores. For example, use spring_sale instead of "spring sale" to avoid formatting issues. Additionally, it’s a good idea to avoid dashes or other special characters in parameter values, as they can sometimes interfere with data processing.
To keep your tracking organized, maintain a master spreadsheet with all UTM parameters and naming conventions. This shared resource will help your team stay consistent and reduce errors like duplicates or mismatched entries.
When naming campaigns, use a single, clear identifier across all channels. For example, a "Black Friday" campaign can apply to organic, paid search, email, social, and referral traffic. This uniformity makes it easier to compare performance across platforms. Avoid mixing codes, numbers, or acronyms that could complicate your analysis.
Finally, schedule regular reviews to catch typos, inconsistencies, or duplicates before they snowball into bigger issues. Automated UTM tools can also enforce your naming rules and speed up the process of creating campaign links, minimizing human error.
How to Pass UTM Parameters into Forms
To capture UTM data from campaign URLs in forms, you can populate hidden fields with this information, ensuring the tracking data stays intact as users move through your site.
Using URLs to Pass UTM Parameters
One of the simplest ways to collect UTM parameters is by appending them directly to your campaign URLs. This allows your form to automatically grab the values when users click the link. Your campaign URLs should include all the UTM parameters you want to track. Here's an example of a complete URL:
www.yourwebsite.com/landing-page/?utm_campaign=spring_sale&utm_source=facebook&utm_medium=social&utm_content=video_ad&utm_term=gardening_tools
When users land on the page, these UTM values are ready for collection. To keep the parameters intact as users navigate your site, use cookies.
For more reliable tracking across multiple pages, tools like JavaScript or Google Tag Manager can help.
JavaScript and Google Tag Manager for UTM Collection
If URL parameters might be lost during navigation, JavaScript and Google Tag Manager can step in to maintain tracking. These tools store UTM data in cookies, ensuring it stays accessible for forms.
For instance, MeasureSchool shared a method where you create URL variables for each UTM parameter, add hidden fields to your forms, and use a custom HTML tag with JavaScript to capture the parameters when the page loads. The JavaScript reads the URL's parameters and automatically fills the matching hidden fields in your form.
Working with Embedded Forms and iFrames
Embedded forms and iFrames require specific techniques to handle UTM data effectively. Since iFrames operate separately from the parent page, they can't directly access the UTM parameters from the parent URL. To solve this, you'll need to use JavaScript to pass the UTM parameters from the parent page to the iFrame.
"Passing the query string from the outer document to an inner IFRAME is as simple as augmenting the src of the IFRAME." - Sanford Whiteman, Community Moderator
A common approach involves writing JavaScript that reads the UTM parameters from the parent URL and appends them to the iFrame's base URL. In February 2024, Consensus introduced an iFrame Generator tool that automates this process, generating the necessary HTML and JavaScript to reduce errors and manual work.
For lazy-loaded iFrames, make sure UTM parameters are passed before the content loads. Additionally, ensure that the hidden fields in your form have IDs that match the UTM parameter names exactly (e.g., a hidden field named utm_source
must match the URL parameter utm_source
) for automatic population to work seamlessly.
"You will need to use JavaScript to get the UTM parameters and pass them to the form hidden fields." - Kristen, Community Manager
Finally, always test your setup thoroughly to confirm that all expected UTM data is correctly captured in your form submissions or CRM records.
sbb-itb-5f36581
Setting Up UTM Parameter Tracking in Reform
Reform simplifies UTM tracking with its user-friendly, no-code interface. Designed with a focus on conversions, Reform ensures your UTM tracking aligns effortlessly with your lead generation efforts.
Creating Hidden Fields in Reform
Setting up hidden fields is essential for linking leads to their original sources. Reform's hidden blocks work quietly in the background, gathering attribution data without cluttering your form's appearance.
To add hidden fields for UTM parameters, select the Hidden Block option from the form builder dropdown menu. Inside the "Enter a column name" field, name each hidden field to match the UTM parameter you want to track. For example:
utm_source
utm_medium
utm_campaign
utm_content
utm_term
After creating your hidden fields, go to the Share page in Reform. Here, you'll see each field listed with an option to pre-fill values. When you enter a value for a hidden field, Reform updates the URL under "Copy link" to include the field name and value as query parameters.
Reform automatically populates hidden fields when the URL parameter names match the field names. For instance, a URL like utm_source=facebook
will fill the utm_source
field with "facebook." This seamless integration keeps your forms clean while ensuring every submission includes complete UTM data for precise campaign tracking.
Connecting UTM Data with Your CRM or Marketing Tools
Reform integrates smoothly with popular CRMs and marketing platforms, helping you manage UTM data effortlessly. Tools like HubSpot, Salesforce, Google Sheets, Notion, ConvertKit, and Zapier are supported, ensuring your campaign data flows directly into your existing systems.
To set up CRM integration, map each UTM hidden field to its corresponding field in your CRM. This ensures that data like campaign source, medium, and content appears alongside other form details in your contact records. Reform's Pro plan includes advanced integrations with platforms like HubSpot, while the Basic plan supports tools like Google Sheets and Zapier.
Before activating your integration, establish clear goals and standardized UTM conventions. For example, use lowercase letters and underscores instead of spaces in UTM values to maintain consistency across campaigns.
Once your tools are connected, test the data flow with sample submissions. Try different UTM parameter combinations and confirm the data is captured correctly in your destination platform. Testing ensures you avoid data gaps that could affect your campaign analysis.
This integrated approach improves collaboration between marketing and sales teams. With full visibility into lead sources, sales reps can identify which campaigns generated specific leads, leading to more effective conversations and higher conversion rates. Reform also enables you to track campaign performance in real-time, offering actionable insights to refine your strategy.
Using Reform's Analytics for UTM Tracking
Reform's real-time analytics give you instant insights into how your UTM-driven campaigns are performing. The analytics dashboard combines form performance metrics with UTM data, helping you optimize both forms and campaigns based on actual user behavior.
"Reform is not just another form builder - it's a conversion rate optimization tool by the team at FunnelEnvy, who have been optimizing funnels for high growth companies for over a decade. Reform embodies the perfect blend of CRO best practices and intuitive design, so every form you create is not only user-friendly but also finely tuned for conversions."
Reform's analytics capture key UTM parameters, showing which campaigns, sources, and content variations drive the most submissions and highest-quality leads. This data allows you to refine your forms and campaigns quickly, improving overall performance.
Metrics like user interactions, completion rates, and abandonment points are segmented by UTM data, helping you pinpoint which campaigns are most effective and which need adjustments. For example, the team behind Reform has tested hundreds of strategies, achieving a 215% increase in qualified leads for B2B and SaaS companies. These insights are built into the analytics system, guiding you to make data-driven decisions.
Reform also supports A/B testing, enabling you to experiment with different form designs for specific UTM parameter combinations. You might find that social media visitors prefer shorter forms, while search engine traffic responds better to detailed ones. These insights let you tailor experiences to maximize conversions for each audience.
With real-time analytics, you don’t have to wait for reports. Monitor submissions as they happen, quickly identify successful campaigns, and address any issues with UTM tracking on the spot. Reform ensures you stay ahead by providing the tools you need to optimize your campaigns and forms effectively.
Testing and Troubleshooting UTM Parameter Collection
Testing UTM parameters is essential to ensure your data flows correctly from URLs to forms and analytics platforms.
Testing UTM Parameter Collection
Start by using your browser's developer tools to confirm that UTM parameters are being captured. Open the developer console (press F12 in most browsers) and go to the Network tab. Create a test URL with UTM parameters, such as:
https://yoursite.com/form?utm_source=facebook&utm_medium=social&utm_campaign=spring2025
Visit the form page, submit the form, and check the network requests to verify that the UTM data is included in the submission.
Additionally, test with dummy campaign URLs like:
utm_source=test&utm_medium=email&utm_campaign=verification&utm_content=button1&utm_term=signup
Ensure that these parameters are being recorded accurately in your CRM, Google Analytics, or any other connected platforms.
To confirm UTM data persists across sessions, inspect cookies. After visiting a UTM-tagged URL, open the Application or Storage tab in the developer tools and look for UTM-related cookies. These cookies should store your campaign data, but keep in mind that session cookies expire when the user ends their session. Test both immediate and delayed form submissions to understand how your system handles tracking over time.
Don’t forget to test using a variety of parameter combinations and character cases. Since UTM parameters are case-sensitive, it’s important to verify that your system handles variations consistently. Create test campaigns for each traffic source you plan to track - social media, email, paid search, or display ads - to ensure everything works as expected.
Now let’s look at common issues that can disrupt UTM tracking and how to address them.
Common Problems and Solutions
One frequent issue is missing or incorrect data caused by duplicate UTM parameters or inconsistent naming conventions. This can lead to tracking errors and inaccurate reporting.
Another common problem stems from cookie and session errors. These can occur when UTM data doesn’t persist across user interactions. Ad blockers or cookie consent banners may block UTM parameters before users give their permission. To mitigate this, store UTM parameters in cookies immediately when the page loads.
Server-side issues can also interfere with UTM tracking. Sometimes, UTM parameters get truncated or altered during URL processing. Collaborate with your IT team to ensure your server preserves UTM parameters during URL rewrites. Make sure query strings remain intact during redirects.
Integration mapping errors are another challenge. For example, Webex faced an issue when their LinkedIn paid campaign traffic was misclassified as organic in Google Analytics. This happened because the UTM medium parameter was set to "organic social" instead of a paid value. Double-check that your form fields map correctly to your CRM or analytics platform and that each UTM parameter uses appropriate values.
Finally, formatting and syntax mistakes can completely break attribution tracking. Use tools like the Google Analytics Campaign URL builder to avoid errors. Also, avoid placing UTM parameters in the URL fragment (the part after #
), as this can prevent accurate data collection.
Managing a UTM Tracking System
To maintain consistency, create a UTM tracking spreadsheet. This document should standardize your campaign naming conventions and be shared across your team. Review it monthly to catch inconsistencies and ensure everyone is on the same page.
Stick to lowercase for all parameters and establish clear rules for abbreviations, separators, and terminology. For example, always use "facebook" instead of mixing terms like "Facebook", "fb", or "facebook" in different campaigns.
Team collaboration is key. Share the UTM tracking spreadsheet with your marketing team and provide training on how to create UTMs correctly. Implement a process where new campaigns require approval before launch to prevent errors that could compromise data quality.
"UTM parameters play a crucial role in digital measurement strategies by helping with collecting valuable attribution data points about a user visit and activity on your website." - Jude Nwachukwu Onyejekwe, DumbData
Documentation and training materials should include examples of properly formatted UTMs, common mistakes to avoid, and troubleshooting steps for when tracking fails. Create quick reference guides to help team members build campaigns consistently, ensuring accurate data collection across all marketing efforts.
Conclusion: Improving Campaign Tracking with UTM Parameters
Adding UTM parameters to your forms can completely change how you track and optimize campaigns. By using the five standard UTM parameters - source, medium, campaign, content, and term - you can clearly see which marketing efforts deliver the best results.
Businesses that adopt UTM tracking report a 25% boost in attribution accuracy. Plus, data-driven marketing strategies lead to a 20% average improvement in ROI. For example, in Q1 2024, a SaaS company discovered that while Google Ads drove 40% of their traffic, it accounted for only 15% of conversions. On the other hand, LinkedIn Ads, despite generating less traffic, contributed to 35% of conversions. By reallocating their budget accordingly, they achieved a 25% increase in ROI.
Unlike browser cookies or pixel-based tracking, UTM parameters operate independently, making them a dependable approach for attribution. Capturing UTM data through hidden form fields - like those offered by Reform - allows you to directly connect campaign performance to lead generation.
To get the most out of UTM tracking, establish clear naming conventions, use tools like Google’s Campaign URL Builder to avoid mistakes, and keep all campaign details documented in one place. Regularly test your setup to ensure everything is working correctly, and integrate UTM data with your CRM and analytics tools to get a full view of your campaign performance. These steps help you seamlessly incorporate UTM tracking into your marketing strategy.
When implemented correctly, UTM parameters reveal where your traffic originates, identify your most effective campaigns, and guide smarter budgeting decisions. This leads to better resource allocation, improved campaign performance, and stronger business growth through accurate lead tracking and attribution. By embracing these strategies, you can take your campaign tracking to the next level and achieve measurable results.
FAQs
How do UTM parameters help track the success of marketing campaigns?
UTM parameters are a handy tool for tracking and analyzing the performance of your marketing campaigns. By tagging your links with details like source (e.g., Facebook, email), medium (e.g., social, newsletter), and campaign name, you can pinpoint exactly where your traffic is coming from.
This added layer of detail helps you better attribute conversions, identify which campaigns are delivering results, and make smarter, data-backed decisions to improve your marketing strategies.
How can I ensure UTM parameters are tracked consistently across sessions and devices?
To make sure UTM parameters are tracked accurately across sessions and devices, here are some tips to keep in mind:
- Stick to standardized and consistent naming conventions for all UTM tags. This helps avoid confusion and ensures reliable tracking.
- Use persistent identifiers like unique session IDs or user login data to connect activity across different devices.
- Apply a uniform tagging strategy across every campaign to make tracking and analysis easier.
These practices can help you achieve more precise data and better understand how your campaigns perform across various touchpoints.
How do I connect UTM parameters to my CRM for better lead tracking and campaign analysis?
To link UTM parameters to your CRM and enhance lead tracking, begin by collecting UTM data using tracking scripts or by appending it to your URLs. Make sure your forms are configured to capture this information when leads fill them out. From there, leverage your CRM's API or form integration tools to transfer the UTM data into your system.
After the integration is complete, associate the UTM parameters with individual lead records in your CRM. This setup enables you to evaluate campaign performance, pinpoint lead sources, and gather more detailed insights into your marketing activities.
Related posts
Get new content delivered straight to your inbox
The Response
Updates on the Reform platform, insights on optimizing conversion rates, and tips to craft forms that convert.
Drive real results with form optimizations
Tested across hundreds of experiments, our strategies deliver a 215% lift in qualified leads for B2B and SaaS companies.
