Skip to content

Capture Google Analytics Attribution in Divi Forms

Google Analytics shows how many visitors arrive and where they came from, but for non-ecommerce sites it does not by itself connect a lead or customer back to the campaign that brought them in. Adding attribution data to each Divi form submission closes that gap: when a visitor submits a form, the channel, campaign detail and landing page that preceded the submission are stored alongside the name, email and other details they entered.

How attribution reaches a Divi submission

A small attribution script placed on the site examines technical details of a visit in a similar way to Google Analytics and assigns the visitor to a marketing channel such as Organic Search, Paid Search or Paid Social. That result is stored in the browser. When the visitor later completes a Divi form, the script writes the attribution values into hidden fields on the form. On submission, Divi captures those hidden values together with the visible form answers, so the lead record carries its own source history.

Four-step checklist

Work through these steps in order. Skipping the hidden fields means there is nowhere for attribution values to land; skipping the onward transfer means the data stays inside WordPress and cannot be reported against pipeline or revenue.

1. Add six hidden fields

Open the Divi form you want to measure, add a new field, and set its type to Hidden Field. Repeat until six hidden fields exist, named: Channel; Channel Drilldown 1; Channel Drildown 2; Channel Drilldown 3; Landing Page; Landing Page Group. Note the source spelling 'Drildown' for the second and third drilldown fields, and match the names exactly so the attribution script can populate them.

2. Let the script populate the fields

No manual entry is needed at submission time. The script fills the hidden fields from the stored attribution data. Example: an architecture firm receives a visitor from a paid search ad for commercial design services. Depending on the UTM parameters on that ad, the fields could read Channel: Paid Search; Channel Drilldown 1: Google; Channel Drilldown 2: Commercial Design Campaign; Channel Drilldown 3: Streamline Architecture. The landing page fields would record the page the visitor first arrived on and its category.

3. Capture and route the submission

On submit, Divi captures the hidden attribution values with the rest of the submission. You can then store and view submissions in the WordPress dashboard with a plugin such as Divi Form DB, include the values in Divi's new lead notification emails, transfer them to a CRM such as Salesforce, Pipedrive or HubSpot, or sync them to Google Sheets or Microsoft Excel.

4. Report on lead sources

Once the data reaches a CRM or reporting tool, you can answer questions such as how many leads came from Google Ads, how many customers came from Facebook Ads, and how much new revenue SEO efforts are driving.

What data is captured

Two groups of data are captured with each submission. Marketing channel data identifies which channel drove the lead, such as Paid Search, Organic Search or Paid Social, plus extra detail per channel such as ad group, keyword or campaign. Landing page data records the visitor's first landing page and the category of that page, for example a blog path. Grouping by landing page category shows the total leads from an entire blog, while the individual page shows what a single post contributed.

Three reports to build first

Leads by Channel gives a high-level count per channel. If most leads come from Organic Search while most budget goes to Paid Search, that mismatch is a prompt to rethink spend. Opportunities by Google Ads campaign shows monthly opportunities per campaign, making it easier to spot which campaigns produce leads that become real sales opportunities. Customers by Facebook Ads Network breaks customers down across Facebook, Instagram, Messenger and WhatsApp placements, so budget can be shifted toward the networks delivering the best results.

Choosing an attribution tool

Before committing to an attribution tool, check three things against your own setup. First, it must be able to write values into Divi hidden fields, so confirm the field names it targets match the six you created. Second, it should hold the attribution result in the visitor's browser between their first visit and their form submission, rather than relying on a server-side session that may not survive. Third, it needs a working path for the six fields to reach your CRM or spreadsheet, whether through a native integration or a connector such as Zapier. A short test submission from a tagged campaign link is the quickest way to verify all three before you rely on the data.

Hidden fields to add to a Divi form
FieldWhat it recordsExample value
ChannelMarketing channel that drove the leadPaid Search
Channel Drilldown 1First level of channel detailGoogle
Channel Drilldown 2Second level of channel detailCommercial Design Campaign
Channel Drilldown 3Third level of channel detailStreamline Architecture
Landing PageFirst page the visitor arrived onIndividual page URL
Landing Page GroupCategory of the landing pageBlog section

Example values are illustrative, from the architecture firm scenario in the source; actual values depend on UTM parameters and visit history.