How to track attribution for Facebook Ads & Google Ads with hidden fields


In this article, we will show you how to track attribution of your ads when your LeadForm is filled out. This way you will know which campaigns, ad groups (or ad sets), and ads are working. This works for:

  • Google Ads
  • Facebook Ads
  • Bing Ads
  • LinkedIn Ads
  • And any other ad platform. 

Use Case:

This article applies to you if you have the following use case:

You are running ads on an advertising platform such as Google Ads and you would like to know which specific campaigns and ads drove in the lead upon submission of your LeadForm.

This article will help you answer questions such as:

  • What ads are driving leads and conversions? 
  • What keywords and/or audiences are driving in leads?
  • What campaigns are driving in leads
  • What locations, devices, ad group and so on are driving in leads

What this article does not cover:

Before we begin, it's important to note that this article does not cover adding the ad platform's conversion pixel (i.e, Facebook Pixel) to your LeadForm. The recommended approach here is to redirect the form to a custom thank you page where your conversion pixel fires. You can also integrate with our Google Analytics integration for more detailed tracking.Note: 

Tracking Attribution Using UTMs & Hidden Fields

The first approach is to track attribution using a combination of UTMs and Hidden Fields in your forms. 

 A UTM is a set of parameters (or, UTM code) added to URLs to identify and track website traffic generated by a specific marketing campaign. If you're using UTMs in your ads, then you can setup your LeadForm to capture the UTMs with a hidden field, then to post the UTMs upon submission of your LeadForm.

When using UTMs your URL will end up looking something like this. Everything bolded that comes after the /? should be set within your ad platform, then can be pulled into the form with hidden fields.

<div><a href="https://yourdomain">https://yourdomain</a>/landingpage/<strong>?utm_campaign={campaign_name}&keyword={keyword}&ad_group={adgroup}&ad_id={adid}</strong></div>

For help building UTMs we highly suggest using Google's URL Campaign Builder. This will auto generate a URL with UTMs:

In this section we'll show you:

A) Where to find/add the UTMs in your ad platform 

B) How to setup hidden fields in your form to capture the UTMs

A) Where to find/add UTMs in your ad platform

Each ad platform is different and there are so many different ad platforms. So we'll cover to of the most common: Facebook ads and Google:

Adding UTMs in Facebook Ads

You can find the area to add UTMs inside of your Facebook Ads at the ad level. When you go to create your ad, click on 'Build URL parameter'

Clicking on Build a URL parameter will open up a box that allows you to add UTMs to your ad.

Or, you can setup the entire URL with the UTMs with the Google Campaign URL builder and paste that URL into your ad. 

Adding UTMs in Google Ads

There are a few different places to add UTMs inside of Google Ads. You can add your UTMs at the ad and ad group level, or at the campaign level. We typically recommend adding UTMs at the campaign level.  

For example, click into the campaign, go to settings, then look for the section called Campaign URL options.

This is where you can add a tracking template that will automatically populate the UTMs into the URL when the ad is clicked. Here's an example of the tracking template that we use: {lpurl}&utm_source=google&utm_medium=paidsearch&utm_campaign=insert_campaign_name&utm_term={keyword}

Note: If you use our tracking template above, you may need to adjust some of the parameters based on your systems and tracking preferences. For example, utm_medium could also be expressed as 'CPC' or 'PPC'. Here's more information about setting up a tracking template with Google ads.

B) How to create hidden fields to capture the UTM parameters 

Next, you will need to set hidden fields inside of your LeadForm to capture the UTMs from the parameters in the URL.

For example, imagine that someone clicks on a Google paid search ad that leads to this URL:

<a href="https://yourdomain/">https://</a>

We can setup hidden fields to pull each and every parameter out of the URL and into the LeadForm. 

For example: we could create hidden fields for:

  • Campaign
  • Keyword
  • Ad group
  • Ad
  • And the list goes on (device, adgroup_id, location, etc)

To create a hidden field:

Go to the form step in your LeadForm. In this case it's our 'Contact Form' step. We always recommend setting the hidden fields on the last step of the form, or on your last form step. You only need to set hidden fields on one step.

If you don't already have a form step, then you will need to create one by clicking 'Add step +' then select a form step.

Next, click on 'Add Form Field' to add a new hidden field

After you click on '+Add form field' set your Field Type to 'URL lookup' (note: At some point this will change to say hidden field. So depending upon when you see this documentation, you will either see 'URL lookup' or 'hidden field' - do not select 'hardcoded hidden field')

After the field type is set, add your parameters to the following section. You will need to create a hidden field for each parameter in the URL. So for this example, let's say that we're looking to capture the campaign name. Our setup might look something like this:

Simply add your parameter to each of the three fields:

  • - Field name
  • - Field label
  • - URL Parameter Name: Note: This must match whatever the parameter is set to in your URL

Next, click 'Save form field'

As you can see in the example above, upon clicking 'Save' the field was added, but you won't see it in the preview of the form because it is a hidden field. 

Now continue going through the process for each parameter that you would like to capture in your LeadForm from the URL:

In the example above, we're creating a second hidden field to capture the keyword parameter from the URL.

You can view the lead in your lead with all parameters right inside of GetLeadForms. Just go to your leads list, then click into the lead.

You'll see the hidden fields listed out in the lead details page. So for example, if you'd like to know what keyword or ad drove the conversion, you just need to find the hidden field that you setup for the URL/add.

These details will also be passed through in your email notifications if you're using email notifications and passed through to your CRM if you have integrated with your CRM. You can use our Zapier integration to connect to your CRM. We also have a number of custom integrations and webhooks

You can also export your lead list to a CSV and open in an excel sheet to filter based on parameters for additional analysis. 


If you need any help with the above, please reach out to

Still need help? Contact Us Contact Us