Pointer Icon Book a Meeting

Salesforce Marketing Attribution: Tracking Leads & Opportunities to Optimise B2B Campaign ROI

Reading Time – 16 Mins

Salesforce marketing attribution

Senior B2B marketers with long sales cycles often face a familiar challenge: proving which marketing channels and campaigns are actually driving revenue. In a complex customer journey, a lead might click an ad, download a white paper, attend a webinar, and have multiple sales touches before an opportunity is won. 

How do you connect all those dots in Salesforce and attribute closed deals back to the right marketing efforts? This is where Salesforce marketing attribution comes in. By properly tracking leads and opportunities in Salesforce and attributing them to marketing channels, you can finally get clarity on ROI and make smarter campaign decisions.

In this comprehensive guide, we’ll explain why closed-loop attribution is so important and walk through a high-level process to implement it. We’ll cover how to capture UTM parameters and campaign data at lead creation, map that data through the lead conversion process, leverage Salesforce Campaigns and Campaign Influence for multi-touch attribution, and even push conversion data back to ad platforms like Google and Meta. The result? Clearer attribution, improved ROI, better campaign performance, and tighter sales-marketing alignment. Let’s dive in.

Why Tracking Salesforce Marketing Attribution and ROI Matters

Marketing attribution is critical for understanding which channels are winners and which are dead weight. If you can’t tie revenue back to the campaigns that produced it, you’re flying blind when allocating budget. Campaign ROI is the holy grail of B2B marketing metrics – it tells you exactly which campaigns drive sales so you know where to double down or pull back. Without this insight, marketing teams often rely on vanity metrics (clicks, form fills) that don’t necessarily translate into business value.

By tracking leads and opportunities in Salesforce with attribution data, you close the loop between marketing and sales. Salesforce becomes the single source of truth that connects your marketing efforts (stored in campaigns and lead records) with sales outcomes (opportunities and revenue).

This closed-loop approach answers questions like: Which marketing campaigns generated the most pipeline this quarter? What was the first-touch channel for our highest-value deals? How much revenue did our Google Ads produce vs. LinkedIn ads? Armed with these answers, you can monitor your marketing mix for maximum ROI.

Salesforce marketing attribution data also improves alignment between the marketing and sales teams. Marketing can prove its impact on revenue, and sales can prioritise leads that come from high-performing channels. In fact, a recent Salesforce survey showed 41% of marketing organisations are using attribution modelling as a measure of ROI – a sign that more teams are turning to data-driven attribution to guide their decisions.

Step 1: Capture UTM Parameters and First/Last Touch Details on Web Forms

The foundation of Salesforce marketing attribution is capturing the right data when a lead first engages with you. This typically happens through a web form submission (such as a demo request, contact form, or content download). To attribute that lead to a marketing channel, you need to track key parameters from the web session:

  • UTM parameters – e.g. utm_source, utm_medium, utm_campaign (and utm_term, utm_content if applicable). These tell you where the visitor came from and which campaign or ad prompted them. UTM tags are the industry standard for tracking online marketing campaigns, and they allow you to pinpoint the source/medium (e.g. Google/CPC, LinkedIn/paid social, email/newsletter).
  • Referral source – the referring URL or site that brought the visitor, if not captured by UTMs (for example, an organic search or referral link).
  • Channel – you might derive a high-level channel category from the UTMs (e.g. Paid Search, Organic Search, Email, Social, etc.) or use Salesforce’s native Lead Source field for a broad classification.
  • Click IDs (GCLID, FBCLID) – if you’re running paid media, it’s vital to capture unique click identifiers. GCLID (Google Click ID) is appended to URLs from Google Ads; capturing this allows you to later report offline conversions back to Google. Similarly, capturing the FBCLID (Facebook click identifier) or other ad platform IDs is useful for offline conversion tracking in Meta Ads.

