Articles on: Integrations

Klaviyo Advanced: Set up Klaviyo Flow Metrics and Triggers

Plans: Pro, Premium, Enterprise, and API users. Metric availability varies across plans Platforms: All platforms


Overview


The AfterShip & Klaviyo integration allows you to trigger personalized notifications based on shipment and order events. This helps you send timely and relevant notifications to customers throughout their post-purchase journey.


What you’ll learn


In this tutorial, we’ll discuss



Create a flow metric


Here’s how you can set up a basic post-purchase flow:


  1. Navigate to the Flows tab.
  2. Click Create Flow.



  1. Choose Create from Scratch.
  2. Select a metric to trigger the flow.



If you see duplicate metrics, it's because you have both Basic and Advanced integrations. Learn more about the differences here.


Pre-built flows


Once your AfterShip Tracking account is successfully connected to Klaviyo, a set of pre-built flows will be automatically available in your Klaviyo account. If you do not want to build your own flow, directly use these pre-built flows and customize them as needed.


These flows are designed to help you quickly notify customers about key shipment updates, such as in transit, out for delivery, delivered, and more.



Set up trigger filters


You can use trigger filters to narrow the scope and target only a subset of the shipments. Refer to the steps below for setting up the trigger filter:


  1. On the flow editor, navigate to the Trigger tab.
  2. Click Trigger Filters.
  3. Choose the event that you need to narrow down the scope.



Add a trigger split


A trigger split, part of the Visual Flow Builder, divides a flow into two paths based on the filter applied to the flow trigger. Follow these steps to add a trigger split:


  1. On the flow editor, navigate to the Trigger tab.
  2. Drag the Trigger Split from the left-hand side panel.



  1. Select the event that you want to split the flow.


Required API resources for metrics


Metrics

Trigger logic

Required resources

Resource location

AfterShip: Pre-ship - Order confirmation

AfterShip sends the event info to Klaviyo when an order is imported.

orders.source_created_at is not null.

Commerce API

orders.status is “open”

AfterShip: Pre-ship - Fulfillment stalled

AfterShip sends the event info to Klaviyo if an order remains unfulfilled for X days.

orders.fulfillment_status is “unfulfilled”

Commerce API

AfterShip: Pre-ship - Fulfilled partial order

AfterShip sends the event info to Klaviyo upon creation of a new fulfillment under an order.

shipments.source_created_at is not null.

Commerce API

orders.fulfillment_status is “partially_fulfilled”

AfterShip: Delivery summary - All Items fulfilled

AfterShip sends the event info to Klaviyo when the order’s fulfillment status turns “Fulfilled”.

shipments.source_created_at is not null.

Commerce API

orders.fulfillment_status is “fulfilled”

Commerce API

AfterShip: Delivery summary - All Items Delivered

AfterShip notifies Klaviyo when all items in an order are delivered.

orders.fulfillment_status is “fulfilled”

Commerce API

tracking.shipment_delivery_date is not null

Courier

AfterShip: Delivery updates - "Info received," "In transit," "Out for delivery," "Available for pick up," "Delivered"

AfterShip sends the event info to Klaviyo immediately upon receiving shipment status updates, triggered by events received from couriers.

tracking.checkpoints.date_time is not null

Courier

AfterShip: Delivery exceptions - "General exception," "Returning to sender," "Returned to sender," "Failed attempt"

AfterShip sends the event info to Klaviyo immediately upon receiving shipment status updates, triggered by events received from couriers.

tracking.checkpoints.date_time is not null

Courier

AfterShip: Delivery exceptions - Shipments stalled

AfterShip alerts Klaviyo if a shipment remains stagnant for X days.

Courier

AfterShip: EDD - Delivery anticipation

AfterShip notifies Klaviyo 24 hours before Estimated Delivery Date (EDD).

tracking.latest_estimated_delivery is not null

Courier

AfterShip: EDD - EDD revised

AfterShip sends the event info to Klaviyo when the latest_estimated_delivery date updates.

tracking.latest_estimated_delivery is not null

