Skip to content

Capture Facebook Ads Data in WPForms: UTMs, Hidden Fields and Lead Reports

You can attach campaign, ad set and ad information to every WPForms submission by tagging ad URLs, storing those values during the visit, and writing them into hidden form fields at submission. The result is a lead record that shows not only who contacted you, but which Facebook campaign brought them in.

Why capture ad data on the form itself

A standard form submission tells you a visitor's name and email, but not which ad produced them. Without that context, clicks and visits cannot be tied reliably to leads, customers or revenue. Capturing attribution data at submission closes that gap: each lead carries its channel and campaign breakdown into your CRM, spreadsheet, email notification or billing platform for later reporting.

Step 1: Tag ad URLs with UTM parameters

Tag every active Facebook ad URL with UTM parameters, which are extra text appended to the destination URL. A consistent convention makes reporting clean: set UTM Medium to Paid social, UTM Source to Facebook, UTM Campaign to the campaign name, UTM Term to the ad set name, and UTM Content to the specific ad. Free UTM builder tools can help assemble the URLs. Consistency matters more than the exact labels, provided the same meanings are used across campaigns.

Step 2: Install the attribution snippet

Install a small attribution snippet across your website. On arrival, the snippet reads how the visitor reached the site and identifies the originating channel, such as Facebook Ads. It stores the UTM values in a browser cookie so they persist while the visitor browses. When a form is submitted, the stored values are written into the form's hidden fields, and WPForms saves them alongside the lead's name and email. The snippet is typically supplied by an attribution tool; check that tool's own installation guide for the exact placement and account steps.

Step 3: Add the hidden fields

Add these hidden fields to each lead-capture form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Channel Drilldown 4, Landing Page, and Landing Page Group. In WPForms, drag and drop a Hidden field type into the form for each one; consult WPForms' current documentation for the exact steps. Use this checklist before going live: every active ad URL is tagged, the snippet is installed site-wide, all seven hidden fields are present on every lead form, and a test submission from a tagged URL shows the expected channel and drilldown values.

What to do with the captured data

Once captured, the data can be routed where your team already works. Send it to a CRM such as Pipedrive, Salesforce or HubSpot to report leads, conversions and revenue by campaign. Send it to a Google or Excel spreadsheet via Zapier for basic analysis, or connect a dashboard tool for advanced reporting. Add it to email notifications so responders see each lead's origin immediately. Pass it to a connected billing platform such as Square, Stripe or PayPal to view revenue generated by each ad.

Benefits beyond Facebook Ads

Beyond Facebook, the same setup records Referral, Direct, Organic Search and Organic Social, so you can see where all leads originate. Cookie storage means UTM data survives navigation between pages, improving accuracy when visitors browse before converting. Inconsistent UTM naming is normalised, for example facebook and facebook.com both map to Paid Social. Landing page URL and landing page group are also captured, showing which content, such as a blog section or a specific post, generates the most leads.

Three useful reports

Three reports illustrate the value. Leads by channel compares Facebook Ads against every other channel to guide budget allocation. Leads by network separates Facebook, Instagram and Messenger performance so you can invest more in the network producing the most leads. Leads by campaign shows monthly lead volume per campaign, distinguishing campaigns that generate leads from those that only generate clicks and visits.

Summary

Tagging ads, installing the snippet and adding hidden fields turns each WPForms submission into a source-attributed lead record. With channel, drilldown and landing page data in hand, you can measure Facebook Ads ROI alongside every other channel and direct optimisation effort where it produces results. Any trial or plan terms should be confirmed against the attribution tool's current published pricing before you commit.

Frequently asked questions

Does this only work for Facebook Ads?

No. The same hidden-field setup also records Referral, Direct, Organic Search and Organic Social, so one report can compare every channel rather than Facebook alone.

What if the visitor browses several pages before submitting?

Yes, because the UTM values are kept in a browser cookie after the landing visit. A visitor can browse other pages first and still have the original campaign data attached when they eventually submit a form.

What if my UTM naming is inconsistent?

Inconsistent values such as utm_source=facebook in one campaign and utm_source=facebook.com in another are normalised to the same Paid Social channel, reducing split counts caused by naming variations.