Capture Facebook Ads Data in Divi Forms
Facebook and Google Analytics do not, on their own, show how many leads or customers came from a Facebook campaign. A practical workaround is to tag each ad destination with UTM parameters, store those values when the visitor arrives, and then pass them through hidden fields on the lead form so they are saved beside the visitor's own details.
1. Tag every Facebook ad URL
Start with the destination URL. Append UTM parameters so the campaign, ad set, and ad can be distinguished later. A consistent convention for Facebook is: medium = paid social, source = Facebook, campaign = campaign name, term = ad set name, and content = specific ad. Free UTM builders can help if you are new to building these URLs.
2. Install the attribution script
Place a small attribution script on the website. On arrival, it reads the UTM values from the URL and saves them in the visitor's browser. When the visitor later submits a form, the script populates the hidden fields described below. The submitted record then contains both the lead's entered details, such as name, email, phone, or company, and the attribution details.
3. Add the hidden fields
Add these hidden fields to each lead-capture form, including forms such as Contact Us or Request a Quote: Channel; Channel Drilldown 1; Channel Drilldown 2; Channel Drilldown 3; Landing Page; Landing Page Group. The first four fields carry the cleaned channel breakdown, while the last two record where the visitor first landed and the group that page belongs to.
Setup checklist
Use this checklist before relying on the data: every Facebook ad uses the same UTM convention; the script is present on all pages where forms appear; every form has all six hidden fields; a test submission from a tagged Facebook URL shows Paid Social / Facebook values; a test submission from a different page still retains the original landing page; and the values appear in the WordPress form entries, notification email, CRM, or spreadsheet you intend to use.
Where the captured data can go
Once captured, the data can be viewed beside each entry on the Forms page in the Divi section of the WordPress dashboard. It can also be included in new-lead notification emails for real-time visibility, sent to a CRM for built-in reporting on leads, customers, and revenue by campaign, or passed through a tool such as Zapier to a spreadsheet for analysis in tools such as Microsoft Power BI.
Why browser storage and cleaning matter
The approach is not limited to Facebook. Organic Social, Organic Search, Direct, Referral, and other sources are captured in the same way, so one form can support cross-channel comparison. Browser storage means the attribution survives navigation to another page before conversion. Normalisation also helps: inconsistent capitalisation or formatting in UTM values is mapped to the correct channel category, such as Paid Social for Facebook. Landing-page capture adds context beyond UTMs, for example recording a blog URL and grouping it under /blog.
Three reports to run first
Leads by channel groups monthly leads by source category, such as Paid Search and Paid Social, to guide budget allocation. Leads by network separates Facebook placements including Messenger, Instagram, and WhatsApp, showing which placement drives the most leads. Leads by campaign drills into individual Facebook campaigns, helping you shift spend toward campaigns that generate leads and away from those that do not, with the aim of lowering cost per lead.
Frequently asked questions
What is the shortest setup sequence?
Add UTM parameters to the ad destination URL, install the attribution code on the site, add the six hidden fields to the form, then submit a test form and confirm the attribution values appear with the lead details.
How should Facebook UTM values be structured?
Medium identifies paid social, source identifies Facebook, campaign names the campaign, term names the ad set, and content names the specific ad. Consistent naming matters because reports group by these values.
Which hidden fields are needed?
Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group.
Why store attribution data in the browser?
Because the attribution data is stored in the browser, it can still be written into the form even when the visitor converts on a different page from the landing page.
Which three reports are most useful?
Use leads by channel to compare broad sources, leads by network to compare Facebook placements such as Messenger, Instagram, and WhatsApp, and leads by campaign to see which campaigns produce leads.