Courier

tracking.tag is not “pending”, “expired”, “delivered”

AfterShip: EDD - EDD missed

AfterShip notifies Klaviyo when the latest_estimated_delivery is missed, meaning the Estimated time of arrival has expired. (If the latest estimated delivery is a range, AfterShip compares using the maximum value.)

tracking.latest_estimated_delivery is not null

Courier

tracking.tag is not “pending”, “expired”, “delivered”


Skip Historical events


To ensure timely and relevant messaging, AfterShip refrains from sending historical events to Klaviyo for certain occurrences. Historical events, defined as those transpiring 36-72 hours ago, are excluded to prevent shoppers from receiving outdated notifications.


For instance, if a delivery event is passed to AfterShip by the carrier and it occurred more than 72 hours ago from the moment AfterShip receives it, the event will not be forwarded to Klaviyo, ensuring notifications are current and accurate.


The table below outlines the logic governing the historical window for each event.


Metrics

Skip logic

AfterShip: Pre-ship - Order confirmation

AfterShip sends the event info to Klaviyo upon Order import with the condition that the order has been placed within the last 72 hours.

AfterShip: Pre-ship - Fulfilled partial order

AfterShip sends the event info to Klaviyo when there is a new fulfillment created under an order. Notifications are excluded if shipment import occurs more than 72 hours after order fulfillment.

AfterShip: Delivery summary - All Items fulfilled

AfterShip sends the event info to Klaviyo when an order’s fulfillment status turns “Fulfilled”. Notifications are excluded if shipment import occurs more than 72 hours after order fulfillment.

AfterShip: Delivery summary - All Items Delivered

AfterShip sends the event info to Klaviyo when an order’s all shipments get delivered. Notifications are excluded if shipment import occurs more than 72 hours after order fulfillment.

AfterShip: Delivery updates - "Info received," "AfterShip: Delivery updates - In transit," "AfterShip: Delivery updates - Delivered," "AfterShip: Delivery exceptions - Returning to sender," "AfterShip: Delivery exceptions - Returned to sender"

AfterShip sends the event info to Klaviyo when the courier passes events to AfterShip, provided the event occurred within the last 72 hours. Notifications are excluded if shipment import exceeds 72 hours after the event.

AfterShip: Delivery updates - "Out for delivery," "AfterShip: Delivery updates - Available for pick up," "AfterShip: Delivery exceptions - General exception," "AfterShip: Delivery exceptions - Failed attempt"

AfterShip sends the event info to Klaviyo when the courier passes events to AfterShip, provided the event occurred within the last 36 hours. Notifications are excluded if shipment import exceeds 36 hours after the event


Understanding Stalled metrics


For FulfillmentStalled and ShipmentStalled, the default stalled timeframe is set to 72 hours. You can adjust this in the configuration panel at any time. It's essential to note that changes are not retroactive and apply only to new orders placed after updating settings.


The "Stalled" flag is not a real-time status. It gets added to an order once the stalled criteria are met and is not removed thereafter.


ShipmentStalled triggers notifications for a shipment without updates within the specified timeframe, regardless of its current status. To restrict this trigger to a specific status, choose the relevant status during configuration.


Step to configure stalled timeframe


  1. Navigate to Apps.
  2. Locate your Klaviyo integration.
  3. Click Settings.


Here you can customize your Stalled timeframe:



Understanding trigger frequency


Notifications are generally triggered once for most metrics. However, specific metrics have exceptions, resulting in multiple notifications sent out at a frequency of 24 hours. Here's a breakdown:


Metrics with 24-Hour Trigger Frequency:


  • AfterShip: Delivery updates - Out for delivery
  • AfterShip: Delivery exceptions - General exception
  • AfterShip: Delivery exceptions - Failed attempt
  • AfterShip: EDD - Delivery anticipation
  • AfterShip: EDD - EDD revised
  • AfterShip: EDD - EDD missed


Additional resources



If you have any queries, feel free to connect with our support team for quick assistance.


Updated on: 10/05/2026