shipment-tracking

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shipment Tracking

包裹追踪

Overview

概述

Shipment tracking lets customers follow their package from warehouse to doorstep, and proactively notifies them at key milestones (shipped, out for delivery, delivered). Most platforms send tracking emails automatically when a label is created — but a branded tracking page and proactive exception alerts (lost packages, failed delivery) require a dedicated tracking app or service.
包裹追踪功能可让客户全程追踪包裹从仓库到家门口的物流状态,并在关键节点(已发货、正在配送、已送达)主动推送通知。大多数平台在创建运单标签时会自动发送追踪邮件,但品牌化追踪页面和主动异常提醒(包裹丢失、配送失败)则需要专用的追踪应用或服务。

When to Use This Skill

何时使用此技能

  • When customers need real-time package tracking on their order detail pages
  • When building post-purchase notifications (email/SMS) triggered by shipping milestone events
  • When you need to detect delivery exceptions (lost packages, failed delivery attempts) and trigger customer service alerts
  • When aggregating tracking data across multiple carriers (UPS, FedEx, USPS, DHL) into a single interface
  • When integrating with a carrier aggregator like EasyPost or Shippo for unified tracking webhooks
  • 当客户需要在订单详情页查看实时包裹追踪信息时
  • 当构建由物流节点事件触发的售后通知(邮件/短信)时
  • 当您需要检测配送异常(包裹丢失、配送尝试失败)并触发客服提醒时
  • 当需要将多个承运商(UPS、FedEx、USPS、DHL)的追踪数据聚合到单一界面时
  • 当与EasyPost或Shippo等承运商聚合平台集成以获取统一追踪Webhook时

Core Instructions

核心操作步骤

Step 1: Determine your platform and choose the right tracking tool

步骤1:确定您的平台并选择合适的追踪工具

PlatformRecommended ToolWhy
ShopifyAfterShip or RouteAfterShip provides a branded tracking page, proactive email/SMS notifications, and exception alerts across all carriers
WooCommerceAfterShip for WooCommerce or Shipment Tracking by WooCommerceAfterShip integrates with all major carriers; the official WooCommerce extension handles basic carrier tracking
BigCommerceAfterShip (BigCommerce App Marketplace) or ShipStation trackingAfterShip has a native BigCommerce integration; ShipStation also provides tracking if you use it for label creation
Custom / HeadlessEasyPost Tracker API or Shippo tracking webhooksEasyPost and Shippo normalize tracking events across all carriers into a single webhook feed
平台推荐工具理由
ShopifyAfterShip 或 RouteAfterShip提供品牌化追踪页面、主动邮件/短信通知,以及覆盖所有承运商的异常提醒
WooCommerceAfterShip for WooCommerce 或 Shipment Tracking by WooCommerceAfterShip可与所有主流承运商集成;官方WooCommerce扩展可处理基础承运商追踪
BigCommerceAfterShip(BigCommerce应用市场)或 ShipStation trackingAfterShip与BigCommerce原生集成;如果您使用ShipStation创建运单标签,它也能提供追踪服务
自定义/无头电商EasyPost Tracker API 或 Shippo tracking webhooksEasyPost和Shippo可将所有承运商的追踪事件标准化为单一Webhook信息流

Step 2: Set up carrier tracking notifications

步骤2:设置承运商追踪通知

Shopify

Shopify

Shopify's built-in tracking (no extra app needed for basics):
  1. When you fulfill an order and add a tracking number, Shopify automatically sends the customer a "Your order is on its way" email with the tracking link
  2. The tracking link goes to the carrier's website (e.g., ups.com for UPS) — it's functional but not branded
  3. Customers can check their order status at
    yourstore.com/orders/[order-id]
AfterShip (recommended for branded tracking + proactive notifications):
  1. Install AfterShip from the Shopify App Store (free plan available)
  2. AfterShip automatically detects new fulfillments in Shopify and begins tracking the package
  3. In AfterShip → Notifications, configure email and SMS notifications at each milestone:
    • "In transit" — when the package leaves your facility
    • "Out for delivery" — day of delivery
    • "Delivered" — confirmation
    • "Exception" — failed delivery attempt or package delay
  4. Customize the tracking page at AfterShip → Tracking Page with your logo, colors, and product recommendations
  5. AfterShip's branded tracking page is hosted at
    yourstore.aftership.com
    or you can embed it on your own domain
