Linking Klaviyo as a source

The Klaviyo connector syncs your marketing data – campaigns, profiles, events, flows, lists, and metrics – into PostHog, so you can analyze your email and marketing activity alongside your product data.

Prerequisites

You need a Klaviyo account and a private API key. Create one in your Klaviyo account settings by clicking Create Private API Key, giving it a name, and selecting a Read-Only Key. Grant read permissions for the following: Accounts, Campaigns, Events, Flows, Lists, Metrics, and Profiles.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

When linking Klaviyo, you'll need:

  • API key – the private API key you created in your Klaviyo account settings (starts with pk_).

Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

  • Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
  • Incremental – only new or updated rows are synced on each run, using a cursor field (such as an updated_at timestamp). Cheaper than a full refresh, but deletes aren't captured.
  • Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
  • Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See sync methods for a full explanation of how each mode works and how to choose between them.

The events table is append-only, since Klaviyo events are immutable. On the initial sync, only the last 365 days of events are imported.

The opt-in list_profiles table maps which profiles belong to which list as {list_id, profile_id, joined_group_at} rows. This is disabled by default, but can be toggled on in the schema configuration when setting up or editing your Klaviyo source. It supports incremental sync on joined_group_at (the datetime when the profile most recently joined the list). Incremental syncs only pick up new joins and re-joins, and will not account for profiles removed from a list. A full refresh is required if profiles need to be removed. Once synced, you can join it with your profiles table:

SQL
SELECT p.*
FROM klaviyo_profiles p
JOIN klaviyo_list_profiles lp ON lp.profile_id = p.id
WHERE lp.list_id = 'your_list_id'

Configuration

OptionTypeRequired
API keypasswordYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
email_campaigns

An email marketing campaign in Klaviyo sent to a target audience.

Incremental, Full refreshupdated_at, created_at
sms_campaigns

An SMS marketing campaign in Klaviyo sent to a target audience.

Incremental, Full refreshupdated_at, created_at
events

Only syncs the last 365 days on initial sync

Append only, Full refreshdatetime
flows

An automated flow in Klaviyo that sends messages based on triggers and conditions.

Incremental, Full refreshupdated, created
lists

A list of profiles in Klaviyo used to target campaigns and flows.

Incremental, Full refreshupdated, created
metrics

A metric in Klaviyo that defines a type of tracked event (e.g. Placed Order, Opened Email).

Incremental, Full refresh
profiles

A profile in Klaviyo representing a person you can message and track.

Incremental, Full refreshupdated, created
list_profiles

Maps which profiles belong to which list as {list_id, profile_id, joined_group_at} rows. Incremental syncs pick up new joins and re-joins; profiles removed from a list are only reflected on a full refresh

Incremental, Full refreshjoined_group_at

Troubleshooting

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Community questions

Was this page useful?

Questions about this page? or post a community question.