Skip to content

How to Track Instagram Ads in Gravity Forms

Gravity Forms records what a visitor types into your form, but it does not automatically know which Instagram ad brought that visitor to your site. This guide shows how to connect the two: tag your Instagram Ads with UTM parameters, install an attribution script, add hidden fields to your Gravity Form, and use the captured data to report on leads by channel, network, and campaign.

What you need before you start

You will need an active Gravity Forms form on your website, the ability to edit your site's header or footer code, and access to your Instagram Ads campaign settings so you can append UTM parameters to each ad's destination URL. You will also need an attribution tool that reads UTM parameters and writes them into hidden form fields. The workflow below uses marketing attribution software, but the field mapping and reporting logic apply to any tool that can populate hidden fields from URL parameters.

Step 1: Add UTM parameters to your Instagram Ads

UTM parameters are short pieces of text appended to the end of a destination URL. They tell your analytics and form tools where a visitor came from. For Instagram Ads, a consistent naming convention is the foundation of clean reporting. The values are up to you, but this mapping works well as a starting point: UTM Medium = Paid social; UTM Source = Instagram; UTM Campaign = the campaign name; UTM Term = the ad set name; UTM Content = the specific ad. For example, a destination URL might look like: https://roipaths.com/integrations/gravity-forms?utm_medium=paidsocial&utm_source=instagram&utm_campaign=brand-campaign. Free UTM builders are available online, and you can review recommended UTM parameters for guidance on what to put in each one.

Step 2: Install the attribution script and add hidden fields

After tagging your ads, install the attribution script on your website. Signing up for the attribution tool typically produces a small snippet of code to place on your site; the exact placement depends on your website builder, and the tool's own setup documentation should cover the options. Next, add a series of hidden fields to your Gravity Form. The field names are: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, and Channel Drilldown 4. In Gravity Forms, you add a Hidden field type by dragging it into the form. Step-by-step instructions for adding hidden fields to Gravity Forms are available.

Step 3: How the attribution data reaches the hidden fields

Once the script is installed, it looks at where each visitor came from and stores that information in a cookie in the visitor's browser. The cookie persists as the visitor browses your site or leaves and returns. When the visitor submits a Gravity Form, the script writes the stored attribution data into the hidden fields. This is why the hidden fields must be present on the form before the submission happens: the script can only populate fields that exist.

Step 4: Confirm the data is captured in Gravity Forms

After a submission, open the Entries page in Gravity Forms. The Instagram Ads data should appear alongside the visitor's name, email, phone, and other form answers. From there you can include the fields in notification emails, send them to a CRM through Gravity Forms' native integrations or a third-party connector such as Zapier, or send them to a spreadsheet for reporting. Gravity Forms documents Salesforce, Pipedrive, HubSpot, and Dynamics among its CRM destinations, and other connectors may be available depending on your setup.

Field map: which hidden field receives which value

Use this map to keep your form fields and UTM parameters aligned. Channel receives the broad category, such as Paid Social. Channel Drilldown 1 receives the source, such as Instagram. Channel Drilldown 2 receives the campaign name. Channel Drilldown 3 receives the ad set or ad creative name. Channel Drilldown 4 is available for an additional level if your naming convention needs it. If a UTM parameter is missing from the ad URL, the corresponding hidden field will be empty or will fall back to a default, depending on the attribution tool's configuration. That is different from a form that lacks the hidden fields entirely: in that case, the data may be stored in the cookie but has nowhere to be written on submission.

Worked example: a home builder running Instagram Ads

Imagine a regional landscaping company running an Instagram campaign called Spring Refresh. One ad creative is named Patio Reveal. A visitor taps the ad, lands on a blog post, browses for a while, and later submits a Gravity Form. With the hidden fields in place, the submission records Channel: Paid Social; Channel Drilldown 1: Instagram; Channel Drilldown 2: Spring Refresh; Channel Drilldown 3: Patio Reveal. The form also captures the initial landing page, such as greenleafscapes.com/blog/patio-ideas, and its landing page category, such as /blog. That lets the team see which content sections and specific blog posts are producing leads, not just which ad was clicked.

What data gets captured

The attribution tool sends two groups of data. Marketing channel data describes how the lead arrived: the broad channel, the source network, the campaign, and the ad or ad set. Landing page data describes the first page the visitor saw and its category. Together these let you report on leads by channel, by network, and by campaign. The attribution tool also identifies leads from organic search, Google Ads, Facebook Ads, and other channels, and it normalizes variations such as "instagram" versus "instagram.com" into the same group. Which product supplies this capability, and where to sign up, depends on the tool you choose for your own site.

Three reports to run once data is flowing

The channel report groups leads by acquisition path — organic search, paid search, paid social, and similar categories — so you can see where demand originates. When one channel supplies most of your leads but another consumes most of your budget, the gap is a signal to rebalance spend. The network report compares lead volume across advertising networks; if your Instagram Ads also run on Facebook, Messenger, or WhatsApp, you can see which network performs best. The campaign report breaks leads down by the Instagram campaign they came from, so you can see which campaigns deserve more budget. These reports require the captured data to be sent to a CRM or spreadsheet first.

Checklist before you launch

Confirm that every Instagram ad URL carries utm_medium, utm_source, utm_campaign, and — where relevant — utm_term and utm_content. Confirm that the attribution script is installed on every page where a Gravity Form appears. Confirm that each form includes the Channel and Channel Drilldown hidden fields. Submit a test entry from a tagged URL and check that the values appear in the Gravity Forms Entries page. If a value is blank, check the ad URL first, then the hidden field names, then the script installation.

Frequently asked questions

Do I need UTM parameters if I already use Google Analytics?

Google Analytics can show how many visitors arrive from Instagram Ads, but it does not automatically write that source into a Gravity Forms submission. UTM parameters plus hidden fields are what connect the ad click to the individual lead record in Gravity Forms.

What happens if a visitor submits a form on a different page from the one they landed on?

The attribution tool stores the source in a cookie in the visitor's browser, so the data can be written into hidden fields on whichever page the form is submitted, as long as the script and hidden fields are present there.

Can I send the captured Instagram Ads data to my CRM?

Yes. Gravity Forms can send the hidden field values to a CRM through its native integrations or a third-party connector such as Zapier. Common destinations include Salesforce, Pipedrive, HubSpot, and Dynamics.

Why are my hidden fields empty after a submission?

Check three things in order: whether the ad URL includes the relevant UTM parameter, whether the hidden field names on the form match the names the attribution tool expects, and whether the script is installed on the page where the form was submitted. A missing UTM parameter produces an empty value even when the form and script are configured correctly.