✕
Skip to content
Article
Salesforce Avoids Q3 Danger Zone With ‘Explosive’ Agentforce Momentum
Article
Salesforce Shares Big Agentforce Victory in “Record-Breaking” Cyber Week
Article
Hackers Stole Data from 200 Companies Following Salesforce-Gainsight Breach
Report
SF Ben Salesforce Developer Survey Results 2025: Download Now!
Article
Salesforce Avoids Q3 Danger Zone With ‘Explosive’ Agentforce Momentum
Article
Salesforce Shares Big Agentforce Victory in “Record-Breaking” Cyber Week
Article
Hackers Stole Data from 200 Companies Following Salesforce-Gainsight Breach
Report
SF Ben Salesforce Developer Survey Results 2025: Download Now!
Article
Salesforce Avoids Q3 Danger Zone With ‘Explosive’ Agentforce Momentum
Salesforce Ben
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role
    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
  • Where to Start
  • Salesforce Certification List
  • How to Get Certified
  • Free Salesforce Practice Exams
    • Admin Practice Exam
    • Platform App Builder Practice Exam
    • Platform Developer 1 Practice Exam
  • How to Get a Job in Salesforce

Find us on:

Salesforce Ben
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role

      Articles by role:

    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • Featured

      The Great Salesforce Job Market Reset

      By Sasha Semjonova

      December 09, 2024
      How to Avoid Bad Salesforce Partners: The Three-Question Test

      By Jon Cline

      January 08, 2025
  • Newsletter
  • user
    • Courses Login
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role

      Articles by role:

    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • Featured

      The Great Salesforce Job Market Reset

      By Sasha Semjonova

      December 09, 2024
      How to Avoid Bad Salesforce Partners: The Three-Question Test

      By Jon Cline

      January 08, 2025

What's trending

Hackers Stole Data from 200 Companies Following Salesforce-Gainsight Breach
SF Ben Salesforce Developer Survey Results 2025: Download Now!
50 Most Popular Salesforce Interview Questions & Answers (Updated 2025)
Salesforce Agentforce Specialist Certification Guide & Tips
Why Salesforce Q3 Earnings Will Be a Tipping Point for Agentforce

UPCOMING EVENTS

Defend Against Data Breaches With Salesforce Security

16
Dec

Virtual

SF Ben Webinar

Architect Dreamin’ Americas 2026

21
Jan

Scottsdale, AZ

Community

Cactusforce 2026

22
Jan

Scottsdale, AZ

Community

Japan Dreamin’ 2026

23
Jan

Tokyo, Japan

Community

Philippines Dreamin’ 2026

23
Jan

Mandaluyong City, Philippines

Community
See more
Share
Marketers / Account Engagement (Pardot) / Admins / Developers

Creating a Salesforce Campaign Influence Model That Actually Reflects Your Impact

By Adam Erstelle

November 07, 2025

Campaign Influence in Salesforce is supposed to help marketers prove their value. But the reality is that the standard models (Primary Campaign Source and, for Marketing Cloud Account Engagement customers, First, Last, and Even Distribution) are pretty rigid. Auto Association settings give you the smallest amount of control, and sometimes you just need something stronger.

At my company, we decided to take this to the next level. We built a Weighted-Category Campaign Influence Model that reflects how our marketing touches really work. In this article, I’ll share why we did it, how it benefited us, and what alternatives are out there if you don’t want to build from scratch.

Standard Influence Models (and Their Limits)

There are many detailed articles already written that dive into each of Salesforce’s standard Campaign Influence models. Instead of repeating those, here’s a high-level recap to set the stage for why we needed to build our own.

  • Primary Campaign Source: Available to all Salesforce customers. Gives 100% credit to one campaign (set on the Opportunity). Oversimplifies multi-touch journeys.
  • First Touch / Last Touch: Also available to Marketing Cloud Account Engagement (MCAE/Pardot) customers. Assigns 100% of the credit to the first campaign a prospect engaged with, or the last one before conversion. These are helpful to answer specific questions, but still don’t give a balanced picture of multi-touch journeys.
  • Even Distribution: Available only to MCAE customers. Splits credit equally across all campaigns. Better, but still unrealistic. Are a webinar and a nurture email really equal?

In our environment, MCAE was doing a great job of associating people with Campaigns. What we found, though, is that often the influence of known high-value efforts (in-person events, for example) was being undervalued compared to the high-volume activities like newsletter sends.

Salesforce’s Example Code: Why It Falls Short

Salesforce does provide sample code in its documentation for building custom influence models. The issue? It’s poorly documented, not production-ready, and doesn’t provide a clear structure for extending or maintaining the model. For most admins and devs, this leaves more questions than answers.

Beyond that, there are some deeper problems with the approach:

It Triggers Off Another Model’s Calculations

The reference implementation in the example is an “after insert” trigger on CampaignInfluence, meaning it relies on recalculation events from an existing model, based on Id (never a good practice). That means your model’s timing, scope, and retry behavior are chained to rules you don’t control. If your logic requires recalculation when a Campaign’s Type is changed, your code might not run, and you’ll be left scratching your head. No one wants blind spots in reporting or inconsistent numbers – this is likely the reason you are already looking to build something custom!

