Identify your URL structure
If you've used our Shopify Theme App or Malomo.js to create your tracking page, identify your base URL for your tracking page. If you've used our Shopify Theme App or Malomo.js to host your tracking page and used a page titled “Order Tracking”; in this case, your base URL would look like: https://yourbrand.com/pages/order-tracking
.
If your tracking page was built by the Malomo implementation team and is currently hosted by Malomo, your URL structure will look like this: https://yourbrand.mymalomo.com/xxxxx/
.
Link to the Tracking Page in Shopify notifications
If you're using Shopify's notifications for events like Shipment Confirmed, Out for Delivery, or Delivered, you can include a link to your tracking page instead of the default order status link from Shopify.
Edit the Shopify notifications with the code below to change where you direct your customers. The code below will not change the look or functionality of the message; it will only direct customers to the tracking page, instead of the carrier's tracking page.
Steps
1. Navigate to the Settings page in your Shopify Admin and click Notifications. Scroll down and click into the Shipping Confirmation email.
2. Copy and paste the following code at the top (line 1) of the "Email body (HTML)” in Shopify:
{% comment %} START MALOMO {% endcomment %} {% comment %} Base URL for Malomo tracking page, e.g. "https://example.mymalomo.com" {% endcomment %} {% assign malomo_base_url = "ADD_BASE_URL_HERE" %} {% if fulfillment.tracking_company %} {% capture carrier %}{{ fulfillment.tracking_company }}{% endcapture %} {% endif %} {% if carrier and carrier != blank and carrier != "Other" %} {% capture tracking_url %}{{ malomo_base_url }}/?_m_alt_id={{ order.id }}&_m_tracking_code={{ fulfillment.tracking_numbers.first }}{% endcapture %} {% elsif order_status_url %} {% capture tracking_url %}{{ order_status_url }}{% endcapture %} {% endif %} {% comment %} END MALOMO {% endcomment %}
3. Replace the example red base URL (https://yourbrand.com/pages/order-tracking
in the HTML above) with your actual base URL.
4. Next search the email code for anywhere that uses this variable: {{ fulfillment.tracking_url }}
and replace it with: {{ tracking_url }}
5. Click Save.
6. Repeat this process for Shipping Update, Out for Delivery, and Delivered emails.
Link to the Tracking Page in Klaviyo emails
If you send your Shipping Confirmation, Delivery, or other messages out of Klaviyo, you can reference the Tracking Page link from any event-driven flow. Build the link for the "Track My Package" button using your base URL and the Malomo Order ID variable: https://brand.mymalomo.com/xxxxx/?_m_id={{ event.order_id }}
Link to the Tracking Page in Attentive
To link customers to your tracking page in Attentive Journeys, build your tracking URL with the {order_id} property, such as this: www.brandname.mymalomo.com/xxxxx/?_m_id={order_id}
Link to the Tracking Page in Postscript
To link customers to your tracking page in Postscript Automations, build your tracking URL with the {{order_id}} tag, such as this: www.brandname.mymalomo.com/xxxxx/?_m_id={order_id}