For Shopify Plus: Use Klaviyo to trigger shipping notification emails based on AfterShip tracking events via Klaviyo's AfterShip integration — this gives you full control over the email design and content.
Shopify内置追踪(基础功能无需额外应用):
  1. 当您完成订单并添加追踪号码后,Shopify会自动向客户发送“您的订单已发出”邮件,内含追踪链接
  2. 追踪链接指向承运商官网(例如UPS的ups.com)——功能可用但无品牌化设计
  3. 客户可通过
    yourstore.com/orders/[order-id]
    查看订单状态
AfterShip(推荐用于品牌化追踪+主动通知):
  1. 从Shopify应用商店安装AfterShip(提供免费套餐)
  2. AfterShip会自动检测Shopify中的新完成订单并开始追踪包裹
  3. 在AfterShip → 通知中,配置各节点的邮件和短信通知:
    • “运输中”——包裹离开您的仓库时
    • “正在配送”——配送当日
    • “已送达”——配送确认时
    • “异常”——配送尝试失败或包裹延误时
  4. 在AfterShip → 追踪页面中自定义追踪页面,添加您的品牌Logo、配色和产品推荐
  5. AfterShip的品牌化追踪页面托管在
    yourstore.aftership.com
    ,您也可将其嵌入自有域名
针对Shopify Plus用户: 通过Klaviyo的AfterShip集成,基于AfterShip追踪事件触发配送通知邮件——这让您可完全控制邮件的设计和内容。

WooCommerce

WooCommerce

Using WooCommerce Shipment Tracking (official extension):
  1. Install from WooCommerce.com (or use the free community version on WordPress.org)
  2. When fulfilling an order, enter the tracking number and carrier in WooCommerce → Orders → [Order] → Add Tracking Number
  3. WooCommerce sends the customer an updated order email with the tracking link
  4. Customers see the tracking link in My Account → Orders
Using AfterShip for WooCommerce:
  1. Install the AfterShip plugin from WordPress.org
  2. AfterShip syncs WooCommerce orders and begins tracking when tracking numbers are added
  3. Configure notification emails in AfterShip dashboard → Notifications
  4. The branded tracking page works the same as the Shopify version
ShipStation tracking (if using ShipStation for fulfillment):
  • ShipStation automatically emails customers when a label is created with a tracking link
  • Go to ShipStation → Account Settings → Notifications to configure which carrier events trigger emails
使用WooCommerce Shipment Tracking(官方扩展):
  1. 从WooCommerce.com安装(或使用WordPress.org上的免费社区版)
  2. 完成订单时,在WooCommerce → 订单 → [对应订单] → 添加追踪号码中输入追踪号码和承运商信息
  3. WooCommerce会向客户发送更新后的订单邮件,内含追踪链接
  4. 客户可在“我的账户 → 订单”中查看追踪链接
使用AfterShip for WooCommerce:
  1. 从WordPress.org安装AfterShip插件
  2. AfterShip会同步WooCommerce订单,并在添加追踪号码后开始追踪
  3. 在AfterShip控制台 → 通知中配置通知邮件
  4. 品牌化追踪页面的功能与Shopify版本一致
ShipStation追踪(如果使用ShipStation处理履约):
  • ShipStation在创建运单标签时会自动向客户发送含追踪链接的邮件
  • 进入ShipStation → 账户设置 → 通知,配置哪些承运商事件会触发邮件

BigCommerce

BigCommerce

  1. Install AfterShip Returns Center or AfterShip from the BigCommerce App Marketplace
  2. AfterShip syncs with BigCommerce orders automatically
  3. Configure notifications and the branded tracking page in the AfterShip dashboard (same as above)
BigCommerce's built-in tracking:
  • BigCommerce automatically sends shipping confirmation emails with tracking links when an order is marked as "Shipped" with a tracking number
  • Go to Store Setup → Email Templates → Shipped Email to customize the email content
  1. 从BigCommerce应用市场安装AfterShip Returns CenterAfterShip
  2. AfterShip会自动与BigCommerce订单同步
  3. 在AfterShip控制台中配置通知和品牌化追踪页面(操作同上)
