Articles on: Integrations

Klaviyo Advanced: Text Variables and Dynamic Item Blocks

Plans: Enterprise Standard, Enterprise Advanced, API users Platforms: All platforms


Overview


Explore our extensive list of variables for Klaviyo Emails and SMS triggered by AfterShip metrics. Tailor your communication with precision and elevate your customer engagement using text variables and dynamic item blocks.


What you’ll learn


In this tutorial, we’ll discuss:



Text variables - 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 carrier.

COURIER

CourierSlug

The name of the carrier slug.

COURIER

CourierContact

Contact information of the carrier.

COURIER

CourierWebURL

The carrier’s website.

COURIER

CourierRedirectURL

URL where the customer can redirect their parcel.

COURIER

CourierTrackingURL

The carrier'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 carrier.

SHIPMENT

LatestCourierMessage

Latest checkpoint message from the carrier.

SHIPMENT

CourierEstimatedDeliveryDate

The estimated delivery date is provided by the carrier and sourced directly through AfterShip’s integration with carrier 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, carrier, 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: Carrier 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 carrier 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.


Text variables - 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.


Items block


If your AfterShip organization is seamlessly linked to an eCommerce store or if you are importing shipments via Commerce API or order CSV, the dynamic items block in your Klaviyo account becomes your powerhouse.


Event Data Property Name

Details

OrderLineItems

Items encapsulated within the order.

ShipmentLineItems

Items shipped by the carrier.

ToShipItems

An array of line items for fulfillable products not attached to any shipments—representing "yet to ship" or backordered items.

OtherShipmentsInThisOrder

An array of other shipments in the order, and their line items.

AllShipmentsInThisOrder

An array of all shipments in the order, and their line items.

OrderLineItems Configuration


Configure the data source elements using markdown:

Property

Event Variables

Row collection

event.OrderLineItems

Row alias

line_item

Next, leverage these variables within your dynamic table block:


Property

Event Variables

Item Title

{{line_item.ItemTitle}}

Item Quantity

{{line_item.ItemQuantity}}

Item Variant Title

{{line_item.ItemVariantTitle}}

Item URL

{{line_item.ItemURL}}

Product Image

{{line_item.ItemImages}}

Product Unit Price Amount

{{line_item.ItemtUnitPrice.amount}}

Product Unit Price Currency

{{line_item.ItemtUnitPrice.currency}}

Product Final Line Price Amount

{{line_item.ItemFinalPrice.amount}}

Product Final Line Price Currency

{{line_item.ItemFinalPrice.currency}}

Efficiently configure and utilize OrderLineItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


ShipmentLineItems Configuration


Configure the data source elements using markdown:

Property

Event Variables

Row collection

event.ShipmentLineItems

Row alias

line_item

Next, leverage these variables within your dynamic table block:

Property

Event Variables

Item Title

{{line_item.ItemTitle}}

Item Quantity

{{line_item.ItemQuantity}}

Item Variant Title

{{line_item.ItemVariantTitle}}

Item URL

{{line_item.ItemURL}}

Product Image

{{line_item.ItemImages}}

Product Unit Price Amount

{{line_item.ItemtUnitPrice.amount}}

Product Unit Price Currency

{{line_item.ItemtUnitPrice.currency}}

Product Final Line Price Amount

{{line_item.ItemFinalPrice.amount}}

Product Final Line Price Currency

{{line_item.ItemFinalPrice.currency}}

Additionally, the following JSX example showcases how to use these variables:


{{line_item.ItemTitle}}{{line_item.ItemVariantTitle}}*{{ line_item.ItemQuantity }}{{line_item.ItemFinalPrice.amount}} {{line_item.ItemFinalPrice.currency}}


Efficiently configure and utilize ShipmentLineItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


ToShipItems Configuration


Configure the data source elements using markdown:

Property

Event Variables

Row collection

event.ToShipItems

Row alias

line_item

Next, leverage these variables within your dynamic table block:

Property

Event Variables

Item Title

{{line_item.ItemTitle}}

Item Quantity

{{line_item.ItemQuantity}}

Item Variant Title

{{line_item.ItemVariantTitle}}

Item URL

{{line_item.ItemURL}}

Product Image

{{line_item.ItemImages}}

Product Unit Price Amount

{{line_item.ItemtUnitPrice.amount}}

Product Unit Price Currency

{{line_item.ItemtUnitPrice.currency}}

Product Final Line Price Amount

{{line_item.ItemFinalPrice.amount}}

Product Final Line Price Currency

{{line_item.ItemFinalPrice.currency}}

Efficiently configure and utilize ToShipItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


OtherShipmentsInThisOrder Configuration


This section details related shipments using a nested loop to display their contents and status. It's a complex block requiring technical support. If you lack resources, contact your customer success manager for assistance; AfterShip Support can provide the code for you to integrate into your email content.

Configure the data source elements using markdown:

Property

Event Variables

Row collection

event.OtherShipmentsInThisOrder

Row alias

line_item

Next, leverage these variables within your dynamic table block:

Property

Example

CourierName

{{line_item.CourierName}}

TrackingNumber

{{line_item.TrackingNumber}}

ShipmentCurrentStatus

{{line_item.ShipmentCurrentStatus}}

LatestEstimatedDeliveryDate

{{line_item.LatestEstimatedDeliveryDate}}

DeliveryDate

{{line_item.DeliveryDate}}

ShipmentLineItems

The line items array for the contents of the fulfillment.


AllShipmentsInThisOrder Configuration


Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.AllShipmentsInThisOrder

Row alias

line_item

Next, leverage these variables within your dynamic table block:


Property

Example

CourierName

{{line_item.CourierName}}

TrackingNumber

{{line_item.TrackingNumber}}

ShipmentCurrentStatus

{{line_item.ShipmentCurrentStatus}}

LatestEstimatedDeliveryDate

{{line_item.LatestEstimatedDeliveryDate}}

DeliveryDate

{{line_item.DeliveryDate}}

ShipmentLineItems

The line items array for the contents of the fulfillment.

This section details related shipments using a complex nested loop for displaying contents and status. For technical support, contact your customer success manager; AfterShip Support can share the code for your email content integration.


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

Updated on: 17/07/2024