Skip to main content

Integration

Salesforce and Klaviyo Integration

Custom API integration syncing Salesforce contact data, opportunity stages, and custom fields into Klaviyo profiles for targeted lifecycle marketing.

Salesforce
Klaviyo

Integration

What This Integration Does

This integration syncs Salesforce contact records, opportunity data, and custom field values into Klaviyo, building rich profiles that power targeted email and SMS flows based on your sales pipeline. When an opportunity advances in Salesforce, when a contact’s account tier changes, or when a custom field is updated by your sales team, Klaviyo’s profile data reflects that change and your automation can respond accordingly.

Salesforce is the system of record for your pipeline. Klaviyo handles execution for your marketing. This integration ensures they share the same view of each contact so your messaging stays aligned with what is actually happening in the sales process.

Klaviyo has no native Salesforce integration. Building one requires connecting Salesforce’s REST and Streaming APIs to Klaviyo’s Profile and Event APIs through a middleware layer that handles authentication, field mapping, event translation, and conflict resolution. That is what this integration provides.

The Workflow

The integration connects to Salesforce’s Streaming API using Platform Events and PushTopics to receive real-time notifications when Contact, Lead, or Opportunity records change. When a change is detected, the integration fetches the full record from Salesforce’s REST API and maps the relevant fields to Klaviyo profile properties and events.

Salesforce field values are translated into Klaviyo’s data model. Standard fields like name, email, phone, and account name map directly. Custom fields (account tier, contract value, product interest, renewal date) are mapped to custom profile properties in Klaviyo. Opportunity stage changes are sent as tracked events with properties for the opportunity name, stage, amount, and close date.

The translation layer handles Salesforce’s data types. Picklist values become string properties. Currency fields are normalised. Date fields are converted to Klaviyo’s expected ISO format. Multi-select picklists are split into arrays that Klaviyo can use for segment conditions.

For the initial sync, the integration uses Salesforce’s Bulk API to export qualifying records efficiently. Contacts and Leads are filtered by criteria you define: active accounts only, specific record types, minimum opportunity value, or any SOQL-expressible condition. The bulk export is processed and loaded into Klaviyo through batch profile creation.

After the initial load, the Streaming API handles all ongoing changes incrementally. A scheduled reconciliation runs weekly to catch any records that the streaming connection might have missed during brief disconnections.

Before and After

Before: Klaviyo knows nothing about your Salesforce pipeline. Marketing emails go to all contacts regardless of their opportunity status. A contact with a six-figure deal in negotiation receives the same generic nurture as a cold lead from two years ago. When an opportunity closes, no one remembers to update Klaviyo. Onboarding emails go out late or not at all. Renewal campaigns are timed by guesswork rather than contract dates.

After: Klaviyo profiles carry the full context of each contact’s Salesforce record. Flows trigger when opportunities advance. A deal entering negotiation pauses the nurture sequence; a closed-won deal triggers onboarding; a renewal date approaching triggers retention campaigns. Segments filter on account tier, contract value, and product interest. Your marketing automation runs on real pipeline data, not assumptions.

Who Needs This

This integration is for organisations that manage their sales pipeline in Salesforce and run lifecycle marketing through Klaviyo. It fits if you need Klaviyo flows to trigger based on Salesforce opportunity stages (proposal sent, closed won, renewal approaching), or if your Klaviyo segments need CRM data (account tier, contract value, assigned rep, product line) to target correctly. It also covers teams wanting to automate onboarding sequences that start when an opportunity closes in Salesforce, retention campaigns timed to actual contract dates, and personalisation driven by custom Salesforce fields. For teams on HubSpot rather than Salesforce, the same approach is covered in HubSpot and Klaviyo Integration, one of the CRM and email integrations we build.

How We Build This

We start by auditing your Salesforce data model: which objects, fields, record types, and relationships carry the data that matters for marketing. We map each field to a Klaviyo profile property or event, define the naming conventions, and document the data types and transformations required.

Salesforce authentication uses the OAuth 2.0 JWT bearer flow for server-to-server access. We configure Platform Events or PushTopics for the objects you need to monitor, scoped to the specific fields that matter. The integration processes streaming events in a queue with deduplication and ordering guarantees, since Salesforce can deliver events out of order during high-volume periods.

Klaviyo receives data through its v3 APIs. Profile upserts use the Profiles API with external ID mapping to Salesforce’s record ID, which provides a more reliable key than email address for organisations where contacts may share email domains. Events use the Events API with structured metric names and properties.

The initial bulk sync uses Salesforce’s Bulk API v2 with SOQL queries filtered to your qualifying criteria. Records are processed in batches of 500 into Klaviyo. The sync includes a verification step that compares record counts between systems to confirm completeness.

Testing covers the full data lifecycle: initial bulk sync verification, streaming updates flowing through in real time, opportunity stage events triggering the correct Klaviyo flows, profile property updates reflecting in segments, and the weekly reconciliation catching any gaps. This sits within the broader range of API Integrations we deliver, and you can also see how we connect WordPress and Salesforce if you need forms and lead capture feeding the same pipeline.

Start Powering Your Marketing With Real Pipeline Data

If your Klaviyo automation runs on email engagement alone while your Salesforce pipeline holds the signals that actually matter, your marketing is missing the context it needs. We build the connection that gives it full visibility.

Get in touch to discuss your Salesforce and Klaviyo integration.

Written by

Alex

CEO

I’m a software developer and CEO of Digital Royalty, helping growing teams scale their SaaS platforms without losing quality, visibility, or control. I focus on building structured, maintainable systems with clear processes, reporting, and accountability. With over a decade of experience across agency and in-house roles, I specialise in delivering long-term, scalable solutions that support complex, evolving products.

Portrait of Alexander De Sousa, founder of Digital Royalty
Founder-led
“I’ve put everything I know into how this company works — the standards, the method, the care on every project. It runs through the whole team, and I hold us all to it.”

Alexander De Sousa · Founder LinkedIn

Featured on BBC Radio Solent

Get started

Tell us what you need

A few quick questions, then a straight answer from a real person — usually within a few hours.

Tell us what you're working on

Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.