How to track lead source in Salesforce
Push UTMs, lead source, and the full visitor journey into Salesforce Lead, Contact, Account, and Opportunity records. OAuth integration with sandbox and production support.
On this page
Salesforce is the system of record for most B2B sales teams, but Salesforce’s native attribution stops at a single LeadSource field with no multi-touch model and no historical journey. SourceLoop adds: first-touch and last-touch source on every Lead and Contact, the full UTM trail, the visitor’s pre-conversion journey, and multi-touch attribution models that respect Salesforce’s Lead → Contact → Opportunity flow.
This article covers the OAuth connect flow only. After connecting, see:
Why connect Salesforce to SourceLoop?
Salesforce ships with one LeadSource field per Lead. SourceLoop adds:
- First-touch source / medium / campaign as separate fields, so you know the original channel even after multiple touchpoints
- Last-touch (converting session) source / medium / campaign as separate fields
- Full UTM trail with content and term, not just source and medium
- Visitor journey (every page browsed pre-conversion) viewable on the Lead / Contact record
- Multi-touch attribution models (first, last, linear, position-based, time-decay)
- Revenue-by-channel when payment integrations are connected, attributed back to the original Lead
All of this sits on standard Salesforce records, so it shows up in Salesforce reports, Lightning record pages, and any workflow / process you build against it.
Before you start
You’ll need:
- A SourceLoop workspace with the tracking pixel installed
- A Salesforce org (Sales Cloud or Service Cloud; any edition)
- A Salesforce user with System Administrator profile, or Modify All Data + API Enabled permissions, to run the OAuth connect
- Admin or Owner role in SourceLoop
Step 1: Open the CRM integrations page
- Sign in to SourceLoop.
- Click Setup in the left sidebar.
- Click the CRM tab inside Setup.
- Scroll to the Salesforce card.
Step 2: Pick sandbox or production
- On the Salesforce card, toggle Sandbox ON if you want to connect to your sandbox org first (recommended for first-time setups).
- Leave it OFF to connect to production.
- Click Connect.
You’ll be redirected to Salesforce’s OAuth consent screen, either login.salesforce.com (production) or test.salesforce.com (sandbox).
Step 3: Authorise SourceLoop on Salesforce
- Sign in to Salesforce if you aren’t already.
- Pick the org you want to connect (if you have multiple Salesforce users).
- Review the scopes SourceLoop is requesting (API access, refresh_token, offline_access).
- Click Allow.
Salesforce redirects you back to SourceLoop. The connection card flips to Connected and shows your Salesforce instance URL (e.g., acme.my.salesforce.com).
Step 4: Enable sync direction
After connecting, the Salesforce drawer opens with sync settings:
- Inbound sync (Salesforce → SourceLoop): pulls Leads, Contacts, Accounts, and Opportunities into SourceLoop so dashboards reflect your real pipeline.
- Outbound sync (SourceLoop → Salesforce): pushes UTM, source, and journey data from SourceLoop into Salesforce fields on Lead and Contact records.
Most teams enable both. Click Save to start the first sync.
Step 5: Wait for the initial sync
The initial sync pulls Salesforce records into SourceLoop. Duration depends on volume:
- Small org (under 10k Leads + Contacts): under 5 minutes
- Mid-size (10k-100k): 10-30 minutes
- Large org (100k+): up to a few hours
The sync runs server-side, you don’t need to keep SourceLoop open. Watch the Last sync timestamp on the Salesforce card.
After the initial run, deltas sync every 15 minutes automatically.
What gets written to Salesforce
Out of the box, SourceLoop creates and writes to these custom fields on the Lead object (and mirrored on Contact via Salesforce’s lead-conversion mapping):
sourceloop_first_source__c,sourceloop_first_medium__c,sourceloop_first_campaign__c, etc.sourceloop_latest_source__c,sourceloop_latest_medium__c,sourceloop_latest_campaign__c, etc.sourceloop_first_landing_page__c,sourceloop_latest_landing_page__csourceloop_id__c— internal link (don’t delete)
These fields are created automatically on first sync, you don’t need to pre-create them in Salesforce.
For mapping to your own existing custom fields (or to standard fields like LeadSource), see Push UTMs and lead source to Salesforce fields.
What’s next
- Field mapping — by default SourceLoop maps to its own
sourceloop_*fields. To map to your existing fields or push to specific custom objects, see Push UTMs to Salesforce. - Lead Status mapping — translate SourceLoop’s internal lifecycle stages to Salesforce’s
Lead Statuspicklist values. See Map SourceLoop stages to Salesforce Lead Status. - Troubleshooting — if a sync looks stuck or fields aren’t writing, see Troubleshoot Salesforce sync issues.
Frequently asked questions
-
Do I need Salesforce Sales Cloud or Service Cloud?
Either works. SourceLoop reads and writes against standard Salesforce objects (Lead, Contact, Account, Opportunity) which exist in every edition. Marketing Cloud is not required.
-
Does this work with a Salesforce Sandbox?
Yes. There's a sandbox toggle on the Salesforce connect screen. Flip it on, OAuth goes through test.salesforce.com instead of login.salesforce.com, and SourceLoop hits your sandbox endpoints. Sandbox and production connections are separate, you can have both at once.
-
Will SourceLoop overwrite my existing Salesforce Lead Source field?
Only if you explicitly map SourceLoop's first-touch source field to Salesforce's standard `LeadSource` field. By default, SourceLoop writes to its own custom field (`sourceloop_first_source__c`) so your existing LeadSource values are preserved. You can change the mapping in the Field Mapping tab.
-
How does SourceLoop handle Lead conversion to Contact / Account / Opportunity?
When a Salesforce Lead is converted, the source and UTM data on the Lead are carried onto the resulting Contact, Account, and Opportunity via Salesforce's standard conversion mapping. SourceLoop's custom fields are mapped on both Lead and Contact, so the attribution survives the conversion process.
-
I use Lightning Experience. Does that matter?
No. SourceLoop uses the Salesforce REST and Bulk APIs, which are UI-agnostic. Both Lightning and Classic users see the same SourceLoop data on records once it's synced in.
-
Can I sync multiple Salesforce orgs?
One Salesforce org per SourceLoop website. For multiple orgs, create a separate SourceLoop website for each and connect them independently.