How to remove Facebook JS from our store?

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

1 Like

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

2 Likes

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?

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.

2 Likes

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

Hi

I don’t have kit installed but i’ve the same problem. What’s strange is that when i comment “content for header” the facebook and google analytics scripts still appears. Seems like they’re loaded automaticaly by shopify.. I’ve contact support which say they have remove the connexion on their side and that it might take more than 20 days to take effect… WTF ?! Are they joking ?!!

Any help would be welcome.

1 Like

@Dams-Care A similar situation to the one your describing happened to us, we removed the facebook and google channels and cleared cache and the requests disappeared. I don’t mind having a look at your site to try and find where these requests originate from. What’s your stores url?

Best,

eStoreSpeedOptimization

Hi,Thanks for your reply and offer. https://cervi-care.com

1 Like

Is there a solution for this issue?

I’ve removed all the FB features from Shopify but google still shows requests like: https://connect.facebook.net/signals/config/...

With great pleasure, we got rid of facebook from our store two months ago as they were slowing down the store and producing no value for us.

Remember to remove the advertising pixel and remove any code within liquid that relates to facebook.

  • m

Ask support team to empty the cache, it might help !

  1. From your Shopify admin, go to Online Store > Themes.
  2. In the Current theme section, click Actions, and select Edit code.
  3. Click the theme.liquid file to open the code editor.
  4. Delete the Facebook pixel code.
  5. You can find it between the and tags.
  6. Click Save.

And

  1. In your Shopify admin, click Online Store > Preferences.
  2. In the Facebook pixel section, click Change.
  3. Delete the Facebook pixel, and then click Save.

Removing the pixel seems to be a little destructive as would this not reduce the data shared with FB for marketing insight?

I am keen to increase the site speed but I need to ensure that it is a measured response.

It’s totally up to the merchant, plenty of large businesses don’t use FB pixel, some have made their own feature in hour (who knows if that would be smaller)
Basecamp, for instance, has no tracking on it’s landing website.

Again, its up the merchant, if you want to have FB, keep FB.

Me too.

I have read somewhere outside of shopify that we should place the Facebook Pixel snippet at the end, just before the closing body tag, and wrap it in a 3s delay timer.

Not sure how to do that though as Shopify automates the inclusion of this code by us adding our Facebook ID to shopify preferences…

I believe the Loox review app loads these Facebook files.