Skip to content

Capture Facebook Ads Data in Netlify Forms

Visitor counts alone do not show which Facebook campaign, ad set or ad produced a lead. By tagging ad URLs, storing the attribution details in the browser, and passing them through hidden form fields, each Netlify submission can carry its originating campaign and landing page alongside the contact details.

Tag every ad URL consistently

Start with a consistent UTM convention so campaign, ad set and ad can be distinguished later. A practical mapping is: medium for the paid channel type, source for the platform, campaign for the campaign name, term for the ad set, and content for the individual ad. Apply the same pattern to every Facebook ad URL, including Instagram, Messenger and other Meta placements where relevant. Keep names readable and stable; changing a campaign name mid-flight makes month-to-month reporting harder to compare.

Store attribution and pass it through hidden fields

Install a small attribution snippet on the website. On arrival it reads the UTM parameters and other arrival details, determines the originating channel, and stores that information in the browser. When the visitor later submits any form, the snippet writes the stored details into hidden fields. Hidden fields are present in the form structure but are not shown to visitors. Add these fields to each Netlify form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group. The drilldown fields provide progressively finer detail, while the landing-page fields show which page and page section first brought the visitor in.

Verify the setup with a test submission

Checklist before launching: confirm every Facebook ad URL carries the full UTM set; confirm the snippet loads on landing pages; confirm all six hidden fields exist on each form; submit a test form from a tagged URL and verify the fields populate in Netlify; submit from an untagged or organic visit and confirm the channel is still classified sensibly; and check that inconsistent source spellings are normalised rather than creating duplicate channels. This test distinguishes a tagging problem from a snippet or hidden-field problem: if the URL is correct but fields are empty, check installation and field names first.

Turn submissions into decisions

Once submissions include attribution fields, use them in the Netlify dashboard, in a CRM, in a CSV export for spreadsheet or BI tools, or in lead notification emails. Three starting reports are useful. First, leads by channel, to compare Facebook Ads with other channels before shifting budget. Second, leads by Meta network, to see whether Facebook, Instagram, Messenger or another placement is producing leads. Third, leads by campaign over time, to separate campaigns that generate leads from those that only generate visits. Landing-page and landing-page-group fields add a fourth view: which individual pages and content sections convert best.

Frequently asked questions

What is needed to capture Facebook Ads data in a Netlify form?

Add UTM parameters to each Facebook ad URL, install the attribution snippet on the site, add the six hidden fields to the form, and let the snippet populate those fields at submission so Netlify captures them with the lead details.

Does this only work for Facebook Ads?

Yes. The same fields can also record Organic Search, Organic Social, Referral and Direct, so reporting is not limited to paid social traffic.

What if a visitor lands on one page and submits a form on another?

The attribution data is stored in the visitor's browser, so it can still be passed through even if the form is submitted on a different page from the landing page.

Where can the captured data be used?

View submissions in the Netlify dashboard, export them as CSV for spreadsheet or BI reporting, send them to a CRM, or include the attribution fields in lead notification emails.

What happens if UTM naming is inconsistent across campaigns?

Inconsistent values such as different spellings for the same source are normalised to the correct channel, reducing reporting errors from naming variations.