The App we’ve developed installs two js scripts through the ScriptTag api and normally they run perfectly on page load. On global.nufferton.com it does not however. This is even though we our logs say that Shopify have them installed. Do you have an idea why the scripts (apprl.js for example) does not run on this specific store? It’s not loaded if you check the network tab.
Your script is not loaded in the script tag, as is evident from this code in the HTML
(function() {
function asyncLoad() {
var urls = ["https:\/\/chimpstatic.com\/mcjs-connected\/js\/users\/b62756cdf4c97a75983500d46\/db2f3afbf35c98a90f8453110.js?shop=nufferton-global.myshopify.com","https:\/\/s3-us-west-2.amazonaws.com\/da-restock\/da-restock.js?shop=nufferton-global.myshopify.com","https:\/\/cdn.hextom.com\/js\/quickannouncementbar.js?shop=nufferton-global.myshopify.com"];
for (var i = 0; i < urls.length; i++) {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src=urls[i];
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
};
if(window.attachEvent) {
window.attachEvent('onload', asyncLoad);
} else {
window.addEventListener('load', asyncLoad, false);
}
})();
You should use the store token and make a GET script tag request with a tool like Postman to double-check. That’s the source of truth, not your logs. I have never seen a script tag that show up in get request not show up on that HTML code.
Hope this helps
@Bunty can’t plain js code run ?
did you find the solution?
I am also facing the same issue, Can anyone help me understand why JavaScript code injected via a scriptTag is functioning properly in some stores but not in one specific store, despite confirming that the injection has occurred successfully?