I found recently shopify inject a new js called ‘browser.js’ into store HTML. I think it’s a analytics js file. It appears just before the tag.
The code is like:
import webPixelsManager from "[https://cdn.shopify.com/shopifycloud/web-pixels-manager/0.0.164/esm/browser.js](https://cdn.shopify.com/shopifycloud/web-pixels-manager/0.0.164/esm/browser.js)";
......
But I faced issue in China, cdn.shopify.com cannot be visited stably. It is always timeout and I cannot remove or modify this resource. This resource is blocking other requests.
Is there any way to solve a problem like this?
Actually BOOMR and trekkie are bothering me as well, like browser.js, they are automatically injected and not controlled in theme liquid code. And different network issues appear from time to time in China market.
If that’s related to the newer shopify pixels feature be sure to dig through what resources there are to see if disabling is possible such as in admin > settings > customer events.
https://changelog.shopify.com/posts/central-and-secure-customer-behavior-analysis-with-pixels
https://shopify.dev/apps/marketing/pixels
If a file is being rendered as part of the liquid object content_for_header the only approach is to build something to capture and manually parse the output to suppress/change/remove undesired outputs. There are some experiements,discussions about this found around on the internet as shopify doesn’t support mucking with content_for_header
Any such workaround needs to be thouroughly tested, documented and be part of a sites maintenence or logging in case content_for_header behavior changes causing side effects to any workarounds.
Be warned If you simply disable content_for_header that would disable the capabilities of most frontend affecting apps.
Thanks for your information Paul !
There seems to be no way to disable the pixel feature in ADMIN PANEL. Add a new pixel cannot change this original code.
Pixel/BOOMR/trekkie are out of content_for_header, I tried to modify content_for_header but it does not take effect while some other codes are successfully changed.