How to Capture Facebook Ads Data in Typeform Forms
If you run Facebook or Instagram ads and collect leads with Typeform, the form submission alone tells you a name and an email, not which ad earned the click. This guide shows how to attach campaign, network, ad set, and ad information to every Typeform lead so you can report on ad performance later.
What you are trying to achieve
The goal is simple: when someone submits a Typeform lead form, the submission should carry the Facebook Ads context that brought them there. That means the channel (for example, Paid Social), the network (Facebook, Instagram, or Messenger), the campaign, the ad set, and the specific ad. Once that context is stored with the lead, you can count leads per campaign, compare networks, and see which ads actually convert. The setup has four parts: tag your ad URLs, install the attribution script on your site, add hidden fields to the Typeform, and let the script fill those fields at submission time.
Step 1 — Tag your Facebook Ads with UTM parameters
UTM parameters are text appended to the destination URL of an ad. They tell your analytics setup which campaign, network, and creative sent the visitor. A tagged URL might look like this: https://roipaths.com/integrations/typeform?utm_medium=paidsocial&utm_source=facebook&utm_campaign=brand-campaign. The parameter names are fixed, but the values are yours to choose. A common convention for Facebook Ads is:
- utm_medium = Paid social
- utm_source = Facebook (or Instagram, or whichever network the ad runs on)
- utm_campaign = the campaign name
- utm_term = the ad set name
- utm_content = the specific ad
Free UTM builder tools can help you assemble these URLs consistently. Consistency matters more than the exact wording: if one campaign uses utm_source=facebook and another uses utm_source=facebook.com, reporting gets messy unless your attribution layer normalizes the values.
Step 2 — Install the attribution script on your website
The attribution script is a small snippet added to your site. On each visit it reads technical signals about how the visitor arrived and works out their origin, including whether they came from a Facebook Ad. When the visitor later submits a form, the script writes the attribution values into hidden fields that Typeform captures alongside the lead's name and email. Installation is a one-time step: after signing up you receive the snippet and add it to your site following the setup instructions.
Step 4 — Confirm the data is captured on submission
When a visitor arrives from a Facebook Ad, the script stores the UTM values in a cookie in their browser, so the values survive as they browse other pages. When they eventually complete the form, the script writes the Facebook Ads data into the hidden fields, and Typeform records it together with the lead's name, email, and other answers. The cookie is the reason the data is not lost when the form lives on a different page from the ad's landing page.
Field-to-report map
Each hidden field answers a different reporting question. Use this map to decide which fields you actually need before you build reports:
- Channel — which broad source produced the lead (for example, Paid Social versus Organic Search). Use it for a leads-by-channel report.
- Channel Drilldown 1 — the network, such as Facebook, Instagram, or Messenger. Use it to compare networks.
- Channel Drilldown 2 — the campaign name. Use it for a leads-by-campaign report.
- Channel Drilldown 3 — the ad set name. Use it to compare audiences or placements within a campaign.
- Channel Drilldown 4 — the specific ad. Use it to see which creative earns the most leads.
- Landing Page — the exact page the visitor first landed on. Use it to see which pages convert.
- Landing Page Group — a grouped version of the landing page (for example, /blog). Use it to measure content sections rather than individual pages.
Worked example: from ad click to Typeform submission
Suppose you run a Facebook ad for a brand campaign, in an ad set called 'Lookalike – 1%', with a creative called 'Spring offer'. Your tagged URL might be: example.com/quote?utm_medium=paidsocial&utm_source=facebook&utm_campaign=brand-campaign&utm_term=lookalike-1pct&utm_content=spring-offer. A visitor clicks the ad, lands on your quote page, browses to a pricing page, then submits your Typeform. At submission, the hidden fields would carry values roughly like: Channel = Paid Social; Channel Drilldown 1 = Facebook; Channel Drilldown 2 = brand-campaign; Channel Drilldown 3 = lookalike-1pct; Channel Drilldown 4 = spring-offer. If the visitor had instead arrived from an organic search result, the Channel field would show Organic Search and the drilldowns would reflect that source instead. That is what makes a leads-by-channel report possible across all your traffic, not only paid ads.
Two different reasons attribution data goes missing
Not all missing data has the same cause, and the fix differs.
First, the form page may not be the landing page. Many UTM-capturing methods only read parameters present on the page where the form is submitted. If a visitor clicks an ad, lands on your homepage, then navigates to a separate quote page before submitting, those methods lose the parameters. A cookie-based approach avoids this because the values are stored on arrival and read again at submission.
Second, the hidden fields may be missing or misnamed. If the field names in Typeform do not exactly match the expected names, the script has nowhere to write the values, and the submission arrives without attribution even though the visitor's origin was known. Before blaming the ad platform, check that every hidden field exists and is spelled correctly.
Why value normalization matters
UTM values are typed by humans and tend to drift. One campaign may use utm_source=facebook while another uses utm_source=facebook.com. A normalization layer recognizes these as the same source and assigns the lead to the correct channel, in this case Paid Social. Without normalization, the same network appears as several different sources in your reports, and lead counts split across them.
Where to send the captured data
Typeform's native integrations and third-party connectors such as Zapier can move the captured values into the systems where you do reporting:
- CRM — send the Facebook Ads fields into HubSpot, Pipedrive, Salesforce, or a similar CRM. Built-in CRM reporting can then show lead counts by campaign, conversion to customer, and revenue generated.
- Spreadsheet — Typeform connects natively to Google Sheets and Microsoft Excel. New submissions, including the hidden-field values, arrive as rows. You can analyze them in the sheet or connect a BI tool such as Google Data Studio or Microsoft Power BI for deeper reporting.
- Email notifications — if you respond to leads by email rather than through a CRM, append the Facebook Ads data to the lead notification so each lead's origin is visible in the message.
- Billing platform — if you use Stripe or Square connected to Typeform, you can pass the attribution data through and report on revenue by ad source.
Three reports worth building first
Once the data lands in a CRM or spreadsheet, start with three views:
- Leads by channel. Because the setup captures every channel, not only paid ads, this report shows how Facebook Ads compare with Organic Search, Organic Social, Direct, and Referral. It supports decisions about where to allocate marketing budget.
- Leads by network. If you run ads across Facebook, Instagram, and Messenger, this view shows which network produces the most leads, so you can shift spend toward the app that performs best.
- Leads by campaign. A monthly view of leads per campaign shows which campaigns are producing volume and helps you decide where to increase investment.
Pre-launch checklist
Before you rely on the numbers, confirm each of these:
- Every active Facebook Ad URL carries utm_medium, utm_source, utm_campaign, utm_term, and utm_content values.
- The attribution snippet is present on every page that hosts a lead form.
- All seven hidden fields exist in each Typeform and are spelled exactly as listed above.
- A test submission from a tagged URL shows populated values in the Typeform response.
- A test submission from an untagged URL shows the correct fallback channel (for example, Direct) rather than blank fields.
- Your CRM or spreadsheet receives the hidden-field values, not just the visible answers.
Frequently asked questions
Do I need to add UTM parameters to every Facebook Ad?
Yes, if you want campaign-level reporting. Without UTM parameters, the attribution script can still identify the channel in many cases, but it cannot reliably distinguish one campaign, ad set, or ad from another. Tag every active ad URL with the five standard parameters so each lead can be traced to the specific creative that earned it.
What happens if a visitor submits the form on a different page from the one they landed on?
With a cookie-based attribution script, nothing is lost. The UTM values are stored in the visitor's browser when they first arrive, so they are still available when the form is submitted on a later page. Methods that only read parameters from the current page would lose the data in this scenario.
Why are my hidden fields empty in some submissions?
Check two things. First, confirm the hidden field names in Typeform match the expected names exactly, including capitalization and spacing. Second, confirm the attribution snippet is loaded on the page where the form appears. If either is missing, the submission arrives without attribution even when the visitor's origin was known.
Can I track leads from Instagram and Messenger ads too?
Yes. Set utm_source to the network the ad runs on, such as Instagram or Messenger, and the Channel Drilldown 1 field will reflect that network. A leads-by-network report then shows which app is producing the most leads.