Importantly, you should capture both first-touch and last-touch data for these parameters:

  • First touch = the UTMs and source from the lead’s first conversion on your site (how they originally discovered you).
  • Last touch = the UTMs and source from the lead’s most recent conversion or form fill (what brought them back this time).

Why both? In long B2B buying cycles, the first touch tells you which marketing effort initially generated the lead, while the last touch often shows which effort re-engaged them or pushed them over the line to become an opportunity. Having both gives a more complete picture of the marketing journey.

How to implement: Work with your web developer or marketing operations team to ensure every form on your website includes hidden fields for these UTM and source values. Often this involves a small JavaScript that stores the UTM parameters and referrer in a cookie on the visitor’s first visit, then populates hidden form fields with the first-touch data and the current (last-touch) data when the form is submitted. There are many tutorials and tools for this, and it may already be built into your marketing automation platform if you use one (e.g. Pardot, Marketo). The key is that when a lead form is submitted to Salesforce, it should carry these UTM parameters and IDs along with the lead’s contact info.

For example, you might have lead fields like First Touch Source, First Touch Campaign, First Touch Medium, etc., and similarly Last Touch Source, Last Touch Campaign, etc., plus fields for First/Last GCLID. These fields will get populated from the form submission. Once captured in Salesforce, this data will let you attribute that lead (and eventually, any opportunity from it) back to the specific marketing efforts that got them there.

Light tip: If you’re not sure how to set this up, Salesforce Help has resources and you can consult a Salesforce Admin. The basic idea is to use Web-to-Lead or your form integration to pass hidden field values into Salesforce. You can reference guides on capturing the GCLID in Salesforce forms or UTM tracking methods to get started.

Step 2: Create Custom Fields on Lead & Contact and Map Them on Conversion

Capturing UTMs and source data is step one; step two is making sure that data stays with the prospect as they move through your Salesforce funnel. In Salesforce, leads are often converted into Account/Contact/Opportunity records when they become qualified. If you don’t plan ahead, you might lose the attribution data at the moment of conversion. To prevent that, you should create corresponding fields on the Contact (and even Opportunity) objects and map your lead fields to them.

Set up custom fields: In Salesforce Setup, create custom fields on the Lead Object for each piece of data you’re tracking (if you haven’t already). For example: First Touch Source, First Touch Medium, First Touch Campaign, Last Touch Source, Last Touch Campaign, GCLID, etc. (you can also have a single “Lead Source Detail” text that concatenates UTMs if you prefer). Then create matching fields on the Contact Object (and optionally on the Opportunity for key fields like first touch source, if you want that directly on Opportunities).

Map the fields on lead conversion: Salesforce allows you to map lead fields to account, contact, or opportunity fields upon conversion.

Go to Setup -> Object Manager -> Lead -> Fields & Relationships, and click Map Lead Fields. Here you can map each custom Lead field to the corresponding contact field (and if relevant, to the account or opportunity field). For instance, map “Lead: First Touch Source” to “Contact: First Touch Source”. Do this for all your UTM and attribution fields. This ensures that when a rep converts a lead to a contact, all those UTM values will carry over to the new contact record (and the opportunity, if mapped there).

By mapping these fields, the attribution data captured at the lead stage will live on in the contact record, which is important for two reasons: (1) contacts (not leads) are what get associated to opportunities in Salesforce, and (2) you might have repeat opportunities over time from the same contact/account, and you’ll want to know their original source even after the lead is converted. If you skip this mapping, you risk losing the source information as soon as the lead converts.

Note: If your Salesforce instance uses the Lead Source picklist field as well, decide how it relates to your UTM fields. Many companies use Lead Source for a broad category (e.g. “Web” or “Trade Show”) and use UTMs for granular detail. You can auto-populate Lead Source from UTM Medium or Source if you choose. Just be sure to also map Lead Source to Contact’s Lead Source on conversion (Salesforce does this for the standard field by default). Custom fields, however, you must map manually.

