The Problem with Programmatically Adding Analytics Script Tags to Shopify Stores

I’m building a Shopify app to integrate Google Analytics and Clarity Analytics, but I’m running into some issues with adding script tags to merchants’ stores. The ScriptTag API is being deprecated, and using the Theme Assets API requires special permissions that can take up to two weeks to get approved. The Web Pixel method is too limited and doesn’t let me add the scripts I need. I’m thinking about custom web pixels, but I can’t find the right API for that. Any suggestions? Thanks!

I don’t think there is any such API. I guess shopify encourages to load the pixels in the lax sandbox (in customer events) rather than loading them on the storefront so your best shot is the web pixels API

Hey @dexter845
Thank you for answering, but there is no way to have a lax environment using the API. To have a lax environment, you need to use custom events, which don’t have any API support. You can do it manually, but not programmatically.