The Problem with Programmatically Adding Analytics Script Tags to Shopify Stores

The Problem with Programmatically Adding Analytics Script Tags to Shopify Stores

conversionist
Shopify Partner
90 8 9

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!

Building 100 Shopify apps for that BMW M5 dream

Follow the journey at https://www.youtube.com/@conversinist
https://
conversionist.online/
Buy me a coffee
Replies 2 (2)

dexter845
Shopify Partner
13 3 2

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

conversionist
Shopify Partner
90 8 9

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.

Building 100 Shopify apps for that BMW M5 dream

Follow the journey at https://www.youtube.com/@conversinist
https://
conversionist.online/
Buy me a coffee