How to remove Facebook JS from our store?

Solved
cmscss
Shopify Partner
177 2 175

Hey Guys,

How do you stop Facebook JS files from loading? I've tried:

  • Disconnecting the 'Facebook Shop' sales channel
  • Removing the Pixel from Themes > Preferences > Marketing
  • Uninstalling the Facebook app
  • Checking Google Tag Manager for Facebook tags
  • Using Theme Kit to pull the theme locally & searching for 'Facebook' & 'v=2.9.24' & fbevents.js etc
  • Removing all cookies and data associated with our site in Chrome, incase it was distorting the test
  • Waiting several hours after the changes incase Shopify's caching system needed time to update

But despite doing all of the above, we still have multiple Facebook files loading (one is huge):

If JS isn't being loaded from theme files, where on earth do they load from?

Any help would be much appreciated.

Cheers

Ben

 

0 Likes
oreoorbitz
Shopify Partner
97 10 63

Fb files are loaded by content_for_header

 

Use capture and a filter to remove them 

https://community.shopify.com/c/Shopify-Discussion/Benefits-of-content-for-header/m-p/863692#M192756

Available for freelance. I specialize in speed improvement and theme development.
https://www.upwork.com/fl/orionholmes
cmscss
Shopify Partner
177 2 175

So just confirming that Shopify loads this stuff automatically by default - for everyone?

Or is it because uninstalling Facebook apps doesn't also remove calls to associated JS files?

0 Likes
oreoorbitz
Shopify Partner
97 10 63

This is an accepted solution.

Honestly Im not sure, I don't think it's loaded by default. It's probably loaded by an app. But it's pretty hard to trace which app. I read a similar topic on the forums, Somone mentioned an app called Kit.

For things loaded in content for header, there should be a data-loadedBy tag so we know what app is generating what. 

Available for freelance. I specialize in speed improvement and theme development.
https://www.upwork.com/fl/orionholmes
cmscss
Shopify Partner
177 2 175

Removing the Kit app removed the FB JS and page load is noticeably faster on mobile - thank you.

0 Likes