Set up Gravity Forms for Marketing Attribution and UTM Tracking

Step-by-step setup to add Madlitics fields to Gravity Forms so every response includes channel, campaign, and landing page attribution.
Attribution is broken

Add marketing attribution to your Gravity Forms entries so each lead can arrive with its original channel, campaign details, and landing page.

This guide walks through installing Madlitics on WordPress, configuring hidden fields in a new or existing Gravity Form, and receiving attribution in entries and sending it to your CRM.

For an explanation of first-touch attribution and reporting, see our Gravity Forms marketing attribution guide.

‍

‍

Before you begin: Make sure Madlitics is installed across your WordPress website, including the pages visitors land on and the pages containing your forms. Follow the WordPress installation guide if you haven’t added the script yet.

Install and activate Gravity Forms, if needed

Already using Gravity Forms? Skip this step and open the form you want to configure.

Step 1: Gravity Forms is a commercial WordPress form builder plugin that you must purchase from the Gravity Forms website ↗. After buying a license, you download the plugin as a ZIP file and manually upload it to your WordPress site. Select 'Plugins' from the sidebar menu and either click the 'Add Plugin' button from the page or select the 'Add plugin' dropdown menu item. Click the 'Upload Plugin' button, choose the Gravity Forms download zip, and click 'Install Now'.

Once installed the plugin must be activated by clicking the 'Activate' button. Once activated, you'll be redirected to the Plugins page, to register your Gravity Forms license key.

Plugins > Add Plugin > Upload plugin > Activate

Plugins > Add Plugin > Upload plugin.
Select the Gravity Forms plugin to upload and 'Install Now'

‍

Click 'Activate Plugin' to enable Gravity Forms

‍

Register your Gravity Forms license key and continue to the next step

Create or open your Gravity Form

Step 2: In your WordPress dashboard, go to Forms and select Edit beneath the form you want to configure.

To create a new form, select Add New, choose a template, and complete the form details. Add the contact fields your visitors will fill out, then configure the attribution fields below.

Click on the 'Add New' button from the Forms page, or select the'New Form' submenu item

‍

Select the form template

‍

Add a couple details to begin using the template

Configure fields for attribution

Step 3: Add seven hidden fields to receive Madlitics attribution data. Visitors won’t need to complete these fields; Madlitics populates them automatically.

  1. Drag a Hidden field into your form.
  2. Select the field to open its settings.
  3. Under General, set the Field Label to channel.
  4. Under Advanced, set the Default Value to [channel], including the square brackets.
  5. Repeat for the remaining fields listed below.
  6. Save the form.

The field label and default value are separate settings. For example, use channel as the label and [channel] as the default value.
‍

Create forms that fit your process, with any fields you choose.
Place a hidden field in your form to store attribution data from Madlitics.

‍

Set the 'Field Label' to the first Madlitics Field, 'channel'

‍

Set the 'Default Value' to the first Madlitics Field: [channel]

‍

Repeat this process for the 6 remaining Madlitics fields, and save the form to begin collecting customer lead data.

‍

Default Madlitics fields and values

Marketing Channel
‍
Classifies the original visit into a marketing channel, such as Paid Search, Organic Social, or Referral.
Field label: channel
Default value: [channel]

‍Segment 1
Records utm_source for tagged campaign visits. For other traffic, its value depends on the classified source.
Field label: segment1
Default value: [segment1]

Segment 2
 
Records utm_campaign for tagged campaign visits.
Field label: segment2
Default value: [segment2]

Segment 3
‍
Records utm_term. This contains whichever detail you assign to that parameter, such as an ad group or keyword.
Field label: segment3
Default value: [segment3]

Segment 4
‍
Records utm_content. Use it to distinguish creatives, ads, or link variations.
Field label: segment4
Default value: [segment4]

Landing Page
Records the visitor’s original entry page, which may differ from the form submission page.
Field label: lp
Default value: [lp]

Landing Page Group
‍
Records the group or category associated with the original landing page.
Field label: lpg
Default value: [lpg]

‍

Campaign segment values depend on the incoming tags and traffic source. Untagged or Direct visits won’t necessarily populate every segment.

These seven fields cover the default attribution setup. Click IDs and other additional values require their corresponding fields. See UTM tracking in Gravity Forms for campaign tagging guidance.

Embed the Gravity Form

If your form is already embedded, save your field changes and test it on the published page. For a new form, follow the steps below to add it to a WordPress page.

Step 4: Select the page (or post) you want to begin capturing marketing data on, with the newly created form. In the page editor, select 'Add Block', search for Gravity Forms and click the Gravity Forms block component. Select the name of the form, that includes the hidden fields, from the Select Form dropdown to embed it on the page.

Repeat the field configuration for each form you want to enrich. You can embed the same configured form on multiple pages.

Add block > Search 'Gravity Forms' > Select Gravity Forms > Select form

Select 'Add Block' > Search for 'Gravity Forms' > Select the'Gravity Forms' block.

‍

Select the gravity form from the dropdown.

‍

Don't forget to Save; and Publish

‍

‍

Receive attribution in Gravity Forms entries

Once your form is saved and published, Madlitics populates the configured hidden fields when a visitor submits. Their original marketing channel, campaign segments, and landing page appear alongside their contact details in Forms → Entries.

That attribution stays connected to the submission even when the visitor first arrives on another page and navigates before completing the form. Available campaign details depend on the incoming tags and traffic source.

Submit a test inquiry on your published website and open the saved entry to confirm that the expected attribution is present.

‍

Captured attribution data will display within Gravity Forms.

‍

Send Gravity Forms attribution to your CRM

Use your Gravity Forms integration, webhook, or automation workflow to send the captured attribution alongside each lead’s contact details.

Map the Madlitics fields to the corresponding properties in your CRM, including channel, source, campaign segments, and original landing page. Once configured, new submissions can carry that marketing context into your existing sales and reporting workflows.

As leads become opportunities and customers, use their original attribution to compare lead quality, pipeline, and revenue by channel or campaign.

Follow our guide to sending attribution data to your CRM for field mapping guidance.

Stacked bar chart showing lead generation by marketing channel over time, comparing sources like Paid Search, Paid Social, Organic Search, Direct, and Email. Helps visualize which channels drive the most traffic.
Line chart displaying lead-to-customer conversion rates by channel, comparing Google Ads, Facebook Ads, LinkedIn Ads, Organic Search, and Email. Shows how different sources drive qualified leads over time.
Line chart showing revenue performance by marketing campaign, comparing Google Ads, Facebook Ads, and LinkedIn Ads. Helps identify top-performing and underperforming campaigns.

Related articles

With Madlitics now activated and your forms ready to accept marketing attribution data, you can start tracking valuable insights immediately, and pass attribution data into your CRM, email marketing platform, business intelligence tool or more for advanced reporting.

Frequently Asked Questions

Answers to common questions about setting up tracking with Madlitics and Gravity Forms