Runs as a Special “Salesforce Administrator” User

When the models provided by Salesforce execute, their calculations run as a special user named “Salesforce Administrator”. This user (not to be confused with the Profile) is tough to debug and work with. You’ll see this special user’s Id on the CampaignInfluence records for the out-of-the-box models, but you can’t pick it if you are trying to set debug log levels. I had to use the REST API to create the TraceFlag entry to enable debugging.

Auto-Association Settings

Auto-Association gives limited tuning for out-of-the-box models (can reference certain fields, and an overall time frame window), but these settings aren’t exposed in any way that custom code can reference. I was surprised and frustrated upon this discovery.

No Testing Example

Like many other samples on the internet, there are zero unit tests that show how this sample code can be tested. Chaining our own logic to a bit of a black box on how another model runs its calculations makes unit test setup (or even discovery on how to do this) a nightmare. 

When I worked with a previous company, I created a couple of Campaign Influence models, which started from this example code, and the projects each ended up being large 80+ hour efforts. This time around, I wanted to take lessons learned and build something better.

How We Built Our Weighted-Category Model

The key idea was simple: not all campaign types are equal, and that realization drove the design of our new model. Instead of treating a newsletter click the same as an in-person event. To do that, we broke our campaign types into broader categories and gave each one a specific weight. We also didn’t want volume difference to skew our results, so all Campaign touchpoints within a category share the same weighted slice of the pie, so to speak.

Let’s break that down a bit more. The first two steps are going to be specific to the type of model you are looking to build, and the last two steps are going to be relevant for everyone.

Step 1: Define Categories

We began by grouping our Campaigns into broader categories that matched our marketing strategy. For us, this was a bit different than the typical “Type” category, though it certainly could be used. We ended up having Events, Newsletters, Gifting, and Website. This helped ensure the model captured the strategic differences between high-value, low-volume activities and high-volume, low-touch ones.

To help evaluate our approach, I created an Excel spreadsheet we could use to simulate a single Opportunity and the Campaign Members that would be associated with its Contacts. This let us quickly prove the model and find ways to communicate it well.

Step 2: Assign Weights

Once categories were defined, we assigned each one a weight that reflected its typical contribution to the pipeline. I’d like to say this was a data-driven decision, though honestly, the majority of it came from marketer intuition and team consensus. For example, Events carried far more weight than the others… so we gave each category a weight (e.g., Events = 50, Newsletters = 10, Gifting = 5, etc).

Step 3: Build Custom Logic

With categories and weights in place, we wrote Apex code to apply these rules to our Opportunities, and provided configurable options to easily add/change each category as well as the criteria for selection.

Architecturally, our code solution was split into two layers.

  1. Opportunity Calculations: For a given Opportunity, it will retrieve the Contacts and CampaignMembers that met our criteria (both timeframe and attributes), then apply the right groupings and calculations.
  2. Observer Layer: Looks for when calculations might be needed. This is largely based on business rules; however, watching Campaigns, CampaignMembers, Contacts, OpportunityContactRoles, and Opportunities are all needed. At the end of the observation, we would need to trigger the calculation for one or many Opportunities.

Bulk processing is pretty important, so we had multiple layers of Platform Events, allowing us both to reuse logic as well as move this complex processing out of the main database transaction.

  • Campaign Calculation Needed: An event for each Campaign that might have been updated. Processing this identifies the Contacts that need to be processed.
  • Contact Calculation Needed: An event for each Contact. Could be launched by a Campaign changing, or by Contact details themselves (including Campaign Membership). Processing this identifies the Opportunities that need to be processed.
  • Opportunity Calculation Needed: An event for each Opportunity. Processing this event is where the main calculations happen.

A Custom Metadata Type was put in place to hold onto our timeframe values and our filtering. This allowed us to build a more robust solution than the Auto-Influence settings provided out of the box, though having the proper SOQL fragments here does mean it is a little less “admin-friendly” (though our admins are pretty awesome!).

As for the categories themselves, this is baked into the “Influence Category” Picklist that is present on the Campaign object. The values are delimited, containing both the category name and the weight. This approach allows us to easily add/remove/adjust our categories without bringing in a developer. We hope to not need to make too many changes here going forward, though if that were to change, we might need to move to a Lookup giving us more flexibility.

Step 4: Validate and Refine

No model is perfect at first. We tested our calculations against our Opportunities, comparing it to the original models and some of the work we did during design. Where discrepancies appeared, we tweaked the weights, created/removed categories, and iterated a few times. This feedback loop gave everyone more confidence in the final numbers.

With lessons learned and the help of our agentic tooling, I was able to create this solution in just a few days. The reduced timeframe, I believe, makes this approach a little more affordable than I think it has been in the past.

Benefits We’ve Seen

With the Even-Touch Distribution model, our newsletter emails were earning far too high influence. The numbers coming from our Salesforce ROI reporting weren’t being used, and manual calculations were happening after the fact. We all know this is time-intensive and prone to mistakes, especially around big events for us like Salesforce Connections and Dreamforce.

