Articles on: Branded Tracking Page

Autofill Tracking Number on the Order History Page

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



Login to your store > Select page to add Track Button > Edit HTML code
Copy and paste the code below after <body> 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 AfterShip username or custom domain and apply your carrier settings.

Key takeaways



Adding 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.

Updated on: 13/06/2025