Setup Guide


What This Guide Covers

This guide walks you through the one time setup required in Salesforce and Klaviyo before the integration can go live. Follow each section in order. Sections and steps marked optional can be skipped if you won't use that sync. Skipping any other step will cause the integration to fail.

By the end of this setup, the integration will:

  • Sync Contacts from Salesforce to Klaviyo, and Leads too if you turn Lead Sync on
  • Send Case events (Created, Updated, Closed, Escalated) to Klaviyo, if you turn Case Sync on
  • Keep email and SMS consent in sync between both platforms, if you turn Consent Sync on
  • Write Klaviyo email/SMS engagement data back to Salesforce Contact and Lead Activity Tasks

Important: All steps in this guide must be performed by a Salesforce System Administrator. Do not proceed without admin access.


Section 1: Before You Start

Confirm you have everything below before touching any settings.

  • You have System Administrator access in Salesforce
  • You have Account Owner or Full Access in Klaviyo
  • State and Country/Territory Picklists are enabled in your Salesforce org (see below)

State and Country/Territory Picklists

The integration reads each Contact's and Lead's country code (the MailingCountryCode field on Contact and CountryCode on Lead) to turn phone numbers into the international format Klaviyo needs. Phone numbers on your Salesforce Contacts and Leads that are saved without a country code, such as (415) 555-0132, can only be read correctly when the country is known. Without these fields, those numbers are skipped, and the sync can fail with an invalid field error.

Salesforce only provides the country code fields once State and Country/Territory Picklists are enabled. To check, go to Setup, search for State and Country/Territory Picklists in Quick Find, and confirm they show as enabled. If not, follow Salesforce's steps on that page to scan, convert and enable them.


Section 2: Set Up Consent Fields in Salesforce

The integration reads one email consent field on every Contact, and on every Lead if you sync Leads. It can also read an SMS consent field, if you want SMS consent in sync. Salesforce already has a standard email field, so most orgs only need to make it visible. The SMS field is optional.

Note: The field names in this section (HasOptedOutOfEmail and SMS_Opt_Out__c) are just examples. Whichever fields your org actually uses, enter their exact API names under Configure Mapping → Consent Field Mapping during setup. The email field is required. The SMS field is optional.

Note: The integration reads the API name of each consent field to decide what a checked box means. A name that contains OptedOut or Opt_Out (for example HasOptedOutOfEmail or SMS_Opt_Out__c) is read as opted out when checked. Any other name (for example SMS_Opt_Out__c) is read as opted in when checked. A name without the underscore, such as SMS_OptOut__c, is read as an opt-in field, which reverses the meaning. If that is your field name, rename it or use a different field.

2.1 Email Consent Field

The integration always needs one email consent field to read. Which one you use depends on your org:

  • You don't have your own email consent field. Use the standard HasOptedOutOfEmail field. It exists on both Contact and Lead and is already filled in by default under Consent Field Mapping.
  • You already have your own email consent field (for example Email_Opt_Out__c). Use that one instead and enter its API name under Consent Field Mapping.
  • You don't want to sync consent. Leave the default HasOptedOutOfEmail in place. You can turn Consent Sync off later in Organization Settings.

Either way, the field has to be visible to the System Administrator profile:

  1. Go to Setup → Object Manager → Contact
  2. Click Fields & Relationships
  3. Search for your email consent field (HasOptedOutOfEmail by default) and open it
  4. Click Set Field-Level Security
  5. Check the Visible box for System Administrator and click Save
  6. If you're also syncing Leads, repeat steps 1 to 5 on the Lead object

2.2 (Optional) SMS Consent Field

Only follow this section if you want SMS consent to sync. If you don't use SMS consent, skip it and leave the SMS field empty under Consent Field Mapping.

If your org already has an SMS consent checkbox, use it. Just make sure it is visible to the System Administrator profile (step 6 below) and enter its API name under Consent Field Mapping. Otherwise, create a new one:

  1. Go to Setup → Object Manager → Contact
  2. Click Fields & Relationships → New
  3. Select Checkbox as the Field Type and click Next
  4. Fill in the field details:
    • Field Label: SMS Opt In
    • Field API Name: SMS_Opt_Out (Salesforce will add __c automatically)
  5. Click Next → Next → Save
  6. Set Field-Level Security the same way as steps 4 and 5 in 2.1, making it Visible for System Administrator
  7. If you're also syncing Leads and want SMS consent on Lead too, create the same field on the Lead object. If both objects use the same field name, the integration will pick it up on both automatically once you set it in Consent Field Mapping.

Important: SMS_Opt_Out__c is only an example name. Whatever API name your field actually has, enter that exact name under Configure Mapping → Consent Field Mapping as the SMS consent field. A mismatch between the two will break SMS consent sync.

2.3 (Optional) Enable Field History Tracking

This step isn't required, but it lets you see a history of changes to consent fields on the Contact (and Lead) record.

  1. Go to Setup → Object Manager → Contact
  2. Click Fields & Relationships → Set History Tracking
  3. Check the box for Enable Contact History
  4. Check the boxes for your email and SMS consent fields (whatever you entered in Consent Field Mapping)
  5. Click Save
  6. Repeat on the Lead object if you're syncing Leads

