---
title: "How to Get Tracking Information From Shipment in Magento 2"
url: "https://magecomp.com/blog/get-tracking-information-shipment-magento-2/"
date: "2020-07-17T19:25:18+00:00"
modified: "2025-02-20T10:25:10+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 404
reading_time: "3 min read"
summary: "Hello Magento Folks? ,"
description: "After the order is placed, the shipping information is provided to the customers. Learn How to Get Tracking Information From Shipment in Magento 2."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Implement Voice Search in Magento 2?"
    url: "https://magecomp.com/blog/voice-search-magento-2/"
  - title: "How to Add Dynamic Link to Footer in Magento 2?"
    url: "https://magecomp.com/blog/add-dynamic-link-footer-magento-2/"
  - title: "How to add Checkout Custom Form Validation using knockout JS in Magento 2?"
    url: "https://magecomp.com/blog/add-checkout-custom-form-validation-using-knockout-js-magento-2/"
---

# How to Get Tracking Information From Shipment in Magento 2

_Published: July 17, 2020_  
_Author: Dhiren Vasoya_  

![How to Get Tracking Information From Shipment in Magento 2](https://magecomp.com/blog/wp-content/uploads/2020/07/How-to-Get-Tracking-Information-From-Shipment-in-Magento-2-1024x512.webp)

**Hello Magento Folks? ,**

How are you doing? Today I am here with yet another useful topic How to Get Tracking Information From Shipment in Magento 2. Look at our previously released blog, [How to Add Dynamic Link to Footer in Magento 2](https://magecomp.com/blog/add-dynamic-link-footer-magento-2/) if you skipped out.
[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

## Introduction
Customer experience has become the central point for the E-commerce industry. The customers’ journey to your store starts by examining the product to purchasing it and then receiving the product. After the order placement, it is very essential to stay connected with the customer by providing information about their order like shipment status of the product, delivery date, and the reason for the delay. This will help to build the trust of the customers and result in improved user experience.
Magento 2 provides the feature to notify tracking information to the customers as well as the store owner. Let’s get rolling!
## Steps to Get Tracking Information From Shipment in Magento 2
By the following code, you will be able to Get Tracking Information From Shipment in Magento 2. It can be done by event-observer as shown below:
**Step 1:** First create **event.xml**

**Path- app\code\Vendor\Extension\etc\events.xml**

Now enter the following code.
```
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_shipment_save_after">
          <observer name="track_shipment" instance="VendorExtensionObserverShipment" />
     </event>
</config>
```

**Step 2:** Then enter the following code in Observer.
**Path – app\code\Vendor\Extension\Observer\Shipment.php**

```
<?php
namespace VendorExtensionObserver;
use MagentoFrameworkEventObserverInterface;
class Shipment implements ObserverInterface
{
    public function execute(MagentoFrameworkEventObserver $observer)
    {
        try {
            $shipment = $observer->getEvent()->getShipment();
            $tracksCollection = $shipment->getTracksCollection();

            foreach ($tracksCollection->getItems() as $track) {
                $track_number = $track->getTrackNumber();
                $carrier_name = $track->getTitle();
            }
        } catch (Exception $e) {
        }
    }
}

?>
```

You are done!
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-4.webp)](https://magecomp.com/magento-malware-removal.html)

## Closing Words:
Hope, now you know How to Get Tracking Information From Shipment in Magento 2. We recommend you take advantage of **[Magento 2 Order Tracking Extension](https://magecomp.com/magento-2-order-tracking.html)** to enhance your store performance and provide greater customer services. In case any complications let me know in the comment area and I will get back to you. If you find it worthful, share it with your Magento pals. Stay safe and stay tuned so that you do not miss any important functionality for your store!
[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)

**Happy Coding ?**


---

_View the original post at: [https://magecomp.com/blog/get-tracking-information-shipment-magento-2/](https://magecomp.com/blog/get-tracking-information-shipment-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-20 21:36:12 UTC_  
