The Klaviyo integration for WooCommerce covers the basics well: viewed products, started checkouts, placed orders. For a typical retail store, that’s enough to run a welcome series, an abandoned cart flow and a post-purchase sequence.
For B2B stores, wholesale catalogs and stores with complex inventory, it’s often not enough. The moments that matter most in those businesses aren’t standard checkout events. Someone requests a quote. A wholesale account gets approved. A customer who reorders the same part every six weeks hasn’t ordered in eight. An order ships from the warehouse system, not from WooCommerce.
Klaviyo knows nothing about any of that unless you tell it. That’s what custom events are for. This guide covers when you need them, how to design them so they’re useful in flows and segments, and how to send them from WooCommerce without losing or duplicating events.
What the native integration usually misses#
Here are the events we most often add for B2B and inventory-heavy stores:
| Event | Where it comes from | What it powers in Klaviyo |
|---|---|---|
| Requested Quote | A quote form or “request a price” button | Quote follow-up flow, sales alert, segment of open quotes |
| Wholesale Account Approved | Admin approval in WooCommerce or a B2B plugin | B2B welcome series with ordering instructions and terms |
| Reorder Due | A scheduled job based on order history | Reorder reminders for consumables and parts |
| Order Shipped (with tracking) | Your ERP, inventory system or 3PL | Shipping updates with real tracking numbers |
| Invoice Due / Payment Overdue | Accounting or ERP for net-terms customers | Polite reminders, without a person chasing each one |
| Phone or Offline Order | Orders entered by your sales team elsewhere | Keeps post-purchase flows and segments accurate |
| Registered Product | A warranty or product registration form | Maintenance tips, accessory recommendations |
Not every store needs all of these. Start with the one that’s tied to the most revenue, which for most B2B stores is the quote request.
Events or profile properties?#
Before you build anything, decide what kind of data you’re sending. Klaviyo has two places for it:
- Events are things that happen at a point in time: requested a quote, account approved, order shipped. They can trigger flows, and you can segment on them (“requested a quote in the last 30 days”).
- Profile properties describe the customer’s current state: account type is wholesale, sales rep is Ana, price tier is B. They’re for filtering and personalizing, not for starting flows.
A common mistake is to send everything as profile properties because they’re simpler. Then you discover that a property change can’t start a flow the way an event can. If something should trigger an email, make it an event. If it describes who the customer is, make it a property. Often you’ll want both: an “Account Approved” event plus an “Account Type: Wholesale” property.
Designing events that are actually useful#
Events are hard to rename or clean up once flows and segments depend on them. A few rules save a lot of trouble later:
- Name them as past-tense actions. “Requested Quote,” not “quote” or “quote_form_submit_v2.” Your marketing team will read these names every day.
- One metric per action. Don’t send “Account Event” with a type property. Send “Account Approved” and “Account Rejected” as separate metrics. Flows trigger on metrics, so this makes them much simpler.
- Keep properties flat and readable. “Product Category,” “Quantity,” “Estimated Value.” Simple values are easy to use in segments and flow filters. Deeply nested data is hard to use anywhere except inside an email template.
- Include a value when there is one. Klaviyo uses the event value for revenue reporting. A quote with an estimated value of $12,000 is very different from one for $80.
- Send only what you’ll use. Don’t copy the whole order record into every event. Every field you send is personal data you’re now storing in another system.
The request#
Server-side events go to Klaviyo’s Create Event endpoint with your private API key. A request looks like this (based on Klaviyo’s Events API documentation):
POST https://a.klaviyo.com/api/events/
Authorization: Klaviyo-API-Key YOUR_PRIVATE_KEY
revision: 2024-10-15
Content-Type: application/json
{
"data": {
"type": "event",
"attributes": {
"metric": { "data": { "type": "metric", "attributes": { "name": "Requested Quote" } } },
"profile": { "data": { "type": "profile", "attributes": { "email": "buyer@example.com" } } },
"properties": {
"Quote ID": "Q-10482",
"Product Category": "Excavator Attachments",
"Items": ["Hydraulic Thumb 36in", "Quick Coupler"],
"Company": "Gulf Coast Site Works"
},
"value": 12400,
"value_currency": "USD",
"time": "2026-11-12T15:04:00+00:00",
"unique_id": "quote-Q-10482-requested"
}
}
}
Use the current API revision from Klaviyo’s docs when you build. The revision header pins the request format, so your integration doesn’t break when Klaviyo changes the API.
There’s also a client-side endpoint that uses your public key and runs in the browser. It’s fine for simple things like “Viewed Category,” but anything tied to money, accounts or orders should be sent from your server. You can trust server-side data, and browser events can be blocked by ad blockers and consent tools.
The gotcha that loses events: deduplication#
This catches a lot of developers. Klaviyo’s documentation says that if you create several events for the same profile with the same metric and the same timestamp (or no timestamp at all), only one is processed and the rest are discarded as duplicates.
That sounds harmless until a customer requests two quotes within the same second, or a backfill script sends a batch of historical events without timestamps. Events silently disappear. One developer in Klaviyo’s community hit exactly this, and the fix was the same one we use on every project:
- Always set
unique_id, built from your own data: the quote ID, order ID or invoice ID plus the event type. For example,quote-Q-10482-requested. - Always set
timeto when the thing actually happened, not when you sent it.
A stable unique_id also works in your favor: if your queue retries a request that actually succeeded, the retry won’t create a second event.
Sending events from WooCommerce reliably#
Pick the right hook
Fire the event where the action really happens:
- Order status changes:
woocommerce_order_status_changed. - Quote and registration forms: the submission hook of your form plugin, or your own form handler.
- Account approvals: the hook your B2B plugin fires on approval, or
updated_user_metawhen the approval flag changes. - Events from other systems (ERP, inventory, 3PL): a webhook endpoint that receives the update and queues the Klaviyo event.
Never call Klaviyo in the middle of a customer request
If you call the API directly while the customer is submitting a form or placing an order, a slow or failing API makes your site slow or failing too. Push the event to a background queue instead. WooCommerce already ships with Action Scheduler, so you don’t need anything extra.
Retry, and log what fails
APIs fail sometimes. Klaviyo can return rate-limit errors (429) under load, and networks drop requests. Retry on 429 and 5xx errors with increasing delays. Don’t retry on 400-level validation errors: those won’t fix themselves, so log them and alert someone.
A minimal example
Here’s the shape of it in PHP: queue the event when a quote is submitted, then send it in the background with retries. Adapt it to your form plugin and test it on staging first.
// 1. Queue the event when a quote is submitted (call this from your form handler).
function ef_queue_quote_event( $quote_id, $email, $category, $items, $value ) {
as_enqueue_async_action( 'ef_send_klaviyo_event', [ [
'metric' => 'Requested Quote',
'email' => $email,
'unique_id' => 'quote-' . $quote_id . '-requested',
'time' => gmdate( 'c' ),
'value' => (float) $value,
'properties' => [
'Quote ID' => (string) $quote_id,
'Product Category' => $category,
'Items' => array_values( $items ),
],
'attempt' => 1,
] ], 'klaviyo' );
}
// 2. Send it in the background, retrying on rate limits and server errors.
add_action( 'ef_send_klaviyo_event', function ( $event ) {
$response = wp_remote_post( 'https://a.klaviyo.com/api/events/', [
'timeout' => 10,
'headers' => [
'Authorization' => 'Klaviyo-API-Key ' . KLAVIYO_PRIVATE_KEY,
'revision' => '2024-10-15',
'Content-Type' => 'application/json',
],
'body' => wp_json_encode( [ 'data' => [
'type' => 'event',
'attributes' => [
'metric' => [ 'data' => [ 'type' => 'metric', 'attributes' => [ 'name' => $event['metric'] ] ] ],
'profile' => [ 'data' => [ 'type' => 'profile', 'attributes' => [ 'email' => $event['email'] ] ] ],
'properties' => $event['properties'],
'value' => $event['value'],
'value_currency' => 'USD',
'time' => $event['time'],
'unique_id' => $event['unique_id'],
],
] ] ),
] );
$code = is_wp_error( $response ) ? 0 : (int) wp_remote_retrieve_response_code( $response );
if ( $code >= 200 && $code < 300 ) {
return; // Sent.
}
$retryable = ( 0 === $code || 429 === $code || $code >= 500 );
if ( $retryable && $event['attempt'] < 5 ) {
$delay = 60 * ( 2 ** ( $event['attempt'] - 1 ) ); // 1, 2, 4, 8 minutes.
$event['attempt']++;
as_schedule_single_action( time() + $delay, 'ef_send_klaviyo_event', [ $event ], 'klaviyo' );
return;
}
// Not retryable, or out of attempts: log it so someone can look.
wc_get_logger()->error(
sprintf( 'Klaviyo event failed (%d): %s', $code, $event['unique_id'] ),
[ 'source' => 'klaviyo-events' ]
);
} );
A few notes on this example:
- The private key is read from a constant. Define it in
wp-config.php, never in the theme. - The
unique_idcomes from the quote ID, so retries can’t create duplicates. - Failures land in WooCommerce → Status → Logs under
klaviyo-events, and you can see queued and failed actions under Tools → Scheduled Actions.
Backfilling history#
When you add a new event, you can often send past data too, such as quote requests from the last 12 months. That way segments like “requested a quote but never ordered” are useful from day one.
- Set
timeto the original date of each event. Without it, every event gets today’s date and the duplicates problem above kicks in. - Use the bulk endpoint for large backfills. Klaviyo allows up to 1,000 events per request and a 5 MB payload.
- Before you backfill, turn off any flow triggered by that event, or set it to manual. Otherwise customers get a “thanks for your quote request” email about a quote from last March.
Testing before you build flows#
- Send a test event to your own profile.
- Find the new metric in Klaviyo under Analytics → Metrics and open the event. Check that every property and the value look right.
- Build a segment with it, such as “Requested Quote at least once in the last 30 days,” and confirm your test profile appears.
- Build the flow with emails set to Manual first. Trigger a few test events and check who enters and why.
- Only then switch the emails to Live.
Where to go from here#
Custom events are usually one part of a bigger integration. If the same data also needs to reach your inventory system or ERP, it’s worth designing them together, so a quote, an order and a shipment carry the same IDs everywhere. Our guide to WooCommerce and Zoho Inventory sync architecture covers queues and retries in more depth. For events the integration should send but doesn’t, start with why Started Checkout events go missing, and for late or duplicate events, see Klaviyo webhook troubleshooting.
Need custom events built?#
We design and build custom Klaviyo events for WooCommerce and Shopify stores, including events from ERPs, inventory systems and quote tools, with queues, retries and logging from the start. See our Klaviyo API integration work or talk to a developer.