AfterShip Integration

read
Last updated at:

Overview

You can use AfterShip to automatically track shipments for your ecommerce store. Klaviyo offers a native AfterShip integration which, when enabled, will send AfterShip tracking information into Klaviyo so you can incorporate shipping data into automated flows.

AfterShip data is sent to Klaviyo via webhook, which means that data is sent in near real-time.

Here are some of the data synced from AfterShip:

  • Tracking Code and Order ID for shipments
  • When a shipment is marked as shipped
  • When a shipment has been marked as delivered

This article will walk you through integrating AfterShip with Klaviyo. After completing the steps in this guide, you'll be able to personalize and target emails based on the shipping events and status of orders AfterShip tracks.

Enable Klaviyo's AfterShip Integration

You'll need to generate an AfterShip API key to enable the integration. First, generate an API Key in your AfterShip account. Then, enable the AfterShip integration in your Klaviyo account.

Log into your AfterShip account. From Settings, click on API Keys.
Aftership1.png
Click Generate API Key, and label the API Key for clarity. Click Generate API Key again. Copy the API Key, then head over to Klaviyo.
AfterShip2.gif
Log into your Klaviyo account. Navigate to the Integrations tab, and find AfterShip on the All Integrations tab. Click Add Integration.
AfterShip1.pngIn the API Key field, paste the AfterShip API Key you just created. Then select Connect to AfterShip.
Aftership3.png
Your Klaviyo account is now connected with AfterShip.

After you select Connect to AfterShip, your page will reload. In the Setting Up the AfterShip Webhook section, copy the webhook URL. 
AfterShip4.png
Head back over to AfterShip to finish setting up the webhook. 

Update the AfterShip Webhook URL

From your AfterShip account, navigate to Notifications. If you have not yet set up notifications, click Setup Notifications. If you've already set up notifications, you'll be sent directly to the Notifications page. 
AfterShip5.png
Scroll down to the Webhooks section, and click Add webhook URL.
AfterShip6.png
Paste the webhook URL you just copied from your Klaviyo account, and click Save.
AfterShip_7.png
In the Events section, make sure the All events checkbox is enabled. This will ensure that all events will be sent to Klaviyo from AfterShip.
AfterShip7.png
AfterShip will now sync all tracking events over to Klaviyo. 

Monitor the Klaviyo Sync 

To check on your integration, navigate to your account's Metrics tab. Click on the Received Delivery metric and click on the activity feed icon. AfterShip data is sent to Klaviyo via webhooks, so all data is near real-time.

If your integration has begun syncing data, you'll start to see Received Delivery events being added to this Activity Feed. When your AfterShip integration has a green border in your account's Enabled Integrations list, your historic data sync is complete.

If you aren't seeing data, make sure the All events setting is enabled in the Notifications > Events section of your AfterShip account. 

What Data Syncs to Klaviyo

Shipping events synced from AfterShip can be viewed in your Metrics tab. From Klaviyo, navigate to your Metrics tab and select AfterShip from the filter dropdown on the upper-right. AfterShip metrics are notated by an AfterShip icon. 

2018-11-08_13-19-02.pngDelivery Exception

This metric records every time a delivery has one of the following statuses: custom hold, undelivered, returned shipment to sender, or any shipping exceptions.

Failed Delivery Attempt

This metric records when a carrier attempted to deliver but failed. It usually leaves a notice and will try to deliver again.

In Transit

This metric records when a carrier has accepted or picked up a shipment from a shipper. The shipment is on the way to its destination.

Out for Delivery

This metric records when a carrier is about to deliver the shipment or the shipment is ready to pick up.

Received Delivery 

This metric records an event every time a delivery is marked as received inside of AfterShip. With this metric, you can filter Product Review flows to send only to people who have received a delivery. You can also trigger a flow when a delivery is received, letting customers know when their packages arrive. Each event includes information about an order's tracking number and order ID. 

Shipped Package

This metric records an event every time an order is marked as shipped in AfterShip. With this metric, you can trigger flows to send emails confirming that a package has been shipped to a customer, and provide them the tracking number to track their shipment. Each event includes information about an order's tracking number and order ID.

Each of these metrics are associated with additional data (aka metadata). For example, the Out For Delivery metric is associated with CurrentStatus which includes: AttemptFail, Delivered, Exception, InfoReceived InTransit, OutForDelivery.
AfterShip9.png

Each piece of AfterShip data can be used in Klaviyo. For example, the OutForDelivery metric can trigger a flow based on CurrentStatus. See the following section for an example of using AfterShip data in a flow.

How to Use the AfterShip Integration

You can use AfterShip data to trigger flows that let your customers know about the status of their shipments. 

Out for Delivery Flow

Let your customers know that their order is out for delivery by using AfterShip metrics and metadata, and populate your flow email with dynamic order information. 

Trigger: People enter this flow when they Out for Delivery 
Trigger Filter: CurrentStatus contains OutForDelivery
Flow Filter: Out for Delivery zero times since starting this flow.

AfterShip8.png

Notice that the flow email references dynamic customer order data i.e. {{ event.extra.Title }}.

To learn more about adding dynamic customer data to your flow emails, see: Building Dynamic Blocks in a Flow Email  

x
Was this article helpful?
94 out of 127 found this helpful