Skip to content

Track lead source in Formstack with hidden fields

Formstack records what a visitor types, but not automatically how they arrived. This guide explains how to add source fields to a form, have attribution data fill them when the form is submitted, and then use the results in submissions, email notifications, or a connected CRM.

Step 1: Install the script and add hidden fields

Install the attribution script on the website first, using the tool's supplied code and its website-install instructions. Then open the Formstack form and add Short Answer fields for the channel fields, selecting Hidden in each field's properties so visitors do not see or edit them.

Use this checklist before testing:

  • Script installed on every page containing a tracked form
  • Hidden fields present and set to Hidden, not visible Short Answer fields
  • Field names match the labels your CRM or reporting expects
  • A test submission is completed from a tagged campaign link

Step 2: Let the script populate the fields at submission

Once installed, the script categorises each visitor into channels such as Paid Search, Paid Social, and Organic Search, and stores that information in a browser cookie. When the visitor later submits a Formstack form, the script writes the stored source information into the hidden fields.

This is the key distinction: Formstack captures the values at submission, but the attribution script supplies the source values. Without the script, the hidden fields will be empty even if the fields exist.

Step 3: Capture and use the data

On submission, Formstack captures the source data alongside name, email, and other answers. You can then:

  • Review the values beside each entry in the Submissions table
  • Add the values to notification emails sent for new submissions
  • Send the values through a Formstack CRM integration for reporting by source

The source lists HubSpot, Salesforce, Pipedrive, Dynamics, and Zoho among more than 50 CRM integrations. Confirm current integration availability in your own Formstack account before relying on a specific destination.

What gets captured

Channel data describes how the lead first reached the site. For a paid Google click promoting web design services, the example values are Paid Search, Google, the campaign name, and the keyword bid on. For an organic Google visit, the example values are Organic Search, Google, the Google domain, and the search keyword when available.

Landing-page data adds the first page the visitor landed on and its group, for example a blog post URL and the /blog group. Reporting by group shows whether blog content produces leads; reporting by individual page shows which posts do.

Three reports to build first

Three reports make the captured data actionable:

  • Leads by channel: monthly leads by channel for a high-level view of what is working and where budget or time should shift
  • Leads by Google Ads campaign: leads per campaign, separating campaigns that generate leads from those generating only impressions and clicks
  • Leads by social network: monthly organic social leads broken down by network, showing which networks are worth continued posting effort

Start with leads by channel, then drill into the channel with the largest spend or effort. That order prevents a detailed campaign report from hiding a broader allocation problem.

Paid versus organic search examples
ScenarioChannelDrilldown 1Drilldown 2Drilldown 3
Paid Google click for web design servicesPaid SearchGoogleWeb Design Campaign (or specific campaign name)Sydney web designer (or keyword bid on)
Organic Google searchOrganic SearchGooglewww.google.com (or specific Google domain)Web designer Sydney (or keyword used, if available)

Example values from the source; actual values depend on UTM parameters and referrer data available for the visit.

Frequently asked questions

Which fields do I need in Formstack?

Add hidden Short Answer fields named for Channel and Channel Drilldown 1-4, mark each Hidden, then let the attribution script populate them at submission. The source describes six fields in the setup step, while the named list shows five channel fields; confirm the sixth field name in your own form setup before publishing.

How does paid search differ from organic search in the captured data?

Paid Search from Google can record the campaign and keyword in the drilldowns, while Organic Search from Google records the Google domain and the search keyword when available. That distinction lets you separate paid click performance from organic discovery.

Can I tell which content produced a lead?

Yes. The captured landing page and landing page group can be reported by content type, such as blog, and then by individual post, so you can see which pages produce leads rather than only which channel did.