Klaviyo Advanced: Set up Klaviyo Flow Metrics and Triggers
Plans: Enterprise Standard, Enterprise Advanced, API users Platforms: All platforms
The AfterShip & Klaviyo Integration empowers users to trigger personalized notifications based on their order or shipment status.
In this tutorial, we’ll discuss
Create a flow metric
Set up trigger filters
Add a trigger split
AfterShip flow metric
Required API resources for metrics
Skip Historical events
Understanding Stalled metrics
Understanding trigger frequency
AfterShip flow trigger filters and splits
Here’s how you can set up a basic post-purchase flow:
Navigate to the Flows tab
Click Create Flow
Choose Create from Scratch
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.
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:
On the flow editor, navigate to the Trigger tab
Click Trigger Filters
Choose the event that you need to narrow down the scope
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:
On the flow editor, navigate to the Trigger tab
Drag the Trigger Split from the left-hand side panel
Select the event that you want to split the flow
With an active AfterShip integration in your Klaviyo account, you can unlock these event metrics for Flows:
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.
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
Navigate to Apps
Locate your Klaviyo integration
Click Settings
Here you can customize your Stalled timeframe.
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
If you have any queries, feel free to connect with our support team for quick assistance.
Overview
The AfterShip & Klaviyo Integration empowers users to trigger personalized notifications based on their order or shipment status.
What you’ll learn
In this tutorial, we’ll discuss
Create a flow metric
Set up trigger filters
Add a trigger split
AfterShip flow metric
Required API resources for metrics
Skip Historical events
Understanding Stalled metrics
Understanding trigger frequency
AfterShip flow trigger filters and splits
Create a flow metric
Here’s how you can set up a basic post-purchase flow:
Navigate to the Flows tab
Click Create Flow
Choose Create from Scratch
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.
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:
On the flow editor, navigate to the Trigger tab
Click Trigger Filters
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:
On the flow editor, navigate to the Trigger tab
Drag the Trigger Split from the left-hand side panel
Select the event that you want to split the flow
AfterShip flow metric
With an active AfterShip integration in your Klaviyo account, you can unlock these event metrics for Flows:
Category | Metrics | Description | Plan |
---|---|---|---|
Pre-ship | AfterShip: Pre-ship - Order confirmation | Notifies when an order is confirmed. | All plans |
Pre-ship | AfterShip: Pre-ship - Fulfillment stalled | Alerts about an order that has been created and remained unfulfilled for X days. | Enterprise plan |
Pre-ship | AfterShip: Pre-ship - Fulfilled partial order | Indicates partial order fulfillment (There will be separate notifications for each partial fulfillment. | Enterprise plan |
Delivery summary | AfterShip: Delivery summary - All Items fulfilled | Notifies when all items in an order have been shipped. | Enterprise plan |
Delivery summary | AfterShip: Delivery summary - All Items Delivered | Notifies when all shipments in an order have been delivered. | Enterprise plan |
Delivery updates | AfterShip: Delivery updates - Info received | Notifies when a package has been shipped and is ready for courier pickup | All plans |
Delivery updates | AfterShip: Delivery updates - In transit | Notifies when a package is in transit to the customer. | All plans |
Delivery updates | AfterShip: Delivery updates - Out for delivery | Notifies about a shipment that's out for delivery. | All plans |
Delivery updates | AfterShip: Delivery updates - Available for pick up | Notifies about a shipment available for pick up at a designated point. | All plans |
Delivery updates | AfterShip: Delivery updates - Delivered | Notifies when a shipment is delivered to the destination. | All plans |
Delivery exceptions | AfterShip: Delivery exceptions - General exception | Notifies about a package in an exception status (lost, custom delay, general delay, damaged, etc., excluding returning to sender or returned to sender). | All plans |
Delivery exceptions | AfterShip: Delivery exceptions - Returning to sender | Notifies when a package is returning to sender. | All plans |
Delivery exceptions | AfterShip: Delivery exceptions - Returned to sender | Notifies when a package has been returned to sender. | All plans |
Delivery exceptions | AfterShip: Delivery exceptions - Failed attempt | Indicates a courier's unsuccessful delivery attempt. | All plans |
Delivery exceptions | AfterShip: Delivery exceptions - Shipments stalled | Notifies about a shipment with no updates for X days, regardless of its current status. | Enterprise plan |
EDD related | AfterShip: EDD - Delivery anticipation | Notifies about a shipment scheduled to arrive the next day. | Enterprise plan |
EDD related | AfterShip: EDD - EDD revised | Notifies when a shipment’s latest estimated delivery date changes. | Enterprise plan |
EDD related | AfterShip: EDD - EDD missed | Notifies when a shipment’s latest estimated delivery date is missed. | Enterprise plan |
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
Navigate to Apps
Locate your Klaviyo integration
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
AfterShip flow trigger filters and splits
1. General fields
Category | Trigger Filters & Splits | Description |
---|---|---|
STORE | StoreName | The name of your store. |
STORE | StoreURL | The URL of your store that is sourced from the AfterShip organization setting. |
COURIER | CourierName | The name of the courier. |
COURIER | CourierSlug | The name of the courier slug. |
COURIER | CourierContact | Contact information of the courier. |
COURIER | CourierWebURL | The courier’s website. |
COURIER | CourierRedirectURL | URL where the customer can redirect their parcel. |
COURIER | CourierTrackingURL | The courier's tracking page URL. |
SHIPMENT | TrackingNumber | The shipment's tracking number. |
SHIPMENT | ShipmentTrackingURL | URL to your AfterShip branded tracking page with “tracking number” as a pre-set parameter. |
SHIPMENT | ShipmentCurrentStatus | Current delivery status of the AfterShip shipment. |
SHIPMENT | ShipmentCurrentSubStatus | Current sub-status of the AfterShip shipment. |
SHIPMENT | ShipmentDeliveryAddress | Destination address of the shipment |
SHIPMENT | LatestLocation | Latest location of the shipment. |
SHIPMENT | LatestUpdateTime | Latest update time on the shipment from the courier. |
SHIPMENT | LatestCourierMessage | Latest checkpoint message from the courier. |
SHIPMENT | CourierEstimatedDeliveryDate | The estimated delivery date is provided by the courier and sourced directly through AfterShip’s integration with courier tracking services. This represents the courier’s most accurate estimate of when the shipment is expected to be delivered. |
SHIPMENT | AfterShipAIEstimatedDeliveryDate | AfterShip leverages AI and proprietary tracking data to provide the AfterShip AI Predicted Estimated Delivery Date (AIEDD). AIEDD proactively engages with your customers and provides EDDs with higher than industry-level accuracy. |
SHIPMENT | AfterShipCustomSettingEstimatedDeliveryDate | The Custom estimated delivery date is a configurable setting within AfterShip Tracking’s admin dashboard. It is used in cases where merchants already have a mechanism to calculate the estimated delivery date based on the shipping type, courier, and destination. |
SHIPMENT | PromisedDeliveryDate | The Promised delivery date is a date that is passed to AfterShip Tracking via Tracking API. It is used in cases where the merchants have their own projections of when their shipments will arrive. |
SHIPMENT | LatestEstimatedDeliveryDate | The Latest Estimated Delivery Date is determined based on the following priority order: Courier estimated delivery date > AfterShip AI predicted estimated delivery date > Promised delivery date > Custom estimated delivery date. |
SHIPMENT | PickupLocation | The location from where the customer can pick up their package. |
SHIPMENT | SignedBy | The package receiver's information. |
SHIPMENT | CourierServiceType | Displays shipment's courier service type (e.g., UPS Express Saver®). |
SHIPMENT | Note | Displays additional notes configured in AfterShip. |
SHIPMENT | ShipmentPackageCount | The number of packages under this shipment. |
SHIPMENT | ShipDate | The ship date of the shipment. |
SHIPMENT | PickupDate | The pickup date of the shipment. |
SHIPMENT | DeliveryDate | The delivery date of the shipment. |
SHIPMENT | DestinationCity | The destination city of the shipment. |
SHIPMENT | DestinationState | The destination state of the shipment. |
SHIPMENT | DestinationCountrylso3 | The destination country of the shipment in Iso3 format. |
SHIPMENT | DestinationCountryName | The destination country name of the shipment. |
SHIPMENT | DestinationPostalCode | The destination postal code of the shipment. |
SHIPMENT | TransitTime | The total time spent on this shipment so far. |
SHIPMENT | OriginCity | The origin city of the shipment. |
SHIPMENT | OriginState | The origin state of the shipment. |
SHIPMENT | OriginCountrylso3 | The origin country of the shipment in Iso3 format. |
SHIPMENT | OriginCountryName | The origin country name of the shipment. |
SHIPMENT | OriginPostalCode | The origin postal code of the shipment. |
SHIPMENT | ShipmentWeight | The weight value of the shipment. |
SHIPMENT | ShipmentWeightUnit | The unit of weight value of the shipment. |
SHIPMENT | ShipmentTitle | Displays the title of the shipment from AfterShip. |
SHIPMENT | ImportSource | The Import source of AfterShip tracking. |
ORDER | OrderNumber | The customer-faced number identifying a purchase or order placed by a customer. |
ORDER | OrderID | The merchant internal-faced number identifying a purchase or order placed by a customer. |
ORDER | OrderTags | The tag of the order from your eCommerce store. |
ORDER | OrderPathURL | The URL that customers can click to view their order on your eCommerce store. |
ORDER | OrderTrackingURL | The URL to your AfterShip branded tracking page with “order number” and “customer email address/phone number” as pre-set parameters. |
Category | Trigger Filters & Splits | Description |
---|---|---|
ORDER | OrderStatusPageURL | The order status page of an eCommerce platform. |
ORDER | OrderDate | The date when the order is placed. |
ORDER | CustomerName | The customer's name to the delivery notification. |
ORDER | CustomerFirstName | The customer's first name to the delivery notification. |
ORDER | CustomerEmailAddress | The customer's email address to the delivery notification. |
ORDER | TotalShipments | The number of shipments under the order. |
ORDER | OrderTags | The order tag of the order. |
2. Custom fields
Category | Trigger Filters & Splits | Description |
---|---|---|
Custom | custom_fields_{your custom field key} | User-described fields created via AfterShip Tracking API, CSV, or in the Admin. For example, if you created “store_name” as a custom field, use it to set up your flow triggers. |
If you have any queries, feel free to connect with our support team for quick assistance.
Updated on: 14/10/2024
Thank you!