How track and trace systems work

A quick primer on how modern logistics track and trace systems work, and how you can build one yourself.

How track and trace systems work

If you've ever used FedEx, UPS or the postal service to send a package, you might have received a tracking number that you can use to check where it currently is and when it's scheduled to arrive. This is called track and trace. In the past, only large international logistics companies could afford the expensive supply chain and IT backend that made this possible, but the technology has improved so much that now, any company, no matter how small, can afford one.

In this blog post, I'll show you how modern track and trace systems are built and how you can use them to assure your customers that their items will reach their destination safely and on time.

Afi Labs delivers custom software to meet your logistics needs. From vehicle routing, live tracking to proof of delivery, we've got you covered!
๐Ÿ‘‹ Say Hello!

The first company to really embrace track and trace as a means of improving the customer experience in a big way was Amazon. Back in the late 1990s when Amazon was still a scrappy startup, the main reason why customers were uncomfortable buying goods online was that they were unsure if their purchases would reach their homes. Amazon was able to convince them that their purchases were safe by adding a link "track your package!" to each confirmation email that went out when a purchase was made.

Amazon "track your package" email is an example of a classic track and trace system
Amazon "track your package" email

This was the first time that track and trace was widely used by consumers, and they loved it. By 1999, Amazon hit a billion dollars in revenue and the rest is history.

Fast forward ten years or so. Firstly, most people started to own a smartphone, allowing them internet access on the go. Then, a San Francisco based startup called Ubercab launched an app that let you book a ride from your smartphone. Uber solved two big problems with San Francisco's taxi system. The first was getting a taxi. Instead of a call center operator broadcasting new bookings and waiting for a driver to reply, Uber used an automated dispatch algorithm to match passengers with the nearest available driver.

The second was making sure that the driver actually arrived. That's track and trace! Uber displayed the driver's real-time location on the app so that you could see your driver coming over to pick you up, and call him if he was visibly lost.

track and trace system architecture using the twilio API

At its core, track and trace for logistics requires three components:

  1. Sensors - This could be a barcode scanner that confirms the location of the package and the time that it was scanned.
  2. A database - To save the package's location and time stamp.
  3. Customer notifications - To read information from the database and inform the customer of key events e.g. the driver is on his way and about to deliver your package.

Track and Trace with Alice, Bob (and Dan)

I'll explain how each component works using the example of ABC Couriers, a small same day delivery company operating in the Seattle area.

Alice is going on a week long business trip and wants to send her pet cat to Bob, an old friend who lives in nearby Redmond. She's used ABC Couriers before and knows that they transport pets. ย She logs onto ABC Courier's customer portal to create a new delivery order and prints out a shipping label (with a bar code) that she attaches to her cat's pet carrier.

track and trace order being created
Creating a new order and specifying sender and recipient details

On ABC Courier's backend, the status of Alice's package is changed to pending and its location updated to Alice's home address, which is where she specified that her cat should be picked up. Here's what the database entry would look like.

{
	"order_id": "ABC123",
	"pickup_name": "Alice Moresby",
	"pickup_address": "1145 10th Ave E, Seattle, WA 98102, United States",
	"dropoff_name": "Bob Palmer",
	"dropoff_address": "6110 186th Pl NE, Redmond, WA 98052, United States",
	"status": "pending"
}

When driver Dan has been assigned to Alice's package pickup and an estimated arrival time (ETA) confirmed, ABC Courier's backend will make an API call to change the order's status to assigned like so:

Method: PATCH
URL: /orders/ABC123/status/assigned

Alice gets an email letting her know when Dan is scheduled to arrive, together with a link to a tracking page updated with her package's new assigned status and ETA.

When Dan arrives and picks up her cat, he scans in the attached bar code and marks it as "picked up". His driver app makes an API call to change the status of the order to ย collected, and when he drives off, to in transit.

barcode scanning on pickup for track and trace
Barcode scanning on pickup

So far, everything here is pretty standard - you'd get the same kind of track and trace functionality when you send a package using FedEx or UPS. But the delivery part of the journey gets a little more interesting.

Before GPS-enabled smart phones, this kind of up to the minute tracking was not economically feasible because you'd need a GPS transponder in each vehicle transmitting its location to a central server, and a way to link the package that was picked up to the vehicle that it was loaded onto. With smartphones and pervasive data connectivity, live tracking is now feasible, which is what Uber did.

By picking up a package and scanning it with this smartphone, Dan creates an association between the order_id and his driver_id (stored on his driver app). And since the driver app broadcasts his real-time location back to the server, we now have a way to link the order_id and the driver's GPS coordinates. Real-time driver tracking is overkill for most logistics services but comes in very useful if you need the recipient to be present when the driver arrives e.g. if you are delivering food, sending a plumber to fix an overflowing toilet, or transporting a beloved pet!

track and trace system using live driver tracking and customer notifications
Live tracking from the perspective of the driver (left) and customer (right)

When Dan is about to head to Bob's home, he hits the "Send ETA" button to send a text message to Bob, letting him know when he'll arrive. The text message includes a link to an online map that Bob can use to see Dan's real-time location. Sharing this information with customers can be tricky for logistics companies because you might end up accidentally revealing the location of all the other customers on Dan's route, so the best way to set up live tracking is to only share the link when the driver is headed to the customer's location and to disable it once the driver has made the delivery.

track and trace timeline
Track and trace screen on delivery completion

After Dan gives Alice's cat to Bob, he gets Bob's signature and takes a photo of the carrier as proof of delivery. Both the photo and signature are uploaded to the customer portal and Alice gets an email letting her know the delivery is complete and her cat is safe.

How to Implement Track and Trace in your Business

So how do you add track and trace to your delivery business? There are two ways - the first is to hire an engineering team to build something custom for your needs (if this is what you'd like to do - get in touch). At minimum you would need a web-based customer portal that your customers can use to create orders and track them, a route optimization and dispatch system to assign orders to drivers, a driver app that drivers can use to mark orders as picked up or delivered and a text or email notification system (if you want to build one yourself, here's a quick tutorial and sample code) to send real-time updates to your customers.

track and trace system using detrack
Detrack's track and trace email notification and tracking link

An easier option is to use a software as a service (SaaS) delivery management tool that already has track and trace built in. The most popular ones these days are Onfleet, Routific and Detrack (see above screenshot). Each handles track and trace slightly differently, but whichever one you go with should be good enough for basic delivery operations.

Afi Labs builds custom transportation and logistics management software. From route optimization, live tracking to proof of delivery and driver apps, we've got you covered!
๐Ÿ‘‹ Say Hello!

Here are some ways we have helped businesses implement track and trace:
Cross Border Logistics at Janio Asia
Same Day Delivery with Rocketship