Why enterprise B2B needs this
Enterprise B2B revenue rarely behaves like ecommerce checkout tracking. A campaign click may create an anonymous visit today, a lead record next week, an SDR meeting two weeks later, and an opportunity that only closes after procurement, security review, legal redlines, and executive signoff. If paid media is judged only on the original browser form event, the business ends up optimizing toward cheap top-of-funnel volume rather than opportunities that actually move through pipeline.
Multi-touch journeys also make browser-only reporting misleading for RevOps. The same buying committee can interact through ads, webinars, partner referrals, outbound sequences, and account-based nurture before the sales team updates Salesforce with the milestone that matters. Routing Salesforce opportunity and engagement changes into TrackLayer creates a cleaner operating model: media teams get server-side conversion truth, RevOps keeps its governance, and finance can reconcile attributed revenue against the CRM system of record instead of arguing over disconnected pixels.
Prerequisites
Salesforce Lightning with admin access to the production org, object schema, field visibility, and event delivery settings.
A Salesforce connected app configured for OAuth so TrackLayer or your relay service can authenticate without relying on user sessions.
OAuth access with permission to read Opportunity, Lead, Contact, Account, Campaign Member, and Task records plus the fields your RevOps team uses for qualification and revenue reporting.
A TrackLayer Enterprise workspace with private ingestion, destination routing, identity controls, and support for CRM-originated server-side events.
Setup
The safest implementation keeps Salesforce, the relay service, and TrackLayer clearly separated. Salesforce emits the business event, the relay handles authentication and normalization, and TrackLayer applies routing, identity controls, and destination-specific event mapping.
Create the Salesforce connected app and OAuth policy
Start by creating a dedicated connected app for TrackLayer traffic rather than sharing an integration used by BI, middleware, or marketing automation. Keep scopes narrow, use a dedicated integration user, and define the callback URL for your ingestion relay. In most deployments the relay handles OAuth refreshes, signs outbound requests to TrackLayer, and keeps the ad platform credentials out of Salesforce entirely.
Connected App essentials
callback URL → https://ingest.tracklayer.io/salesforce/oauth/callback
OAuth scopes → api refresh_token offline_access
integration user → tracklayer.integration@company.com
environment split → sandbox app and production app kept separateExchange the authorization code and store refresh credentials
Run the initial authorization flow once, then let the relay use the refresh token for ongoing access. The point is stability: opportunity updates may happen hours after a meeting, quote revision, or procurement review, so the integration cannot depend on a browser session staying alive. Encrypt the refresh token, version the client secret, and log token refresh failures as infrastructure incidents rather than silent attribution gaps.
POST https://login.salesforce.com/services/oauth2/token
grant_type=authorization_code
code=AUTH_CODE
client_id=CONNECTED_APP_CONSUMER_KEY
client_secret=CONNECTED_APP_CONSUMER_SECRET
redirect_uri=https://ingest.tracklayer.io/salesforce/oauth/callbackSubscribe Salesforce object changes to the relay webhook
Create one controlled subscription layer for the records that matter to attribution. The common pattern is Change Data Capture or a lightweight middleware listener that receives object change events and forwards a normalized payload to TrackLayer. Subscribe Opportunity, Lead, Contact, Account, Campaign Member, and Task so revenue changes, campaign responses, ownership shifts, and rep follow-up all reach the same pipeline instead of being split across separate tools.
Webhook subscription targets
Opportunity → stage changes, amount changes, close date, owner, primary campaign source
Lead → status, source, qualification, conversion markers
Contact → account join, lifecycle changes, contactability fields
Account → named account status, segment, territory, parent account
Campaign Member → responded, status progression, campaign influence
Task → completed outreach, meeting logged, follow-up activityNormalize Salesforce records into TrackLayer canonical events
Do not forward raw Salesforce field names directly to every downstream destination. The relay should turn each change into a canonical event with a stable event ID, event time, object type, account ID, contact or lead identifiers, opportunity amount, currency, stage, campaign context, and consent flags where relevant. This gives RevOps one schema to maintain while ad destinations can each receive the event names and fields they require.
{
"event": "opportunity_stage_changed",
"event_id": "opp_0068c00001ABCDQ_stage_closed_won",
"occurred_at": "2026-04-23T09:42:00Z",
"salesforce": {
"account_id": "0018c00002XYZ12",
"opportunity_id": "0068c00001ABCDQ",
"contact_id": "0038c00004MNO56",
"campaign_id": "7018c000000PQRS",
"owner_id": "0058c000000LMN9"
},
"revenue": {
"amount": 240000,
"currency": "USD",
"arr": 120000
},
"stage": "Closed Won"
}Route only approved conversion milestones to destinations
Once the canonical event stream is clean, map eligible milestones to Meta, LinkedIn, Google Ads, and warehouse exports. Most enterprise teams do not send every CRM mutation as a conversion. They send the milestones that match campaign optimization and revenue review: MQL, SAL, SQL, Opportunity Created, Pipeline Advanced, Demo Completed, Proposal Sent, Closed Won, and in some cases Renewal or Expansion. Keep testing in sandbox first, compare event counts against Salesforce reports, then promote the routing rules to production.
Routing example
Lead status = MQL → canonical = marketing_qualified_lead → destination event = Lead
Opportunity stage = Qualification → canonical = sales_qualified_opportunity → destination event = QualifiedLead
Opportunity stage = Proposal/Price Quote → canonical = pipeline_advanced → destination event = CustomPipelineStage
Opportunity stage = Closed Won → canonical = closed_won → destination event = PurchaseOpportunity stage mapping
Your exact stage names will vary by Salesforce org, but the important move is to map them into a small canonical vocabulary. That gives paid media, analytics, and warehouse exports one shared ladder of business intent instead of a dozen object-specific labels.
| SFDC stage | TrackLayer canonical | Ad platform event |
|---|---|---|
| Prospecting | opportunity_created | Lead |
| Qualification | sales_qualified_opportunity | QualifiedLead |
| Needs Analysis | pipeline_advanced | CustomPipelineStage |
| Value Proposition | pipeline_advanced | CustomPipelineStage |
| Id. Decision Makers | account_buying_group_engaged | CustomPipelineStage |
| Perception Analysis | high_intent_opportunity | CustomPipelineStage |
| Proposal/Price Quote | proposal_sent | SubmitApplication |
| Negotiation/Review | late_stage_pipeline | CustomPipelineStage |
| Closed Won | closed_won | Purchase |
| Closed Lost | opportunity_closed_lost | Suppress from optimization |
Enterprise revenue attribution
Enterprise revenue attribution needs more than an opportunity amount pushed into a single conversion field. Contract value, committed ARR, implementation services, geographic region, product family, and expected go-live timing all change how marketing should value a pipeline event. A large services-heavy deal may produce strong bookings but weak software expansion potential, while a smaller platform-first opportunity may be exactly the account profile the business wants to scale.
Contract value should be preserved as both total contract amount and the portion eligible for media optimization so finance and paid media can read the same event differently without rewriting history.
ARR should be calculated explicitly for subscription or multi-year deals. A one-year pilot, a three-year enterprise agreement, and a services-heavy implementation package should not all be flattened into a single purchase value.
Product mix matters because an opportunity with add-ons, services, and core platform seats can inform account quality, expansion probability, and segment-level bidding decisions long before revenue is fully recognized.
The durable pattern is to emit one canonical event with multiple revenue dimensions. Ad platforms can optimize on a simplified value when needed, while the warehouse keeps the richer contract context for cohorting, ROI analysis, and board-level reporting. That prevents the classic enterprise problem where the ad account says one thing, Salesforce says another, and finance trusts neither.
Account-level attribution (ABM)
Account-based motion breaks when every contact is treated as an independent conversion. A target account may have a champion, economic buyer, security reviewer, and two evaluators, all of whom interact with campaigns before a single opportunity is created. If each person fires a separate conversion, reporting overstates success and bidding models learn the wrong lesson.
Choose the account as the primary conversion entity and make `account_id` the durable join key across Salesforce, TrackLayer, ad audiences, and warehouse models.
Attach every known contact, lead, campaign member, and meeting participant to that account-level conversion record so one decision committee does not appear as five unrelated leads.
Promote the conversion only when the account reaches the agreed milestone such as opportunity creation, stage threshold, or closed won, then include the list of participating contacts as supporting identity rather than separate conversions.
In practice, TrackLayer should emit the account-level conversion once, then preserve contact-level evidence as supporting identifiers and engagement metadata. That keeps ad platforms from learning duplicates while your internal attribution model can still understand which stakeholders influenced the deal.
Outreach/Gong integration
Salesforce stage changes tell you when the opportunity moved. Outreach and Gong explain why it moved. Forwarding Outreach task completion and Gong call records into the same event stream gives the pipeline more context: a demo really happened, a follow-up sequence completed, procurement attended the call, or a discovery meeting occurred before the rep updated the opportunity stage.
Outreach task completion
Forward completed call, email, and sequence task events as sales engagement markers tied to contact ID, account ID, rep, and timestamp.
Gong call records
Forward attended calls, call outcomes, and notable conversation milestones as proof of active opportunity progression rather than relying only on manual CRM updates.
Task and call rollups
Use these events as supporting engagement signals for scoring, model training, and audience suppression without automatically counting each touch as a conversion.
These engagement events usually should not count as final conversions in ad platforms. They are better used as supporting quality signals, audience suppressors, sales activity indicators, and internal attribution features that make the account journey more legible.
Common questions
How should Salesforce CPQ fit into this setup?+
Treat CPQ as a revenue enrichment layer rather than a separate attribution pipeline. Quote objects, line items, discount schedules, and amendment details should enrich the opportunity event that TrackLayer already knows about. The ad platform does not need the full CPQ schema, but your warehouse and internal attribution model probably do.
Should sandbox and production use the same integration?+
No. Keep separate connected apps, tokens, webhook subscriptions, and TrackLayer environments for sandbox and production. Sandbox is for schema validation and routing tests. Production is for revenue truth. Mixing them creates the exact duplicate and false-pipeline problems this guide is trying to avoid.
Where does Marketing Cloud fit?+
Marketing Cloud usually consumes or reacts to the same CRM truth rather than replacing it. You can let Salesforce opportunity and campaign member changes power TrackLayer conversion events while Marketing Cloud continues to orchestrate nurture journeys, email sends, and audience activation from the underlying account and contact data.
What about Data Cloud or an external CDP?+
Data Cloud and CDPs are useful when you need broader identity stitching, audience assembly, and analytics, but they should not force you to delay core conversion routing. In many enterprise stacks Salesforce remains the authoritative sales milestone system, while TrackLayer converts that truth into destination-ready server events and the CDP consumes the same canonical stream for broader modeling.
Can custom objects be included?+
Yes, if they carry real business meaning and you map them intentionally. Partner referrals, implementation milestones, product qualification objects, or onboarding checkpoints can all be added, but they should be normalized into TrackLayer canonical events instead of leaking one-off object names into every ad platform destination.
Next reads
Connect CRM milestones, touch history, and paid media signals without collapsing everything into last click.
Map B2B pipeline milestones into LinkedIn-ready server events with stronger match quality.
Push canonical events and CRM-enriched attribution data into the warehouse for RevOps analysis.