Liquid, JavaScript, themes, sales channels
Hey everyone! I have a Shopify site that has quite a bit optimization potential that I'd like to squeeze out.
This is Google's PageSpeed test for one of the pages: https://developers.google.com/speed/pagespeed/insights/?hl=de&url=https%3A%2F%2Fwww.urbankunst.de%2F...
As you can see, there's quite a bit of unused JavaScript that I'd like to get rid of.
Specifically I want to start by removing the top file: https://connect.facebook.net/signals/config/576182329255766?v=2.9.21&r=stable
I now searched through the source files in my Shopify project (using this Chrome extension) for a reference to that file, but couldn't find anything! Does anyone know a way how I can find out from where this JS file loaded into my site and how I can remove it?
We have this same exact question. We've removed our FB Pixel, yet per google page speed report the unused fb pixel javascript is slowing down our site, but we can't figure out how to remove it.
Note we did already remove the Shopify Install of the FB Pixel
As a test, we even tried adding a '123' to it subsequently and found that just added 2 fb pixel ids.
Any help greatly appreciated!
I wonder that too and to be honest, although I'd like to be wrong, I don't think it's possible since those files are coming from external sources.
The only solution I found was to reduce third party apps/scripts the most I can.
I have thought about a few things like:
1. Identifying and removing scripts before loading the page (adding them right above </head>)
document.querySelector(`script[src*='facebook']`).remove()
2. Also I have seen solutions in the past by companies doing speed optimizations with Shopify that is something like this:
<script>
setTimeout(function() {
function asyncLoad() {
var urls = ["\/\/d1liekpayvooaz.cloudfront.net\/apps\/coin\/coin.js?shop=zenir.myshopify.com","https:\/\/recovermycart.com\/RememberMyCart\/Manage\/CartJS?shop=zenir.myshopify.com\u0026shop=zenir.myshopify.com","https:\/\/qb.boldapps.net\/quantity_breaks.php?shop=zenir.myshopify.com","https:\/\/loox.io\/widget\/N1ZIsn19fS\/loox.js?shop=zenir.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);
}
},6000)();
</script>
the urls variable is added manually. In every Shopify store you can find a list of all the Javascript being injected by the apps, so basically their intent was to load the apps later (?) I'm not entirely sure, but I'm leaving it here if anyone wants to play around with it.
Anyhow, please do let me know if you find a solution!
Does anyone know a way how I can find out from where this JS file loaded into my site and how I can remove it?
I have been going crazy with this for the past 5 days. In addition to removing the FB pixel (in shopify) - have also uninstalled the FB shopping app - and tried to remove the connection to our site (and the pixel) from within the Facebook Business Manager. Absolutely nothing seems to make a difference?
Even when I view the Source Code of our pages - nothing related to this FB file is found anywhere - So - where is it coming from?
Under your settings_data.json,
Change your
"share_facebook": true,
To
"share_facebook": false,
Like if this helped you.
This did not help me. Has anyone figured out a solution?
Did anyone ever find a solution to this?
If the Javascript file in question is being injected by an app (which it is, judging by the screenshot), it's not possible to fix it unless the app is deleted.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024