Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hello there,
I started yesterday developping my first app. Im looking 2 things :
Thank you 🙂
What is the tracking code's purpose? Is it for a shipment/order, product, or site analytics?
If it's for a shipment, you would use the fulfillment APIs (creating a fulfillment, or creating a Fulfillment Service) and specify the tracking code. Shopify would handle displaying the tracking code in the order details pages for admin and customer.
If it's something related to a product rather than specific orders/users, you could use a metafield to store it.
When using a metafield, it can be accessed in the liquid code and embedded into the html as an attribute (eg, data-my-field="{{ ... }}") or a variable in a script section. Then use javascript to access that attribute or variable.
Or if it's a public metafield, you could also access it from javascript using the Storefront API, say if you had a theme that behaved more like a SPA.
I'm still not sure what kind of tracking purpose. Can you describe it more please?
Can you please also describe what you mean by tracking orders?
User | RANK |
---|---|
14 | |
6 | |
4 | |
3 | |
3 |