Skip to main content
Solved

Tracking number from shipstation

  • January 7, 2021
  • 8 replies
  • 2025 views

Forum|alt.badge.img+3

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?

Best answer by ksanfelipe

Hey @harwardm !

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:

  1. Create a flow with the trigger event that you are wanting to use (Order shipped, Order on hold, etc)
  2. Add an email action under the flow trigger
  3. Configure email content. Open the preview tool in our template editor, and find the line of event data that refers to the “Tracking Number”
  4. Click on that, and see that it provides a code slug for you to insert into your template
  5. 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!

View original
Did this topic or the replies in the thread help you find an answer to your question?

8 replies

ksanfelipe
Klaviyo Employee
Forum|alt.badge.img+10
  • Klaviyo Employee
  • 29 replies
  • Answer
  • January 10, 2021

Hey @harwardm !

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:

  1. Create a flow with the trigger event that you are wanting to use (Order shipped, Order on hold, etc)
  2. Add an email action under the flow trigger
  3. Configure email content. Open the preview tool in our template editor, and find the line of event data that refers to the “Tracking Number”
  4. Click on that, and see that it provides a code slug for you to insert into your template
  5. 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!


Forum|alt.badge.img+3
  • Problem Solver I
  • 12 replies
  • March 5, 2021

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?


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • April 29, 2021

Hello @salamiadil

Glad the tips that @ksanfelipe provided helped in locating that tracking number syntax!

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:

Hope this helps!
-David


Reynaldy
Contributor III
Forum|alt.badge.img+2
  • Contributor III
  • 5 replies
  • October 13, 2021

Hi @david.to 

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.


Forum|alt.badge.img+2
  • Problem Solver I
  • 9 replies
  • March 8, 2024
Reynaldy wrote:

Hi @david.to 

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 @Reynaldy ,

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!


  • Contributor I
  • 2 replies
  • March 23, 2024
shanermp wrote:
Reynaldy wrote:

Hi @david.to 

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 @Reynaldy ,

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


Forum|alt.badge.img+2
  • Problem Solver I
  • 9 replies
  • March 25, 2024

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.

 

Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8

Hope that helps someone!


  • Contributor I
  • 2 replies
  • March 26, 2024
shanermp wrote:

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.

 

Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8

Hope that helps someone!

 

This will help so many people!

I have code for SMS if anyone wants, just DM me!