BigCommerce内置追踪:
  • 当订单标记为“已发货”并添加追踪号码后,BigCommerce会自动发送含追踪链接的配送确认邮件
  • 进入店铺设置 → 邮件模板 → 已发货邮件自定义邮件内容

Step 3: Handle tracking exceptions

步骤3:处理追踪异常

Delivery exceptions (lost packages, failed delivery attempts) need fast resolution to protect customer satisfaction.
配送异常(包裹丢失、配送尝试失败)需要快速解决,以保障客户满意度。

Setting up exception alerts

设置异常提醒

AfterShip:
  1. Go to AfterShip → Notifications → Exceptions
  2. Enable email alerts to your team for these exception types:
    • "Exception" — carrier-reported issue
    • "Failed Attempt" — delivery attempt failed, needs rescheduling
    • "Returned to Sender" — package coming back
  3. AfterShip can trigger Slack or email alerts to your ops team alongside the customer notification
Shopify Flow (Plus):
Trigger: AfterShip tracking event received
Condition: Status is "Exception" or "Failed Attempt"
Action: Create customer service task in Gorgias or Zendesk
Action: Send internal Slack notification to #shipping-exceptions
AfterShip:
  1. 进入AfterShip → 通知 → 异常
  2. 为团队启用以下异常类型的邮件提醒:
    • “异常”——承运商报告的问题
    • “配送尝试失败”——配送尝试未成功,需要重新安排
    • “退回发件人”——包裹将退回
  3. AfterShip可在向客户发送通知的同时,向运营团队触发Slack或邮件提醒
Shopify Flow(Plus用户):
Trigger: AfterShip tracking event received
Condition: Status is "Exception" or "Failed Attempt"
Action: Create customer service task in Gorgias or Zendesk
Action: Send internal Slack notification to #shipping-exceptions

Responding to exceptions

响应异常事件

When AfterShip or your tracking tool flags an exception:
  1. Check the carrier's native tracking portal for the most current status
  2. For lost packages: file a claim with the carrier (UPS, FedEx, USPS all have online claims portals)
  3. For failed delivery: contact the customer to update their delivery address or arrange pickup
  4. For returned packages: coordinate with the customer on re-shipping vs. refund
当AfterShip或您的追踪工具标记异常时:
  1. 查看承运商原生追踪门户获取最新状态
  2. 对于丢失的包裹:通过承运商在线索赔门户(UPS、FedEx、USPS均提供)提交索赔
  3. 对于配送失败:联系客户更新配送地址或安排自提
  4. 对于退回的包裹:与客户协调重新发货或退款事宜

Step 4: Add a branded tracking page to your store

步骤4:为店铺添加品牌化追踪页面

A branded tracking page keeps customers on your site (vs. carrier sites), allows product recommendations, and reduces "where is my order" contacts.
AfterShip generates this automatically at
yourstore.aftership.com
. To put it on your own domain:
  1. In AfterShip → Tracking Page → Custom Domain, enter your subdomain (e.g.,
    tracking.yourstore.com
    )
  2. Add a CNAME DNS record pointing
    tracking.yourstore.com
    to AfterShip's servers
  3. Update your shipping confirmation email to link to
    tracking.yourstore.com/[tracking-number]
    instead of the carrier URL
Embed tracking in your existing order status page:
  • For Shopify: AfterShip has a theme app extension that embeds the tracking widget directly in the Shopify order status page
  • For WooCommerce: the AfterShip plugin adds a tracking section to the WooCommerce "My Account → Orders" page automatically