Step 3: Use Salesforce Campaigns (and Flows) to Attribute Leads to Marketing Efforts

With raw UTM data in place, the next layer of attribution is leveraging Salesforce Campaigns. Salesforce campaigns are a powerful way to group leads, contacts, and opportunities by the marketing initiatives that influenced them. By adding your leads to campaigns, you unlock Salesforce’s campaign reporting and the ability to credit revenue to specific campaigns down the line.

Set up campaigns for key channels or campaigns: In Salesforce, create campaign records that represent the marketing efforts you want to track. This could be at the channel level (e.g. a campaign for “Google Ads Paid Search”, another for “LinkedIn Ads”, another for “Webinar – June 2025”) or at the specific campaign level (e.g. each unique ad campaign or content offer gets its own Salesforce campaign). The right level of granularity may depend on your reporting needs. To start, many B2B marketers create campaigns per channel and major initiative, so they can see pipeline and revenue per channel.

Automatically associate new leads to the right Campaign: Rather than relying on sales or marketers to manually add leads to campaigns, you can automate this with a Salesforce Flow (or previously Process Builder). For example, build a record-triggered Flow on the Lead object that runs when a lead is created. In the Flow, use the lead’s UTM fields or Lead Source to determine which campaign it should be associated with:

  • If utm_source = “google” and utm_medium = “cpc”, add the lead as a Campaign Member to the “Google Ads Paid Search” campaign.
  • If Lead Source = “Referral”, add to “Website Referral Traffic” campaign.
  • If utm_campaign indicates a specific event or content (e.g. contains “Webinar_June2025”), link to the corresponding Salesforce campaign for that webinar.

The Flow would create a new Campaign Member record, which is the junction object linking a Lead/Contact to a campaign. (In Salesforce, adding someone to a campaign creates a Campaign Member entry.) This automation ensures every lead is tagged with the campaign that sourced them, immediately at creation.

Salesforce has published guidance on automatically assigning new leads to campaigns using Process Builder or Flow. Essentially, your flow will look up the correct campaign (perhaps by name or a custom field matching the channel) and then create a Campaign Member where Lead = new lead, Campaign = that campaign, with an appropriate status (like “Responded” or “Member”). Once set up, this is a huge time-saver and enforces consistent attribution.

Use campaign hierarchy if needed: If you have many campaigns, consider using campaign hierarchy (e.g. a parent campaign for “2025 Paid Search” with children campaigns for each specific Google Ads campaign). This can roll up metrics. However, avoid creating a new Salesforce campaign for every single ad or keyword – that can be overkill. Focus on meaningful buckets that you want to report on (channel, content, event, etc.), and use the UTM details for further drill-down as needed in reports.

At this point, you have a situation where each lead in Salesforce not only has raw UTM data, but is also linked to a Salesforce campaign representing its marketing source. This sets the stage for opportunity attribution.

Step 4: Enable and Configure Campaign Influence for Multi-Touch Attribution

Marketing often involves multiple touches, especially in B2B deals. A single lead could be influenced by several campaigns (for example, they first came through a paid search ad, later attended a webinar, and finally clicked an email – all of which helped move them toward a sale). Salesforce addresses this with Campaign Influence, which allows you to associate multiple campaigns to a single opportunity and split credit between them.

Enable Campaign Influence: Salesforce has a feature called Customisable Campaign Influence (the enhanced version of the older “Campaign Influence 1.0” model). To use it, an admin needs to enable it in Salesforce Setup. Go to Setup -> Campaign Influence Settings and click Enable for Campaign Influence, and ensure you have a default model active.

By default, Salesforce will provide a Primary Campaign Source model (which gives 100% credit to the campaign marked as Primary on the opportunity) and an even distribution model if Additional Influence Models are turned on. Enabling the feature will add a related list on Opportunities for Campaign Influence, where multiple campaign credits can be listed.

