Klaviyo x Tweakwise

This integration allows you to leverage Klaviyo's profile and segment data within Tweakwise to personalize lister pages and product recommendations. By connecting these platforms, you can transform customer behavior captured in your CDP into targeted merchandising strategies.

In Klaviyo, products are linked to Events rather than stored as a static list directly on the user profile. This architectural distinction affects how product data is retrieved for both lister pages and recommendations.

Klaviyo on lister pages

You can use a CDP to personalize lister pages via the Tweakwise External Data Component. This component requests a list of product IDs specific to the user.

  • The process: Since Klaviyo does not store static product lists on profiles, your middleware must fetch the customer’s timeline and filter for actions like Viewed Product or Ordered Product.
  • Technical setup: Your function processes these events and returns a clean list of IDs to the External Data Component, which Tweakwise then uses to populate the lister page.

Klaviyo in Recommendations

Directly fetching a list of article numbers from a CDP for recommendations can be counterproductive (if it's available), as it bypasses the Tweakwise rule engine. To get the "best of both worlds," we recommend "weaponizing" CDP segments by turning them into Tweakwise rules.

The Strategy:

  • Configure in Tweakwise: Create a recommendation group with a specific key for each segment (e.g., GroupKey = "segment-vip").
  • Retrieve Segment: On the platform side, fetch the current user's segment from the CDP (using the Klaviyo Profiles API or Deployteq Datamodel API).
  • Request Recommendation: Call the Tweakwise Recommendations API using the retrieved segment name as the GroupKey.
  • Fallback: Always configure a generic recommendation (e.g., "Trending") if no segment is found for the user.

This method uses the CDP for audience intelligence while letting the Tweakwise rule engine handle product selection, stock logic, and sorting.

Retrieving Customer Segments

To find a customer's segments using their email address, follow these steps:

  • Step 1: Get Profile ID: Call GET /api/profiles/?filter=equals(email,"[[email protected]](mailto:[email protected])") to find the unique ID.
  • Step 2: Get Segments: Use the ID to call GET /api/profiles/\{profile_id\}/segments/.
  • Step 3: Process Data: Iterate through the response. Use attributes.name to identify active segments (e.g primary-segment) and use them in the next step.

Example

Imagine a fashion webshop, here is how we apply this when a user is viewing a coat product detail page:

  • Klaviyo identifies a customer as part of the "High-Spend Winter" segment because they buy expensive coats every year.
  • Your website/middleware retrieves the segment as High Spend Winter and maps this to the recommendation groupkey segment-winter-luxury.
  • The website/middleware calls Tweakwise using the groupKey:
    /recommen/{instancekey}/{productid}/segment-winter-luxury
  • Tweakwise only shows products from the "Coats" category with a price > €200, applying the merchandising rules that are configured in Tweakwise.

Important Considerations

  • Scalability: This approach is manageable depending on the number of segments. You must create recommendation rules for each segment you wish to target.
  • Event-Based Architecture: Remember that Klaviyo is event-driven. You cannot "GET" a list of products from a profile; you must reconstruct that list from their timeline events.
  • API Versioning: Klaviyo requires a revision header (e.g., 2024-10-15). Using an outdated or missing revision date will cause your API calls to fail.
  • Rate Limiting: Ensure your middleware function handles Klaviyo’s API rate limits to avoid performance bottlenecks on your lister pages.
  • Middleware Performance: Ensure your middleware is optimized to prevent latency, as the External Data Component relies on these external calls.

Frequently Asked Questions

Why should I use segments instead of a product list from the CDP?
If you only pull a list of IDs, you lose the ability to apply the Tweakwise rule engine (and merchandising rules, like boosting high-margin products). Using segments as rules keeps your merchandising dynamic.

What happens if the API call to the CDP fails?
Your implementation should always include a fallback recommendation. If the CDP is unreachable or the user is unknown, Tweakwise should default to a standard algorithm like "Most Popular" to ensure the user never sees an empty block. This can also be done in Tweakwise configuration by configuring a fallback recommendation on the same group.