品牌化追踪页面可让客户留在您的网站(而非承运商网站),还可展示产品推荐,减少“我的订单在哪里”这类咨询。
AfterShip会自动在
yourstore.aftership.com
生成该页面。如需部署在自有域名:
  1. 在AfterShip → 追踪页面 → 自定义域名中输入您的子域名(例如
    tracking.yourstore.com
  2. 添加CNAME DNS记录,将
    tracking.yourstore.com
    指向AfterShip服务器
  3. 更新配送确认邮件,将链接改为
    tracking.yourstore.com/[tracking-number]
    ,而非承运商URL
将追踪功能嵌入现有订单状态页面:
  • 对于Shopify:AfterShip提供主题应用扩展,可将追踪小部件直接嵌入Shopify订单状态页面
  • 对于WooCommerce:AfterShip插件会自动在WooCommerce“我的账户 → 订单”页面添加追踪板块

Step 5: Custom / Headless — webhook-based tracking

步骤5:自定义/无头电商——基于Webhook的追踪

For headless implementations, use EasyPost or Shippo to receive carrier webhooks and normalize tracking events:
typescript
// Register a tracking number with EasyPost to receive webhook updates
async function registerEasyPostTracker(params: {
  trackingNumber: string;
  carrier: string; // 'UPS', 'FedEx', 'USPS', 'DHL'
  orderId: string;
}): Promise<void> {
  const response = await fetch('https://api.easypost.com/v2/trackers', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.EASYPOST_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      tracker: {
        tracking_code: params.trackingNumber,
        carrier: params.carrier,
      },
    }),
  });
  const tracker = await response.json();
  // Store tracker.id to correlate future webhook events with this order
  await db.shipments.update({ tracking_number: params.trackingNumber }, {
    easypost_tracker_id: tracker.id,
  });
}

// Receive EasyPost webhook and update order status
// POST /webhooks/easypost
async function handleEasyPostWebhook(rawBody: Buffer, signature: string): Promise<void> {
  // Verify webhook signature
  const expectedSig = crypto
    .createHmac('sha256', process.env.EASYPOST_WEBHOOK_SECRET!)
    .update(rawBody)
    .digest('hex');
  if (expectedSig !== signature) throw new Error('Invalid webhook signature');

  const event = JSON.parse(rawBody.toString());
  if (event.description !== 'tracker.updated') return;

  const tracker = event.result;
  const shipment = await db.shipments.findByEasyPostTrackerId(tracker.id);
  if (!shipment) return;

  // Normalize EasyPost status to your internal status
  const statusMap: Record<string, string> = {
    pre_transit: 'label_created',
    in_transit: 'in_transit',
    out_for_delivery: 'out_for_delivery',
    delivered: 'delivered',
    failure: 'exception',
    return_to_sender: 'returned',
  };
  const normalizedStatus = statusMap[tracker.status] ?? 'in_transit';

  await db.shipments.update(shipment.id, { status: normalizedStatus });

  // Update order to delivered when package arrives
  if (normalizedStatus === 'delivered') {
    await db.orders.update(shipment.order_id, { status: 'delivered', delivered_at: new Date() });
  }

  // Send notification email at key milestones
  if (['in_transit', 'out_for_delivery', 'delivered', 'exception'].includes(normalizedStatus)) {
    await sendTrackingNotificationEmail(shipment.order_id, normalizedStatus, tracker.tracking_code);
  }
}
对于无头电商实现,可使用EasyPost或Shippo接收承运商Webhook并标准化追踪事件:
typescript
// Register a tracking number with EasyPost to receive webhook updates
async function registerEasyPostTracker(params: {
  trackingNumber: string;
  carrier: string; // 'UPS', 'FedEx', 'USPS', 'DHL'
  orderId: string;
}): Promise<void> {
  const response = await fetch('https://api.easypost.com/v2/trackers', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.EASYPOST_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      tracker: {
        tracking_code: params.trackingNumber,
        carrier: params.carrier,
      },
    }),
  });
  const tracker = await response.json();
  // Store tracker.id to correlate future webhook events with this order
  await db.shipments.update({ tracking_number: params.trackingNumber }, {
    easypost_tracker_id: tracker.id,
  });
}