Building the solution and categorizing our Campaigns was worth every minute. We’ve been able to compare numbers from previous years to our automated results to build confidence, and the biggest recent event’s reporting went a lot smoother.

  • More accurate reporting: Our dashboards now reflect the true impact of big-ticket campaigns.
  • Better budget decisions: Marketing leaders feel confident directing spend to the channels that matter.
  • Alignment with Sales: Sales teams see attribution that actually matches their experience in the field.

Alternative Options

Not everyone needs to reinvent the wheel. If you don’t want to build a weighted model yourself, there are some alternatives:

Free / DIY Approaches

Sadly, beyond the code sample in Salesforce’s example documentation, there isn’t a lot out there for anyone looking for a head start doing this themselves.

  • Explore what the Salesforce community has shared (though currently limited examples exist). Hopefully, this post goes one step further for the community.
  • Customize reporting and dashboards to slice influence by Campaign Type, even without custom code. This will be a bit easier if you have a real BI tool – there are several options available.

Paid Attribution Tools

There are several AppExchange solutions that provide attribution models out of the box. Three strong options include:

  • Align.ly Attribution: A lightweight, inexpensive, 100% native Salesforce attribution solution that leverages standard Salesforce campaigns without requiring external data storage or complex integrations. The package appears to be relatively minimal in terms of components since it works entirely within existing Salesforce infrastructure, making it easy to implement, with setup possible in as little as one hour.
  • Full Circle Insights: A comprehensive, pricey, enterprise-focused solution that includes multi-touch attribution, funnel measurement, customer journey tracking, and account-based marketing (ABM) performance capabilities. This appears to be a more substantial package given its extensive feature set and integration capabilities, likely containing numerous custom objects, workflows, and dashboards.
  • MagicRobot Attribution Analytics: Between the other two mentioned in terms of weight and a wide variety of pricing.  

Build vs. Buy: How to Decide

Whether to build or buy really depends on your priorities. Building your own model gives you full control and the ability to tailor it to your business, but it also means taking on the work of coding, testing, and maintaining it. Buying from the AppExchange gets you quick results with vendor support, though you’ll trade off some flexibility and commit to ongoing license costs.

A simple way to think about it: if attribution is a competitive advantage and you have the in‑house skills, build it. If you just need solid attribution fast and don’t want to own the upkeep, buy it. Either path can work – the key is matching the approach to your team’s strengths and appetite for ongoing investment.

Best Practices and Recommendations

The most important step is aligning the team and leaders at the very start. With agreement on which campaigns matter most and how much weight they should carry, the model will be easier to trust. Keeping the design simple in the beginning also goes a long way – fewer categories and clear weights are far easier to manage than a sprawling model that tries to capture every nuance.

Expect to revisit your parameters on a regular basis, especially in the beginning, as you begin testing. As your marketing mix changes, so should the logic of your model.

Build in simple but helpful log statements, and a way to run the calculation for a single Opportunity on demand. Having a trace of what happened behind the scenes makes troubleshooting infinitely easier, and being able to isolate one record keeps debugging efficient.

Finally, don’t underestimate the importance of communication. Share your model, explain why it works the way it does, and make sure the people using the numbers understand the story behind them. Adoption and trust rise dramatically when people see both the logic and the transparency behind your approach.

Final Thoughts

Campaign Influence is too important to leave to oversimplified models. By investing in a weighted-category custom model, we’ve been able to reflect our true marketing impact, make smarter budget decisions, and align better with Sales. Whether you decide to build or buy, the key is to choose an approach that tells the real story of your buyer’s journey.

The Author

Adam Erstelle

Adam is a Software Engineer turned into a Salesforce fanatic. Working at various consulting partners, he's been able to help customers of all varieties and sizes. He's created four AppExchange packages, solving small pain points of admins and users alike.

More like this:

Marketers

6 Reasons Why Marketing Cloud Next May Really Be the Next Big Thing in Salesforce

By Kenny Van Beeck

September 24, 2025
Marketers

What Does Data Cloud Have That Marketing Cloud Engagement Doesn’t?

By Alina Makarova

September 22, 2025
Marketers

AI Agents in Marketing Cloud: Prepare Your Data, Processes, and Org for What’s Next

By Karen Williams

August 04, 2025

Leave a Reply Cancel reply

Newsletter:

    By signing up you agree to our Terms of Use and Privacy Policy.

    Find us on:

    Salesforce Ben

    Salesforce Ben
    Third Floor Library Building
    Sun Street
    Tewkesbury
    Gloucestershire
    United Kingdom
    GL20 5NX

    • Where to Start
    • Salesforce Certification List
    • How to Get Certified
    • Free Salesforce Practice Exams
      • Admin Practice Exam
      • Platform App Builder Practice Exam
      • Platform Developer 1 Practice Exam
    • How to Get a Job in Salesforce
    • Events
    • Career
    • AppAssessor
    • Salesforce News
    • Articles by Role
    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • About Us
    • Contact Us
    • Write For Us
    • Influencer Program
    • Advertise With Us
    • Pledge 1%
    • Privacy Policy
    • Change Cookie Preferences
    • Log in to Courses

    © 2014-2025 SalesforceBen.com