I am working on a flow to let my customers know that their order has been shipped and want to send them their tracking number. I use shipstation and have it integrated into Klaviyo, but don’t know how to pull that tracking number from shipstation and put it into the email. Is this possible to do and if so how do I do it?
Hey
Events that sync to Klaviyo include data that can be used in your email templates. When you are working with an event/metric-triggered flow, you can use the Preview tool in the template editor to add dynamic content to your template. I’d recommend checking out our instructions here: https://help.klaviyo.com/hc/en-us/articles/115002779071-Personalize-Flow-Emails-with-Dynamic-Event-Data#how-to-find-event-variables3
To give you a general process to follow:
- Create a flow with the trigger event that you are wanting to use (Order shipped, Order on hold, etc)
- Add an email action under the flow trigger
- Configure email content. Open the preview tool in our template editor, and find the line of event data that refers to the “Tracking Number”
- Click on that, and see that it provides a code slug for you to insert into your template
- Copy the code slug, and paste it into your template!
These instructions are covered in the help doc linked, but hopefully that gives you further clarity. Reply back if you have any other questions!
Hello team Klaviyo,
after following the docs, I did find the code for tracking number. We currently use bigcommerce and shipstation.
{{ event.extra.shipments.0.tracking_number }}
We tried to place it in an <a>tag, yet the link wasn’t working.
<a class="button1" href="{{ event.extra.shipments.0.tracking_number }}">Tracking</a>
We prefer not showing the code number but to link them directly to the usps website.
Is this possible?
Hello
Glad the tips that
Do you happen to only use USPS for shipping? Since that dynamic syntax is only going to return the actual tracking number and not a link/URL inclusive of that tracking number, your best option would be to amend the {{ event.extra.shipments.0.tracking_number }}
syntax as part of USPS’s tracking link. For example: www.tools.usps.com/go/TrackConfirmAction.action?tLabels={{ event.extra.shipments.0.tracking_number }}
This would return the USPS’s tracking site with the amended tracking number and perform the query with that specific customer’s tracking to return your desired results.
Other URL prefixes you can use to create these dynamic URL links for tracking:
- USPS - tools.usps.com/go/TrackConfirmAction.action?tLabels=
- UPS - wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=
- FedEx - www.fedex.com/Tracking?language=english&tracknumbers=
- DHL - www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=
- All others - Check with your shipping provider and/or check their website of what their generic tracking URL structure is like and note where the tracking number lies in the URL to include the tracking number dynamic syntax to
Hope this helps!
-David
Hi
If I have 4 different tracking numbers in my email, what about the variables? is the variable like this {{ event.extra.shipments.0.tracking_number }}?
Because I have 4 different tracking numbers and it has to be dynamic and how to do it?
Thank you.
Hi
If I have 4 different tracking numbers in my email, what about the variables? is the variable like this {{ event.extra.shipments.0.tracking_number }}?
Because I have 4 different tracking numbers and it has to be dynamic and how to do it?
Thank you.
Hey
I had the same question as we ship using UPS, USPS, and FedEx. We’re using WooCommerce and Shipstation.
What I ended up doing is I found in the event details there was a “Service Code” that Shipstation provided. This started with the carrier and then had the specific shipping option (i.e. ups_ground or usps_priority_mail). What I then did was use conditional logic to hide/show the block based on what was in that service code. This article and this article from Klaviyo were instrumental in figuring this out. Keep in mind I’m using a conditional logic that is looking for what is contained in, not an exact match. This is because each carrier has multiple types of shipments (i.e. next day air, flat rate, etc). So, I just want to show the block if the carrier is contained in the service code.
The conditional logic was “ 'ups' in event.extra|lookup:'Service Code' ”. For each block I changed the condition based on the carrier. (i.e. 'fedex' in event.extra|lookup:'Service Code' or 'usps' in event.extra|lookup:'Service Code').
With this in place, only the block that contains the specific carrier Service Code will show up. Now, within each block I could create a carrier specific link using the tracking number as they showed above.
So far, it seems to be working well!
Hi
If I have 4 different tracking numbers in my email, what about the variables? is the variable like this {{ event.extra.shipments.0.tracking_number }}?
Because I have 4 different tracking numbers and it has to be dynamic and how to do it?
Thank you.
Hey
I had the same question as we ship using UPS, USPS, and FedEx. We’re using WooCommerce and Shipstation.
What I ended up doing is I found in the event details there was a “Service Code” that Shipstation provided. This started with the carrier and then had the specific shipping option (i.e. ups_ground or usps_priority_mail). What I then did was use conditional logic to hide/show the block based on what was in that service code. This article and this article from Klaviyo were instrumental in figuring this out. Keep in mind I’m using a conditional logic that is looking for what is contained in, not an exact match. This is because each carrier has multiple types of shipments (i.e. next day air, flat rate, etc). So, I just want to show the block if the carrier is contained in the service code.
The conditional logic was “ 'ups' in event.extra|lookup:'Service Code' ”. For each block I changed the condition based on the carrier. (i.e. 'fedex' in event.extra|lookup:'Service Code' or 'usps' in event.extra|lookup:'Service Code').
With this in place, only the block that contains the specific carrier Service Code will show up. Now, within each block I could create a carrier specific link using the tracking number as they showed above.
So far, it seems to be working well!
Hello, my god - there’s so little documentation on this it’s crazy! How relieved I was to see a comment only 14 days ago! I hope you don’t mind, but I have sent you a direct message
Hey everyone, I wanted to add some more information to this thread. This is the way I solved this problem. There is likely other (possibly more efficient) ways to do the same thing. I’m attaching some (heavily redacted) screenshots that show how I accomplished this.
Hope that helps someone!
Hey everyone, I wanted to add some more information to this thread. This is the way I solved this problem. There is likely other (possibly more efficient) ways to do the same thing. I’m attaching some (heavily redacted) screenshots that show how I accomplished this.
Hope that helps someone!
This will help so many people!
I have code for SMS if anyone wants, just DM me!
Reply
Log in to the Community
Use your Klaviyo credentials
Log in with Klaviyo
Use your Klaviyo credentials
Log in with KlaviyoEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.