DocsIntegrations

How to track lead source in Gravity Forms

A Gravity Forms enquiry tells you what the visitor wrote. It does not tell you whether they came from a Google ad, a newsletter or a search result.

TrackLeadSource fills five hidden fields in your form with the source, medium and campaign of the visit, the sources the visitor came from in order, and the pages they viewed. Each enquiry arrives with that context, so you can see it with the enquiry and in anything the form is connected to.

With the source saved on every enquiry, you can see which channels bring leads and, once sales results are added in your CRM, which bring customers. Setup takes one snippet and five hidden fields in your form.

Install the snippet

  1. Sign in to your TrackLeadSource dashboard and open Websites, then your website.
  2. Go to the Installation tab and copy the snippet.
  3. Paste it before the closing </head> tag on every page, including the page with your form.
<script async src="https://app.trackleadsource.com/tls.js" data-site-id="tls_your_site_id"></script>

Add the hidden fields

  1. In WordPress, go to Forms and click Edit under your form.
  2. Drag the Hidden field from the right-hand menu into your form, below your visible fields.
  3. Click the field to open its settings on the right.
  4. Set Field Label to tls_source and Default Value to [tls_source].
  5. Tick Allow field to be populated dynamically and leave Parameter Name empty.
  6. Repeat steps 2 to 5 for the other four fields, using the table below.
  7. Click Save Form.
Field LabelDefault Value
tls_source[tls_source]
tls_medium[tls_medium]
tls_campaign[tls_campaign]
tls_channel_path[tls_channel_path]
tls_page_path[tls_page_path]

The names must match exactly. The snippet replaces each default value when the page loads. Gravity Forms 3.0 and later need the dynamic population option ticked on every field.

If entries go to a CRM or spreadsheet through another plugin, map the five fields there too.

Send a test enquiry

  1. Add the bold part to the end of your website address and open it: example.com/?utm_source=test&utm_medium=cpc&utm_campaign=autumn
  2. Click through to the page with your form and submit it.
  3. Go to Forms > Entries, open the new entry and check that the source is test, the medium is cpc and the campaign is autumn.

If a field still shows its default value, such as [tls_source], the snippet did not run on that page.

If every field says TrackLeadSource inactive, the site ID in the snippet is wrong or the domain of the page does not match the website in your dashboard.

Support

If you have any questions, don’t hesitate to reach out to hello@trackleadsource.com.

Know the story behind your next enquiry