Section 3: Create Outbound Messages and Flows

Salesforce can send changes to the integration in real time. To set that up, you create a Record-Triggered Flow. The flow watches a record for a change and sends an Outbound Message to the integration.

Every flow in this section is optional. Only create the ones for the syncs you plan to use:

  • Case events flow: only if you use Case Sync
  • Contact consent flow: only if you use Consent Sync
  • Lead consent flow: only if you use both Lead Sync and Consent Sync

Each flow has two parts: first create the Outbound Message, then create the flow that sends it. You turn the syncs themselves on or off in Organization Settings (see Section 4).

3.1 Case Events (optional, only if you use Case Sync)

Skip this section if you won't sync Cases. This flow tells the integration when a Case is created, or when its Status, Priority or Escalation changes.

Part A: Create the Outbound Message

  1. Go to Setup, search for Outbound Messages in Quick Find, and click New Outbound Message

  2. Select Case as the object and click Next

  3. Fill in the outbound message details:

    • Name: Klaviyo Case Events Webhook
    • Unique Name: Klaviyo_Case_Events_Webhook
    • Endpoint URL: provided by Solvative
    • User to Send As: your admin username
  4. Under Case fields to send, select all of the following: CaseNumber, ClosedDate, ContactEmail, ContactId, ContactPhone, CreatedDate, Id, IsClosed, IsDeleted, IsEscalated, LastModifiedDate, Origin, OwnerId, Priority, Status, Subject, Type

  5. Click Save, then Done

Part B: Create the flow

  1. Go to Setup → Process Automation → Flows and click New Flow

  2. Select Record-Triggered Flow and click Create

  3. Click Add Object and select Case

  4. Under Configure Trigger, select A record is created or updated

  5. Under Set Entry Conditions, set Condition Requirements to Formula Evaluates to True

  6. Paste the following formula into the formula box:

    OR(
      ISNEW(),
      ISCHANGED({!$Record.Status}),
      ISCHANGED({!$Record.Priority}),
      ISCHANGED({!$Record.IsEscalated})
    )
    
  7. Under When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements

  8. Under Optimize the Flow for, select Actions and Related Records, then click Done

  9. Click the + under the trigger, choose Action, search for Klaviyo Case Events Webhook under Outbound Message, and select it

  10. Set the Label to Send Case Event to Klaviyo and click Done

  11. Click Save and name the flow Klaviyo Case Events Flow

  12. Click Activate

3.2 Contact Consent Events (optional, only if you use Consent Sync)

Skip this section if you won't sync consent. This flow tells the integration when a Contact's email or SMS consent changes.

Part A: Create the Outbound Message

  1. Go to Setup, search for Outbound Messages in Quick Find, and click New Outbound Message

  2. Select Contact as the object and click Next

  3. Fill in the outbound message details:

    • Name: Klaviyo Contact Consent Events Webhook
    • Unique Name: Klaviyo_Contact_Consent_Events_Webhook
    • Endpoint URL: provided by Solvative
    • User to Send As: your admin username
  4. Under Contact fields to send, select: Email, Id, Phone, your email consent field, and your SMS consent field

  5. Click Save, then Done

Part B: Create the flow

  1. Go to Setup → Process Automation → Flows and click New Flow

  2. Select Record-Triggered Flow and click Create

  3. Click Add Object and select Contact

  4. Under Configure Trigger, select A record is created or updated

  5. Under Set Entry Conditions, set Condition Requirements to Formula Evaluates to True

  6. Paste the following formula into the formula box:

    AND(
      NOT(ISBLANK({!$Record.Email})),
      OR(
        AND(ISCHANGED({!$Record.HasOptedOutOfEmail}), {!$Record.HasOptedOutOfEmail} = TRUE),
        AND(ISCHANGED({!$Record.SMS_Opt_Out__c}), {!$Record.SMS_Opt_Out__c} = FALSE)
      )
    )
    

Note: HasOptedOutOfEmail and SMS_Opt_Out__c above are just examples. They are not real field names you need to use. Replace both with your own org's actual email and SMS consent field API names, the same ones you enter in Consent Field Mapping. Do this in the formula above and in the field list in Part A, step 4.

Note: If you don't use an SMS consent field, remove the SMS line and its OR wrapper from the formula, so only the email check is left, and leave the SMS field out of the field list in Part A.

Note: The formula above assumes an SMS opt-in field, so it fires when the box is cleared (= FALSE). If your SMS consent field is an opt-out field, use = TRUE for that field instead, the same way the email field is written.

  1. Under When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements
  2. Under Optimize the Flow for, select Actions and Related Records, then click Done
  3. Click the + under the trigger, choose Action, search for Klaviyo Contact Consent Events Webhook under Outbound Message, and select it
  4. Set the Label to Send Contact Consent to Klaviyo and click Done
  5. Click Save and name the flow Klaviyo Contact Consent Events Flow
  6. Click Activate

3.3 Lead Consent Events (optional, only if you use Lead Sync and Consent Sync)

