Skip to main content

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 :-)

Be the first to reply!

Reply