Capturing Web Referral Leads cleanly is a configuration job in three layers: the Web-to-Lead form itself, the Lead object fields that store the referral metadata, and the reports that summarize the data. None of the work is hard, but the layers have to line up. If the form captures a field that does not exist on the Lead object, the submission silently fails. If the field exists but reports filter on a different one, the dashboard reads zero. Test the chain end to end after every change to the form template, the field set, or the assignment rules.
- Add the referral capture fields to the Lead object
From Setup, go to Object Manager, Lead, and add fields for the data your form will capture. The standard set is Lead Source (picklist), Lead Source Detail (text), Referring URL (URL or long text), UTM Source, UTM Medium, and UTM Campaign (all text). Keep the field API names short and consistent across objects so they can be mapped to the same fields on Account, Contact, and Opportunity after lead conversion. Add a field validation rule that flags blank Lead Source when Source Detail is populated, since that combination is almost always an integration bug rather than a real lead.
- Configure the Web-to-Lead form template
In Setup, generate a Web-to-Lead HTML form that includes every field you added in step 1. Set Return URL to a thank-you page that does not leak the org instance. Add a reCAPTCHA or hCaptcha block in the form template to filter bots. Add a JavaScript snippet that reads document.referrer and writes it into the Referring URL hidden field on page load. Add a snippet that parses the page URL for utm_ parameters and populates the matching UTM fields. Save the form template in source control so changes are reviewable.
- Set Assignment Rules to route referral leads to the right queue
Open Setup, Lead Assignment Rules, and add a rule that routes leads with Lead Source equal to Web Referral or Partner Referral to the partner sales queue (or wherever your partner-aware sellers live). Without this, referral leads land in the generic web-leads queue and get treated the same as cold inbound, which loses the partner context. Test the assignment rule by submitting test forms with each Lead Source value and confirming the routing lands as expected. Document the rule in the partner playbook so account managers know where to find the leads.
- Build the referral attribution report and dashboard
Create a Lead report grouped by Lead Source and Lead Source Detail with summary columns for lead count, qualified lead count, converted opportunity count, and converted opportunity amount. Add it to a Marketing Attribution dashboard. Schedule the report to run weekly and email to the partner program owner. For multi-touch attribution, build a separate Campaign Influence report that joins Lead, Campaign Member, and Opportunity records, since Lead Source by itself only captures the last touch and undercounts partner contribution to multi-step deals.
- Web-to-Lead is rate-limited to 500 submissions per day at the org level. High-volume forms (or bot floods) hit the limit and silently drop subsequent leads. Monitor the daily count.
- document.referrer is blank when the user navigates from an HTTPS site to your HTTP form, or when a strict referrer policy is set. Capture UTM parameters as a backup so attribution does not break.
- Lead Source picklist values must match across forms, Pardot, and Apex. Inconsistent spellings split the same population across multiple report rows and undercount real performance.
- Spam bots submit Web-to-Lead forms automatically. Without CAPTCHA, expect hundreds of junk leads per week. Each junk lead pollutes attribution dashboards and trains your scoring model on noise.
- Lead Source does not propagate to Account or Contact on conversion unless you map it explicitly. Set the field mapping in Setup so partner attribution survives the lead-to-opportunity handoff.