How to Capture Facebook Ads Data in WS Form
Facebook Ads dashboards tell you how many clicks and impressions you bought. They do not tell you which campaign produced the lead that landed in your CRM. This guide shows how to close that gap: tag your ads with UTM parameters, install a small attribution script, add hidden fields to your WS Form forms, and let the script fill those fields at submission time. The result is a lead record that carries its own campaign history.
What you are actually building
Three components do the work. First, the ad's destination URL is tagged with UTM parameters, which travel with the click. Second, the attribution script reads those parameters on arrival and saves them to a cookie in the visitor's browser, so the values survive further browsing. Third, at submission the script writes the stored values into the hidden fields you added, and WS Form saves them in the same record as the visitor's name and email. Because the values live in the cookie, the form does not have to sit on the landing page.
Step 1 — Tag every Facebook ad with UTM parameters
UTM parameters are appended to the destination URL. For a page at /integrations/ws-form, a tagged version could look like this: /integrations/ws-form?utm_medium=paidsocial&utm_source=facebook&utm_campaign=brand-campaign. The five parameters map cleanly onto the Facebook Ads hierarchy: utm_medium carries the channel type (for example, paid social), utm_source carries the network (Facebook), utm_campaign carries the campaign name, utm_term carries the ad set name, and utm_content carries the specific ad. Keep the naming consistent across ads so reports group correctly later.
Step 2 — Install the attribution script
Signing up for the trial provides a snippet of code to place on your site. You can add it directly to a WordPress installation or load it through a tag manager. The script needs to run on every page a visitor might reach, not only the landing page, because it must be present when the form is submitted. Installation instructions for the script are maintained separately from this guide.
Step 3 — Add the hidden fields to your WS Form form
WS Form supports hidden fields, and the attribution script expects a specific set of names. Add each of the following to every lead capture form you want to track: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Channel Drilldown 4, Landing Page, and Landing Page Group. The four drilldown levels are what let a single Channel value expand into campaign, ad set, ad, and network detail in reports. WS Form's own documentation covers where the hidden field option lives in the form builder.
Step 4 — Let the script populate the fields on submit
When a visitor arrives from a tagged ad, the script reads the UTM values and stores them in a cookie in that visitor's browser. If the visitor browses several pages before filling in a form, the values are still available. At submission, the script writes the stored attribution into the hidden fields, and WS Form captures those values alongside the rest of the submission. From there you can route the record to a CRM such as Salesforce, HubSpot, or Pipedrive, push it to a Google Sheet through WS Form's native integration, include it in lead notification emails, or forward it to other destinations through an automation tool.
Field-to-source map
Use this map to confirm each hidden field is wired to the right input before you publish the form.
A worked example
Suppose you run a brand-awareness campaign on Facebook with two ad sets and three ads. You tag the destination URL as /integrations/ws-form?utm_medium=paidsocial&utm_source=facebook&utm_campaign=brand-campaign&utm_term=lookalike-audience&utm_content=video-15s. A visitor clicks the ad, lands on the page, browses to your pricing page, then submits a demo request form. At submission, the hidden fields carry: Channel = Paid Social, Drilldown 1 = Facebook, Drilldown 2 = brand-campaign, Drilldown 3 = lookalike-audience, Drilldown 4 = video-15s, plus the landing page URL and its group. In your CRM, that lead can now be filtered by campaign or ad set without any manual tagging.
Why capture more than just Facebook Ads
If you only record paid social, you see a slice of your lead origins rather than the whole picture. Visitors who come in through organic search, organic social, referral links, or direct navigation are tagged too, so a Facebook campaign can be weighed against your other channels instead of judged in isolation. Two details matter when you audit the data. Because the values sit in a cookie, the original source survives even when the visitor wanders through several pages before reaching the form. And the landing page is stored twice — once as the full URL and once as a grouped path such as /blog — which lets you judge which content, not just which ad, is producing results.
Three reports worth building first
Start wide and narrow down. The channel report tells you whether paid social earns its budget next to search, referrals, and direct traffic, which is the kind of comparison that shapes where money goes. The network report splits results by placement, useful because Meta runs ads across Facebook, Instagram, WhatsApp, and Messenger and results tend to differ from one app to the next. The campaign report pinpoints which campaign — among several aimed at different services, messages, or creative — is actually bringing in leads. Every report is just a grouping on fields the script already fills, so you do not need extra tagging.
Failure checklist: where attribution usually breaks
If leads arrive without campaign data, work through these three checks in order. One: the ad URL has no UTM parameters, or the parameters were added after the ad went live. Two: the UTM parameters are present in the URL but the hidden field names on the form do not match the script's expected names, so nothing is written. Three: the hidden fields are populated in WS Form but the form's submission action does not include them — for example, the CRM mapping omits the drilldown fields. Each failure produces a different symptom: missing data entirely, empty fields on some submissions, or data visible in WS Form but absent downstream.
Choosing where the data goes
A CRM is the right destination if sales follow-up depends on knowing the source. A spreadsheet is the right destination if you want fast, flexible reporting without touching the CRM schema. Email notifications are useful for small teams that read every lead as it arrives. Automation tools extend the same data to other systems. You can use more than one destination at once; the hidden fields are captured once and can be routed to several places.
| Hidden field | Fed by | Example value |
|---|---|---|
| Channel | Derived channel grouping | Paid Social |
| Channel Drilldown 1 | utm_source | |
| Channel Drilldown 2 | utm_campaign | brand-campaign |
| Channel Drilldown 3 | utm_term | lookalike-audience |
| Channel Drilldown 4 | utm_content | video-15s |
| Landing Page | First page URL visited | /integrations/ws-form |
| Landing Page Group | Grouped landing page path | /integrations |
Example values illustrate the mapping pattern; the actual values depend on the UTM parameters you set on each ad.
Frequently asked questions
Does the visitor have to submit the form on the same page they landed on?
No. The script stores the UTM values in a cookie in the visitor's browser, so the original source is still available when the form is completed on a later page.
What happens to leads that do not come from Facebook Ads?
They are still captured. The script records organic search, organic social, referral, and direct traffic as well, so every lead carries a source rather than only the paid ones.
Can I send the captured data to more than one place?
Yes. The hidden fields are filled once at submission and can be routed to a CRM, a Google Sheet, a notification email, or an automation tool. You are not limited to a single destination.
Why are there four drilldown fields?
The four levels let a single Channel value expand into campaign, ad set, ad, and network detail. That is what makes reports like leads by campaign or leads by network possible without adding separate fields for each.