// Receive EasyPost webhook and update order status
// POST /webhooks/easypost
async function handleEasyPostWebhook(rawBody: Buffer, signature: string): Promise<void> {
  // Verify webhook signature
  const expectedSig = crypto
    .createHmac('sha256', process.env.EASYPOST_WEBHOOK_SECRET!)
    .update(rawBody)
    .digest('hex');
  if (expectedSig !== signature) throw new Error('Invalid webhook signature');

  const event = JSON.parse(rawBody.toString());
  if (event.description !== 'tracker.updated') return;

  const tracker = event.result;
  const shipment = await db.shipments.findByEasyPostTrackerId(tracker.id);
  if (!shipment) return;

  // Normalize EasyPost status to your internal status
  const statusMap: Record<string, string> = {
    pre_transit: 'label_created',
    in_transit: 'in_transit',
    out_for_delivery: 'out_for_delivery',
    delivered: 'delivered',
    failure: 'exception',
    return_to_sender: 'returned',
  };
  const normalizedStatus = statusMap[tracker.status] ?? 'in_transit';

  await db.shipments.update(shipment.id, { status: normalizedStatus });

  // Update order to delivered when package arrives
  if (normalizedStatus === 'delivered') {
    await db.orders.update(shipment.order_id, { status: 'delivered', delivered_at: new Date() });
  }

  // Send notification email at key milestones
  if (['in_transit', 'out_for_delivery', 'delivered', 'exception'].includes(normalizedStatus)) {
    await sendTrackingNotificationEmail(shipment.order_id, normalizedStatus, tracker.tracking_code);
  }
}

Best Practices

最佳实践

  • Use webhooks over polling — carrier webhooks deliver updates in near-real-time; polling every few hours misses same-day events like "out for delivery" and "delivered"
  • Send proactive notifications for exceptions — a delay or failed delivery email from you, before the customer notices, transforms a bad situation into a positive brand moment
  • Show estimated delivery date from day one — AfterShip and most carriers provide an EDD when the label is first scanned; display it on the tracking page and order confirmation email immediately
  • Alert your ops team on exceptions, not just customers — create an internal Slack/email alert for every exception event so your team can proactively resolve issues
  • Deduplicate notification emails — carriers sometimes send duplicate events; ensure your tracking app or custom webhook handler deduplicates based on event type per shipment
  • 优先使用Webhook而非轮询——承运商Webhook可近乎实时地推送更新;每小时轮询会错过“正在配送”和“已送达”等当日事件
  • 主动发送异常通知——在客户发现之前,主动发送延误或配送失败邮件,可将负面情况转化为积极的品牌体验
  • 从一开始就显示预计送达日期——AfterShip和大多数承运商在首次扫描运单标签时就会提供预计送达日期;立即在追踪页面和订单确认邮件中展示该信息
  • 异常事件不仅通知客户,也要提醒运营团队——为每个异常事件创建内部Slack/邮件提醒,以便团队主动解决问题
  • 去重通知邮件——承运商有时会发送重复事件;确保您的追踪应用或自定义Webhook处理程序根据每个包裹的事件类型进行去重

Common Pitfalls

常见问题与解决方案

ProblemSolution
Customer doesn't receive shipping confirmationCheck that Shopify/WooCommerce shipping notification emails are enabled and that the customer's email address was captured at checkout
Tracking page shows "no information available" for daysThis is normal for USPS for 24–48 hours after label creation; set customer expectations in the shipping confirmation email
Exception events not triggering alertsVerify your AfterShip notification settings include exception types; test by using a test tracking number that simulates an exception event
International tracking stops updating mid-journeyInternational handoffs between carriers often cause gaps; log the carrier's native tracking URL and fall back to it when events stop for 48+ hours
问题解决方案
客户未收到配送确认邮件检查Shopify/WooCommerce的配送通知邮件是否已启用,以及结账时是否正确捕获了客户邮箱地址
追踪页面多日显示“暂无可用信息”USPS在创建运单标签后的24-48小时内出现这种情况属于正常现象;在配送确认邮件中提前告知客户此情况
异常事件未触发提醒验证AfterShip的通知设置是否包含异常类型;使用模拟异常事件的测试追踪号码进行测试
国际追踪中途停止更新国际物流中承运商之间的交接常导致信息断层;记录承运商原生追踪URL,当事件停止更新48小时以上时,引导客户查看该URL

Related Skills

相关技能

  • @order-fulfillment-workflow
  • @returns-management
  • @international-shipping
  • @order-management-system
  • @same-day-delivery
  • @order-fulfillment-workflow
  • @returns-management
  • @international-shipping
  • @order-management-system
  • @same-day-delivery