Hi there,
We previously used ScriptTag
to inject custom JavaScript for analytics tracking on the Shopify checkout order confirmation page. Since ScriptTag
is being deprecated, we’re looking for an alternative method to add custom scripts—specifically for the order confirmation page—without relying on theme extensions.
Is there any supported approach via the Shopify API or Admin settings that allows us to inject JavaScript into the checkout’s thank-you page, particularly for analytics or conversion tracking purposes?
We’re aware of the limitations around modifying the checkout for non-Plus merchants but would appreciate any guidance or workarounds that comply with Shopify’s current platform policies.
Thanks in advance!
Hi there
Since Shopify is moving toward a more secure and structured way of handling analytics and tracking, I’d recommend using the Shopify Pixels as the supported alternative
With Shopify Pixels, you can create a custom pixel that listens to events like checkout_completed and purchase, and runs JavaScript specifically on the order confirmation (thank-you) page
Include your tracking or analytics logic inside event listeners like:
analytics.subscribe(‘checkout_completed’, (event) => {
// Your custom script here (e.g., send to Google Analytics, Meta Pixel etc.)
})
Let me know if you need help setting up the custom pixel or migrating your current tracking logic—I’d be happy to assist
Thanks again!
1 Like
@Arman_ali_1 Appreciate your prompt response.
Do we need to create an app extension in order to add a Shopify Pixel?
Our app is focused on SEO, so we don’t have any frontend components that would appear as an Extension. We’re specifically looking for a method to add a Pixel that doesn’t require building an extension.
Hi @user072319
You can create custom event for such cases, you can do it via Settings → Customer events
If there is a public app available for your case, they will provide such event, if not then you can create a custom event directly from customer events and add your javascript there, to send event you can subscribe to shopify analytics methods and send your payload to your script
You can find list of events here that you can subscribe to: https://shopify.dev/docs/api/web-pixels-api/standard-events
Thanks!
1 Like
No you don’t need to create an app extension just to add a Shopify Pixel
Shopify allows you to create and manage custom pixels directly through the admin under Settings > Customer events
From there you can add a custom pixel using plain JavaScript that listens to events like checkout_completed
This method doesn’t require any frontend component or extension
1 Like
@Arman_ali_1 Thanks for the clarification!
Yes, we’re aware of the custom pixel option through Settings > Customer events, but as I understand, that’s a manual setup per store, right?
We’re specifically looking for a programmatic/API-based solution, since we have 150+ Shopify merchants using our app and manual setup for each store isn’t scalable. We’d prefer to handle this via API if Shopify allows it—without requiring an app extension, as we don’t have any UI or storefront features to expose through an extension interface.
If you know whether custom pixels can be registered/managed via API without using app extension, or if there’s another approved approach to inject custom JS on the thank-you page, we’d really appreciate the guidance.
Thanks again!