Blog -

How to Set Up UTM Tracking for Better Analytics with Gravity Forms and LeadSources

the Gravity Forms community By the Gravity Forms community Published March 4, 2025

LeadSources Featured imageWritten by the editorial team at LeadSources…

Do you know which marketing channels drive the most leads through your Gravity Forms? Are they coming from Facebook Ads, Google Ads, or your affiliate campaigns? The good news is that tracking this information is simpler than you might think, thanks to UTM tracking.

Understanding the source of your best leads isn’t just nice to know—it’s essential for making informed decisions about where to invest your marketing budget. Without this insight, you could be spending money on campaigns that aren’t delivering results.

In this article, we’ll guide you through setting up UTM tracking in Gravity Forms with LeadSources, so you can track where your best leads are coming from.

LeadSources.io is a third-party solution. Gravity Forms does not offer support for this platform, nor is this article intended to be a Gravity Forms endorsement of this platform, its developers, or quality of support. As always, we recommend you extensively evaluate all solutions to ensure their suitability for your purpose.

Benefits of Tracking UTM Parameters

Tracking UTM parameters in Gravity Forms is a way to gather data about your leads like their channel, source, campaign, term, or content.

For example, you can track whether it’s your organic social efforts, Google Ads, or your PR campaign that generates your best leads. You’ll then gain a clear view of what channel is the most efficient.

Additionally, not all leads are created equal. UTM tracking helps you understand the quality of your leads generated from different sources.

For instance, leads coming from your targeted LinkedIn campaign might be more valuable than those from a generic Facebook ad. By tracking UTM data, you can assess lead quality and focus on sources that bring in the most qualified prospects.

When a lead transforms into a paid customer, you can trace the customer back to the source, campaign, keyword, or ad that generated the sale.

You can then fine-tune your marketing strategies by doubling down on the channels that bring sales. If a channel is underperforming, you can adjust your approach or redirect your budget to more profitable channels, campaigns, keywords or ads.

This helps you significantly reduce your marketing costs while boosting your lead generation.

How to Capture UTM Parameters in Gravity Forms with LeadSources

Step 1: Sign Up for LeadSources

LeadSources can be used with Gravity Forms to capture the UTM parameters from within your form.

With LeadSources, you can easily track four different UTM parameters for each lead:

  • UTM_source – Used to track the site where the lead is coming from.
  • UTM_campaign – Used to track the campaign name.
  • UTM_term – Used to track the keyword that was searched.
  • UTM_content – Used to track the exact ad.

Additionally, LeadSources automatically tracks the following data (without using UTM parameters):

  • Channel (e.g., organic search, paid social, referral, direct, etc.)
  • Landing page (e.g., yoursite.com/services/service-name)
  • Landing page subfolder (e.g., /services)

To set up LeadSources, go to LeadSources.io, and sign up for a 14-day free trial.

From your account, grab your LeadSources tracking code, and add it to the head tag of your website.

Step 2: Add the hidden fields to your Gravity Forms

When users fill out your forms, they provide personal information like their name or email address.

At the same time, LeadSources automatically populates the UTM parameters in the hidden fields of your form.

To make this work, add a hidden field to your form for each UTM parameter you want to capture:

  • Source
  • Campaign
  • Term
  • Content

Here is how.

To do this, log in to your WordPress dashboard and click Forms.

Select the form where you want to add the hidden fields.

From the right panel, drag and drop the Hidden field into your form.

Leadsources-Hidden-fields-Gravity-forms

When you click on the field, the fields settings panel will open on the right.

LeadSources-Add-hidden-fields-Gravity-forms-1

To create the Source hidden field, add the following:

  • Field Label = Source
  • Default value =

Add the rest of the fields by following the same steps.

For the Campaign hidden field:

  • Field Label = Campaign
  • Default value = [campaign]

For the Term hidden field:

  • Field Label = Term
  • Default value = [term]

For the Content hidden field:

  • Field Label = Content
  • Default value = [content]

For the Channel hidden field:

  • Field Label = Channel
  • Default value = [channel]

For the Landing page hidden field:

  • Field Label = Landing page
  • Default value = [landingpage]

For the Landing page subfolder hidden field:

  • Field Label = Landing page subfolder
  • Default value = [landingpagesubfolder]

You are all set! Now your form should look like this:

LeadSources-Gravity Forms hidden fields added

Now, when a user clicks on your campaign and visits your site, LeadSources captures the UTM parameters from the URL.

When the user then fills out your form, LeadSources will populate the UTM parameters to the hidden fields.

Once the form is submitted, both UTM parameters and form responses are sent together to the Gravity Forms submission page.

How to Optimize Your Marketing Strategy with UTM Tracking

Once you start capturing UTM parameters, you can generate performance reports, such as:

  • Leads per source
  • Revenue per keyword
  • Revenue per ad

This helps you make smarter decisions about your marketing spending. Let’s see how.

Lead Performance Reports

If you’re running campaigns on multiple channels (PPC, social media, etc.), you can export the data from Gravity Forms and create a “Leads by Channel” report.

LeadSources-Leads-by-channel

If you discover that Google Ads generates your best leads, you can then break down the data by campaign.

LeadSources-Leads-by-campaign

Once you identify which campaign drives the best leads, you can analyze which keywords are bringing in those leads.

LeadSources-Leads-by-keyword

Sales Performance Report

By integrating Gravity Forms with a CRM, you can generate similar reports based on sales.

After identifying which ads and keywords bring in the most leads, you can then check whether they are contributing to your bottom line.

For example:

Channels Google Ads Facebook Ads
Leads 50 75
Sales 5 6
Avg Order Value $150 $100
Revenue $750 $600

In this example, ads are run on Google and Facebook. The “Leads by Channel” report showed that the Facebook Ads generated more leads than the Google Ads.

However, after analyzing conversions, it turned out that Google Ads generated more revenue with fewer leads. As a result, you could decide to transfer some of your Facebook budget into Google Ads.

When you have more data, you can make more informed decisions about where to spend your marketing time and resources.

Try LeadSources Today!

Setting up UTM tracking gives you the insights you need to optimize your marketing strategies effectively.

By understanding where your most valuable leads are coming from, you can allocate your budget more effectively and focus on the channels, campaigns, keywords, or ads that deliver your best leads.

To start tracking your UTM parameters with LeadSources for Gravity Forms, head over to Leadsources.io and sign up for your 14-day free trial.