Associate contacts to opportunities (Contact Roles): For Campaign Influence to work properly, you must use Contact Roles on opportunities. This means when an opportunity is created, the related contact (or contacts) who are involved in that deal should be added to the opportunity as Contact Roles (with a role like Decision Maker, Influencer, etc.). This is crucial: without contact roles, Salesforce cannot identify which contacts (and thus which campaigns) influenced the opportunity. Ensure your sales team includes the relevant contact on each Opportunity record.

Auto-association of campaigns to opportunities: Once Campaign Influence is enabled, Salesforce will automatically create influence records if a contact on an opportunity is a member of a campaign that meets the criteria (usually that the campaign had an interaction date before the oppty close date and within a certain look-back window). For example, if Jane Doe is a Contact on an Opportunity, and Jane was added to the “Google Ads Paid Search” campaign back when she first filled out a form, then that campaign will show up as influencing the Opportunity (with a percentage of the revenue attributed, according to the attribution model). You can configure the auto-association rules, such as the time frame in which a campaign touch is considered influential (e.g. campaigns within 30 days of opportunity creation).

Choose an attribution model: Out of the box, the simplest model is the Primary Campaign Source – which is just a single campaign field on the Opportunity (often the campaign from the lead conversion). However, the more powerful approach is a multi-touch model. Salesforce’s Customisable Campaign Influence lets you have multiple models (even first-touch, last-touch, or custom weightings).

For most, a good starting point is an evenly-split model (giving equal credit to all campaigns that influenced the deal) or a first-touch / last-touch model depending on what you value. If you have Einstein Attribution (in Salesforce Pardot/Account Engagement), you can even use data-driven attribution models but that may require additional licenses. For now, simply enabling campaign influence with a sensible model will dramatically improve your insight into multi-touch journeys.

Report on campaign influence: After configuring this, you can use Salesforce reports or dashboards to see how campaigns influence pipeline and revenue. For example, run an “Opportunities with Campaign Influence” report to list each opportunity and the campaigns that contributed, along with revenue share. This is where the magic happens – you’ll start to see that maybe 5 campaigns played a role in Q2’s big deal, or that a particular webinar has influenced $2M in pipeline as of today, even if it wasn’t the first touch. It connects the dots between marketing data and sales revenue in Salesforce.

Step 5: Push Conversion and Revenue Data Back to Google and Meta Ads (Closing the Loop)

The final step in a robust closed-loop attribution process is to send the conversion results back to your advertising platforms. Why? Because by feeding actual sales outcomes into Google Ads, Facebook/Meta, LinkedIn, etc., their algorithms can optimise for what really matters (revenue or pipeline), not just lead form fills. This helps improve your paid media performance significantly.

In practice, this involves exporting or syncing data on leads and opportunities from Salesforce to those ad platforms:

  • Google Ads Offline Conversions: Google Ads allows you to import offline conversions that occurred in your CRM. If you’re capturing the GCLID for each lead (from Step 1), you can later upload a file (or use the Google Ads API) to match that GCLID to a conversion event in Google Ads. For example, when a lead converts to an Opportunity (or an Opportunity is marked “Closed Won”), you send Google the GCLID, the conversion date, and perhaps the opportunity value. Google then counts that as a conversion for the original click and can include it in its optimisation algorithms. Tip: Google Ads has a Salesforce integration for offline conversion import, which guides you through connecting Salesforce and setting up the GCLID capture and conversion actions. You can use that or a manual process.
  • Meta (Facebook/Instagram) Conversions: Similarly, Meta allows offline conversion tracking. Typically you would use the Conversions API or offline events upload to send Salesforce data (like when an opportunity is won, along with details such as email, name or a transaction ID) back to Facebook. If you captured the fbclid or have the person’s email, Facebook can match the conversion to the ad click. This will train Facebook’s algorithm to optimise for leads that turn into actual sales, not just clicks. Setting this up might require a bit of developer help or a third-party tool, but even a periodic CSV upload of conversions to Meta can improve your campaign targeting.