Skip this section unless you sync both Leads and consent. It is the same flow as 3.2, set up on the Lead object, so Lead consent changes reach the integration in real time too.

  1. Repeat Part A and Part B from 3.2, but select Lead instead of Contact as the object
  2. Name the outbound message Klaviyo Lead Consent Events Webhook (unique name Klaviyo_Lead_Consent_Events_Webhook) and the flow Klaviyo Lead Consent Events Flow
  3. Use the same formula structure as 3.2, with your own email and SMS consent field API names in place of the example ones, as long as those fields also exist on Lead (see Section 2.1 and 2.2)
  4. Under Lead fields to send, select: Email, Id, Phone, your email consent field, and your SMS consent field
  5. Save, activate, and finish the same way as 3.2

Note: Endpoint URLs and secret tokens for all outbound messages will be provided by Solvative. Don't save the outbound messages until you have those values.


Section 4: Connect the Integration

Once Sections 1 to 3 are done, you're ready to activate the integration.

  1. Open the integration app at the URL provided by Solvative

  2. Sign in, or accept your invite email if it's your first login. Invite links expire after 7 days. Contact Solvative if yours has expired.

  3. Click Connect Salesforce:

    • You'll be redirected to the Salesforce login page
    • Log in with the credentials for the Salesforce account you want to connect
    • Approve the OAuth authorization in Salesforce
  4. Click Connect Klaviyo and approve all requested scopes. The integration needs access to profiles, events, subscriptions and metrics.

  5. On the Configure Mapping screen:

    • (Optional) Set an Organization Mapping Id. This is only needed if more than one Salesforce org will sync into the same Klaviyo account. If you only have one org, leave it blank. It becomes a prefix on every Klaviyo profile property this org syncs, so you can tell which org the data came from. It locks once you set it, or once you finish onboarding, whichever comes first, even if you left it blank.
    • Under Consent Field Mapping, enter the API name of your email consent field (required) and your SMS consent field (optional), then click Verify and Save. See Section 2 for which fields to use.
    • Pick any extra Salesforce fields you want synced to Klaviyo, beyond the ones the integration always sends. You can change these any time later in Organization Settings.
  6. (Optional) Run the Backfill, a one-time import of your existing Contacts, Leads and Cases into Klaviyo. It can only be run once. If you skip it now, you can start it later from Organization Settings. Choose what to import with the toggles on this screen:

    • Contacts are always included. Use the dropdown on the Contact sync row to choose how far back to import Contacts and Leads, based on when each record was last modified: the last 180 days (the default), the last 365 days, or All records. The dropdown covers both created and edited records inside that window. All records skips the date filter, so every Contact and Lead that passes your other filters is imported. That can take a while on a large org.
    • Turn on Leads if you want existing Leads imported
    • Turn on Cases if you want case history imported, and pick how far back to go (30, 90 or 180 days)
    • Turn on Consent if you want consent imported as well
    • Turn on the opted-in only filter if you only want to import Contacts and Leads who are already opted in to email

    Then click Start Backfill, or Skip for now.

Important: The toggles on the Backfill screen only apply to this one-time import. They don't turn on the regular, ongoing sync. To choose which syncs keep running after setup (Leads, Cases, Consent), open Organization Settings and go to Sync Settings. You can reach it from the user menu at the top right, or from the Manage individual syncs link on the dashboard. Change them there any time.

Important: Do not delete the webhook endpoint that gets created automatically in Klaviyo during setup. Deleting it will break real time consent and event sync.


Section 5: How Consent Works

A few rules you should know before the integration goes live:

  • If a Contact or Lead opts out in either Salesforce or Klaviyo, the opt-out automatically syncs to the other platform
  • Opt-outs are processed immediately, there is no delay
  • The system will never automatically re-subscribe someone. Opt-ins must come from an explicit user action
  • Every consent change is logged in an audit trail that cannot be edited or deleted
  • By default, if both platforms receive a consent change at the same time, the most recent one wins. If you want one platform to always win instead, set a Consent Source of Truth (Salesforce or Klaviyo) in the integration settings

Important: Never manually override an opt-out in either system without documented proof of re-consent from the customer.


Section 6: Troubleshooting

Case events not appearing in Klaviyo

Open Setup → Process Automation → Flows and confirm the Case Events flow shows as Active. Test by editing a Case record and checking whether the outbound message is sent. You can see delivery status under Setup → Outbound Messages.

Consent changes not syncing

Confirm the relevant Consent Events flow (Contact or Lead) is Active. Double check that the consent field API names in the flow's entry formula exactly match the ones entered in Consent Field Mapping.

Sync fails with an invalid field error on MailingCountryCode or CountryCode

This means State and Country/Territory Picklists are not enabled in your Salesforce org. Enable them (see Section 1), then retry.

Outbound Message delivery failures

Confirm the endpoint URL and secret token in all outbound messages match the values Solvative provided. Endpoint URLs are environment specific.


Need Help?

Contact the Solvative project team for any setup or activation issues:

Email: support@solvative.com

Web: www.solvative.com

For Klaviyo specific questions, refer to help.klaviyo.com.

© 2026 Solvative. All rights reserved.