How to write custom pixel code in my shopify app so when install app add code to custompixel.

I have created app using remix template.

I want that when shopify admin install pirsch-demo1 app. Following Customer events >> custom pixel should automatically created to track purchase and want to show that data in pirsch analytics.

This custom pixel code runs only when order is successfully placed. Currently I created pirsch Custom pixel manually. I want to create it through my shopify app. How can I do that. Please guide me.

Hey @jayeshcspl1 , Do you get any workaround for your question? I am struck to similar problem. When creating custom pixel from Shopify Admin/customer events page, I am able to write the JS code that have access to window and document object because the custom pixel loads in LAX sandbox environment. But if we want to deploy/manage the custom pixel via code/app, it is not supported. Shopify supports web app pixels which the App owners can write, maintain and deploy via code through their apps. But the web pixels load in STRICT sandbox environment, web pixels are loaded through web workers which doesn’t have access to window and document object and hence can’t embed JS using script tag in web pixel.

Do you get the solution of using JS that you are trying to load via document.createElement in web pixel?