How to Sync Purchase Data to Klaviyo for Personalization

Push detailed purchase data to Klaviyo for highly personalized email campaigns.

What This Integration Does

Klaviyo can do real personalization, but only if it knows what your customers actually buy. This workflow takes every new order from your store and pushes it into Klaviyo two ways: as a structured create-event so flows can trigger on it, and as updates to running totals on the profile so segments can read them. The result is "customers who bought from category X in the last 30 days" becomes a one-click segment.

The flow is webhook-driven for low latency: an order in the store turns into a Klaviyo event within seconds. Profile updates are running totals (lifetime value, top categories, last purchase date), so they evolve over time without needing a full recompute. Re-runs are safe because Klaviyo deduplicates events by unique_id.

Prerequisites

  • A Klaviyo connection with profile read/write and event write access.
  • A Shopify or WooCommerce connection with order read access.
  • A registered order webhook endpoint in your store.
  • Agreed names for the Klaviyo event (e.g. Order Placed) and custom properties.

Step 1: Webhook Trigger on New Order

Add a Trigger node set to Webhook. Register the URL as the order/create webhook in Shopify, or order.created in WooCommerce. The trigger fires once per order.

Step 2: Fetch Full Order Detail

Add a Connector node on shopify with the get-order tool (or woocommerce get-order). This returns the full line item array, including product titles, categories, and per-line totals - everything personalization needs.

Step 3: Transform - Extract Personalization Signals

Add a Transform node that produces:

{
  "email": order.customer.email,
  "orderId": order.id,
  "orderTotal": order.totalPrice,
  "orderCurrency": order.currency,
  "lineItems": [
    { "productId": ..., "title": ..., "category": ..., "price": ..., "quantity": ... }
  ],
  "categories": uniqueCategories(order.lineItems),
  "brands": uniqueBrands(order.lineItems),
  "priceBand": bucket(order.totalPrice)
}

The derived fields (categories, brands, priceBand) are what makes segmentation cheap later.

Step 4: Push a Klaviyo Event

Add a Connector node on klaviyo with the create-event tool. Send:

  • metric: Order Placed
  • profile: { "email": "{{ order.customer.email }}" }
  • properties: the Transform output
  • unique_id: {{ order.id }} - this is what makes re-deliveries idempotent
  • time: {{ order.createdAt }}

Step 5: Look Up the Klaviyo Profile

Add a Connector node on klaviyo using list-profiles filtered by email, so you have the profile id and current running totals.

Step 6: Update Profile with Running Totals

Add a Connector node on klaviyo using update-profile with the profile id from Step 5. Set:

  • lifetime_value: previous value + {{ orderTotal }}
  • order_count: previous + 1
  • last_order_at: {{ order.createdAt }}
  • top_categories: merge of previous and current order categories, keep top 5
  • favorite_brand: most-frequent brand across orders

These properties make Klaviyo segments like "spent more than $500 in the last 90 days and bought from outdoor category" trivial.

Tips

  • Use the same event name (Order Placed) Klaviyo's built-in integrations use - templates and analytics already understand it.
  • Cap top_categories at five entries so the property stays readable.
  • For high-volume stores, batch profile updates - one update-profile per profile per minute is far easier on Klaviyo's rate limits than per-event.

Common Pitfalls

  • Refunds and cancellations - if you do not handle them, lifetime value drifts upward forever. Listen on order/refund and order/cancel webhooks too, and decrement.
  • Currency mixing - if you sell in multiple currencies, normalize orderTotal to one base currency before summing into lifetime value.
  • Guest checkouts - some stores create a guest customer per order. De-duplicate by email before updating profile totals.

Testing

Place a test order in your store with your own email. Check Klaviyo for the Order Placed event under your profile and confirm the custom properties on the profile reflect the new totals. Place a second test order and verify totals increment correctly.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.