Autofill tracking number on the order history page

By adding a data-tracking-number field to the track button code, you can auto-populate the tracking number and allow shoppers to view their order status with just a click.

💻 Pre-input tracking number

  1. Login to your store > Select page to add Track Button > Edit HTML code
  2. 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.

Was this article helpful?
1 out of 2 found this helpful