Skip to main content

Are you dependent on the checkout start event to show customers their basket in an email? No need to with this solution.


Christiannoerbjerg
Expert Problem Solver II
Forum|alt.badge.img+12

Imagine a world where you can guide your customers seamlessly back to their checkout with a single, personalized email. By leveraging webhooks in Klaviyo, you can achieve this—saving cart items and checkout URLs directly as properties on customer profiles. This innovative approach not only streamlines your email marketing but also enhances the customer experience. Let’s dive into how it works and why it’s a game-changer for your e-commerce strategy.

Why use webhooks to save cart items and checkout URLs?

Traditionally, abandoned checkout emails rely on the customer triggering an event, such as leaving their cart without completing a purchase. While effective, this approach has limitations—most notably, the delay in communication. With webhooks, you can save cart and checkout data in real time, enabling you to:

  • Send timely follow-ups: No need to wait for the abandoned checkout flow to trigger. Engage customers proactively.

  • Personalize at scale: Use Klaviyo’s person.lookup tag in campaigns and emails to dynamically pull cart contents and the exact checkout URL.

  • Enhance customer experience: Make it easy for customers to pick up where they left off with a single click.

How It Works

Step 1: Set up webhooks to capture cart data:

Using a webhook, you can capture key details about the customer’s cart and checkout session. These details, such as product names, quantities, and the checkout URL, are saved as properties on their Klaviyo profile.

Example payload: Save the checkout URL:

When a customer interacts with your store, your webhook can capture the checkout URL, like the following:

Header: https://a.klaviyo.com/api/profile-import

Authorization: Klaviyo-API-Key your-private-api-key

accept: application/vnd.api+json

Content-type: application/vnd.api+json

Revision: 2024-10-15

 

{
  "data": {
    "type": "profile",
    "attributes": {
      "properties": {
        "Checkout URL": "{{ event.extra.checkout_url|default:'' }}"
      },
      "email": "{{ person.email|default:'' }}"
    }
  }
}

 

Example payload: Save the customer cart: 

When a customer interacts with your store, your webhook can capture the checkout URL, like the following:

Header: https://a.klaviyo.com/api/profile-import

Authorization: Klaviyo-API-Key your-private-api-key

accept: application/vnd.api+json

Content-type: application/vnd.api+json

Revision: 2024-10-15

{
  "data": {
    "type": "profile",
    "attributes": {
      "properties": {
        "Produkt 1 name (Checkout)": "{{ event.Items.0|default:'' }}",
        "Produkt 1 Image (Checkout)": "{{ event.extra.line_items.0.product.images.0.src|default:'' }}",
        "Produkt 1 Brand (Checkout)": "{{ event.extra.line_items.0.product.vendor|default:'' }}"
      },
      "email": "{{ person.email|default:'' }}"
    }
  }
}

Hope that helps you get more revenue from your expiring carts :-)

Did this topic or the replies in the thread help you find an answer to your question?

3 replies

chloe.strange
Community Manager
Forum|alt.badge.img+41
  • Community Manager
  • 424 replies
  • December 26, 2024

@Christiannoerbjerg, thank you for sharing your insights with the community! 

~Chloe


talhahussain
Problem Solver IV
Forum|alt.badge.img+8
  • Problem Solver IV
  • 76 replies
  • December 27, 2024

Enhancing your e-commerce strategy by displaying customers' cart contents in emails without relying solely on the "Checkout Started" event is achievable through the use of webhooks in Klaviyo. Here's a streamlined approach:

1. Implement Webhooks to Capture Cart Data:

  • Set Up Webhooks: Configure webhooks to capture real-time cart details, including product names, quantities, and the checkout URL. This data is then stored as properties on the customer's profile in Klaviyo.

  • Example Payload for Checkout URL:

    { "data": { "type": "profile", "attributes": { "properties": { "Checkout URL": "{{ event.extra.checkout_url|default:'' }}" }, "email": "{{ person.email|default:'' }}" } } }

  • Example Payload for Cart Items:

    { "data": { "type": "profile", "attributes": { "properties": { "Product 1 Name": "{{ event.Items.0|default:'' }}", "Product 1 Image": "{{ event.extra.line_items.0.product.images.0.src|default:'' }}", "Product 1 Brand": "{{ event.extra.line_items.0.product.vendor|default:'' }}" }, "email": "{{ person.email|default:'' }}" } } }

2. Utilize Captured Data in Emails:

  • Dynamic Personalization: Incorporate the saved cart details into your email templates using Klaviyo’s person.lookup tag. This allows for dynamic insertion of cart contents and direct links back to the customer's checkout, enhancing personalization and user experience.

Benefits:

  • Timely Follow-Ups: Engage customers promptly without waiting for traditional abandoned cart triggers.

  • Enhanced Customer Experience: Provide a seamless path for customers to resume their shopping, potentially increasing conversion rates.

By implementing this webhook strategy, you can proactively display customers' baskets in emails, independent of the "Checkout Started" event, thereby improving engagement and sales opportunities.


Forum|alt.badge.img+1
  • Contributor III
  • 6 replies
  • February 7, 2025

Hi, there. Basically, I think a webhook is what I need. I’m putting together a simple campaign (‘newsletter’) email that would have generic/whatever content and then have a custom section in it that would only be visible (I’m assuming using show hide logic i.e. person|lookup:'cart_items_count' >0) if the recipient had something sitting in their cart, and if so, the section would be visible to them with a “Hey! You may have forgotten about these!” and a list of their items/pictures below and the quantity).

Is a webhook dependent on an app installed in your Klaviyo? If not, is there a resource you suggest on how to do this? Any suggestions would be awesome. Many thanks!