By pushing conversion data back into your ad platforms, you complete the feedback loop. Your marketing platforms now know which clicks led to real revenue, and can find more people like your best customers. Over time, this means higher quality leads and improved return on ad spend.

Note: Always ensure you comply with privacy policies when sharing data between systems. Typically, these platforms use hashed data for matching offline conversions.

Benefits of Closed-Loop Attribution in Salesforce

Implementing the above steps requires effort and cross-team coordination, but the benefits are transformational for marketing effectiveness:

  • Clearer attribution of revenue: You’ll finally see which marketing activities are contributing to closed deals in a concrete, quantifiable way. For example, you might discover that organic search first-touches drive a lot of leads, but your paid LinkedIn campaigns actually influence more late-stage opportunities. This insight is invaluable for strategy.
  • Improved ROI and budget allocation: With attribution data, you can reallocate budget to the highest-performing channels and campaigns. You’ll know exactly which campaigns generate high-value leads versus which ones might produce volume but low conversion. This helps in cutting spend on under-performers and doubling down on winners.
  • Better campaign performance (through optimisation): Feeding conversion data back to Google and Meta means those platforms optimise for what matters, leading to better targeting and higher ROI on your ad spend. It’s a virtuous cycle – better data leads to better optimisation, which leads to better leads.
  • Tighter sales and marketing alignment: When Salesforce becomes a shared system of truth for both lead generation and sales outcomes, it aligns teams on common metrics. Marketing qualified leads can be tracked through to opportunities and wins, fostering accountability. Sales, in turn, sees the history of how a lead engaged with marketing (via Campaigns on the Contact record), which can inform their sales approach. Everyone speaks the language of pipeline and revenue, not just leads or clicks.
  • Data-driven decision making: Perhaps most importantly, you elevate marketing from a cost center to a revenue driver backed by data. Decisions on marketing strategy, channels, and even content can be informed by attribution reports. For instance, if webinars influenced 30% of last quarter’s pipeline, you might invest in more webinars. If a certain AdWords campaign generated five enterprise deals, you might increase its budget or create similar campaigns.

In short, proper marketing attribution in Salesforce gives you visibility into the full buyer journey and the impact of each touch. It turns intuition into insight and allows for continuous campaign optimisation and higher marketing ROI.

Final Thoughts

Salesforce marketing attribution might sound technical, but with a solid process and the right Salesforce configuration it becomes part of your regular workflow. The steps outlined above provide a high-level roadmap. As a marketing leader, you don’t need to be the one building Salesforce flows or writing scripts – you can involve a Salesforce admin or developer to implement the technical pieces (and refer to Salesforce’s help articles for detailed instructions). The key is to understand the framework:

  1. Capture the relevant data (UTMs, sources, IDs) at the entry point.
  2. Carry that data through the lead conversion by mapping fields.
  3. Connect leads to campaigns in Salesforce for proper grouping.
  4. Attribute opportunities to campaigns using Campaign Influence (multi-touch attribution).
  5. Close the loop by informing your ad platforms about what turned into real sales.

By following this framework, you’ll build a robust B2B marketing attribution system on Salesforce. Over time, this will dramatically improve your ability to measure marketing ROI and optimise campaigns. You’ll no longer be guessing which half of your marketing spend is working – you’ll know, and you can invest with confidence.

Remember: Start with the basics (capture UTMs and enable Campaign Influence) and iterate. Even a simple first-touch report in Salesforce is better than none. Then you can get more sophisticated with multi-touch models or advanced analytics. The effort is well worth it. In the words of one Salesforce attribution expert, connecting marketing and sales data gives you a “single source of truth” to understand true marketing ROI.

With clear Salesforce marketing attribution in place, you’ll drive more efficient campaigns, higher revenue, and a stronger partnership between marketing and sales.