How to Track Orders Generated by a Shopify App Extension

I’m building a Shopify embedded app extension that appears as a floating bubble. When users click on the bubble, a modal opens displaying products they can choose from. Once they select a product, they are redirected to the product detail page, where they can add the product to their cart and proceed to checkout. I need to track the orders that include products selected through the app extension. How can I achieve this?

I’m using Remix framework.

You can generate unique visitor token and store it in local storage.

And you can add track purchased order in web pixel extension(checkout_completed event).