Skip to main content

Autofill Tracking Number on the Order History Page

Autofill Tracking Number on the Order History Page in AfterShip Tracking: follow setup steps, configure key options, verify behavior, and avoid setup errors.

Written by Harneet Kaur

Using the new AfterShip Platform?

This works differently in the new AfterShip Platform. You can now manage it in the Order lookup widget in Branded pages > Page insertion. For steps, see Set up the Order Lookup Widget (Track Button).

Overview

Enhance your store’s post-purchase experience by pre-filling the tracking number in the AfterShip Track Button. By auto-populating the tracking number, you allow shoppers to view their order status instantly with a single click, eliminating the need for manual input.

Pre-input tracking number

  1. Log in to your store > Select page to add Track button > Edit HTML code

  2. Copy and paste the code below after the tag:

<div id="as-root"></div><script>(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n))return;r=e.createElement(t);r.id=n;r.src="//button.aftership.com/all.js";i.parentNode.insertBefore(r,i)})(document,"script","aftership-jssdk")</script><div data-domain="track.aftership.com" data-tracking-number="12345678" data-size="large" class="as-track-button"></div>

You can also replace data-domain=”track.aftership.com” with an AfterShip username or a custom domain and apply your carrier settings.

Key takeaways

  • Adding a data-tracking-number to the Track Button auto-fills the tracking field for customers.

  • This setup provides instant tracking access and a better self-service experience.

  • The feature reduces support requests and enhances customer satisfaction.

  • The button code can be customized with your AfterShip domain or username for consistent branding.

Did this answer your question?