Salesforce

Salesforce Web-to-Lead Attribution Tracking

Capture marketing attribution data directly in Salesforce Lead records. AttributionHub populates hidden fields on your Web-to-Lead forms with UTM parameters, referrers, and landing pages — giving your sales team full marketing context on every lead.

Why Web-to-Lead Forms Need Attribution

Salesforce Web-to-Lead is the simplest way to create leads directly in your CRM from website form submissions. Generate an HTML form, embed it on your site, and every submission creates a Lead object in Salesforce.

But the out-of-the-box Web-to-Lead form captures what the visitor typed — their name, email, company, phone number. It doesn't capture how they found you. The marketing source, the campaign that brought them, the keyword they searched — all of that context disappears at the point of conversion.

For sales teams, this is a real problem. They're working leads without knowing whether someone came from a high-intent Google Ads keyword or stumbled across a general blog post. The follow-up should be different, but without source data, every lead gets the same approach.

AttributionHub solves this by capturing first-party attribution data and writing it into hidden fields on your Web-to-Lead form. Every lead enters Salesforce with its marketing context already attached.

What Data Gets Captured

UTM Parameters

Source, medium, campaign, term, and content — captured from URLs and mapped to Salesforce Lead custom fields.

Landing Page & Referrer

The page the visitor landed on and the referring site, showing the complete entry path before form submission.

Channel Classification

Automatic tagging as Paid Search, Organic, Social, Email, Direct, or Referral — clean, consistent data in every Lead.

First Touch & Last Touch

Both the original marketing source and the converting touchpoint, supporting Salesforce reporting and attribution models.

How It Works

Web-to-Lead forms are standard HTML forms that post data to Salesforce. The main challenge is that Salesforce uses auto-generated field IDs (like 00NXXXXXXXXXXXXXXX) instead of readable field names.

Step 1: Create Custom Lead Fields

In Salesforce, go to Object Manager > Lead > Fields & Relationships and create custom text fields (255 characters) for each attribution data point. Note down the auto-generated field IDs — you'll find them in the generated HTML.

Step 2: Generate Your Web-to-Lead Form

Go to Setup > Web-to-Lead > Create Web-to-Lead Form and include your custom attribution fields. Salesforce generates an HTML form with your fields included. Change the attribution field inputs from type="text" to type="hidden" so they're not visible to visitors.

Step 3: Add the AttributionHub Script

Place the tracking snippet on your page:

<script src="https://cdn.attributionhub.com/attribution.js?id=YOUR_ID" async defer></script>

Step 4: Configure Field Mapping

Since Salesforce uses auto-generated IDs as field names, you need to configure field mapping to tell AttributionHub which Salesforce field IDs correspond to which attribution fields.

Lead Custom FieldSalesforce Field IDExample Value
Channel00NXXXXXXXXXXXXXXXPaid Search
Source00NXXXXXXXXXXXXXXXgoogle
Medium00NXXXXXXXXXXXXXXXcpc
Campaign00NXXXXXXXXXXXXXXXenterprise-leads
Keyword00NXXXXXXXXXXXXXXXsalesforce crm setup
Landing Page00NXXXXXXXXXXXXXXX/enterprise
Referrer00NXXXXXXXXXXXXXXXgoogle.com

Each field ID starting with 00N is unique to your Salesforce org. You'll find the actual IDs in your generated Web-to-Lead HTML form.

For complete setup instructions including field ID mapping, see the Salesforce Web-to-Lead integration guide.

Use Cases

Enterprise Sales Teams — Every Web-to-Lead submission enters Salesforce with full marketing context. Sales reps see the campaign, source, and channel directly on the Lead record.

Marketing ROI Reporting — Build Salesforce reports and dashboards that connect closed-won revenue back to the original marketing campaign. Attribution fields on Leads flow through to Opportunities and beyond.

Lead Scoring — Use attribution data in your lead scoring model. A lead from a high-intent paid search keyword might score differently than one from an organic blog visit.

Territory Routing — Combine attribution data with lead routing rules. Route leads from enterprise-targeted campaigns to your enterprise sales team automatically.

What Makes AttributionHub Different

Salesforce Field ID Mapping

Handles Salesforce's unique auto-generated field IDs through configurable mapping. No custom Apex code needed.

Clean Lead Records

Attribution data lives directly on the Lead object as custom fields. Accessible in reports, dashboards, list views, and automations.

No Salesforce API Required

Works entirely through the standard Web-to-Lead HTML form. No API credentials, no connected app, no middleware.

First-Party Data Collection

Captures attribution using first-party storage. Works without third-party cookies, compatible with privacy regulations.

Frequently Asked Questions

Why do I need field mapping for Salesforce?

Salesforce Web-to-Lead uses auto-generated 18-character field IDs (starting with 00N) as HTML field names. Since these don't match AttributionHub's default field names, you need to tell the system which ID maps to which attribution field.

Does this work with Salesforce Lightning?

Yes. Web-to-Lead is a platform feature that works the same in Classic and Lightning. Lead records with attribution data appear correctly in both interfaces.

Can I use this data in Salesforce reports?

Absolutely. Custom Lead fields are available in all Salesforce reporting tools. Build reports, create dashboards, and set up automated report subscriptions using attribution data.

Will attribution data carry over to Opportunities?

Not automatically — you'll need a Salesforce field mapping or Flow to copy attribution data from the Lead to the Opportunity when the Lead is converted. This is a common Salesforce configuration.


Start Tracking Your Salesforce Lead Sources

Set up Web-to-Lead attribution in minutes. Every lead enters Salesforce with its marketing source, campaign, and channel attached.

Get Started Free
Loading footer...