FROM CACHE - en_header

How to remove Facebook JS from our store?

Solved
cmscss
Shopify Partner
184 2 224

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

 

Accepted Solution (1)

Accepted Solutions
oreoorbitz
Shopify Partner
212 26 123

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

If your looking for a pagespeed solution for your Website, take a look at: https://renderbetter.com/

View solution in original post

Replies 14 (14)
oreoorbitz
Shopify Partner
212 26 123

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

If your looking for a pagespeed solution for your Website, take a look at: https://renderbetter.com/
cmscss
Shopify Partner
184 2 224

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?

oreoorbitz
Shopify Partner
212 26 123

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

If your looking for a pagespeed solution for your Website, take a look at: https://renderbetter.com/
cmscss
Shopify Partner
184 2 224

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

Dams-Care
Tourist
15 0 3

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.

eStoreSpeed
Explorer
43 6 12

@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

Subscribe to Shopify speed improvement newsletter (we never spam)
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Dams-Care
Tourist
15 0 3
Hi,Thanks for your reply and offer. https://cervi-care.com
Cosmin_H
New Member
3 0 0

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/...

 

wingnutz
Tourist
6 0 1

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

Dams-Care
Tourist
15 0 3
Ask support team to empty the cache, it might help !
Hari-krishnan
New Member
1 0 0
  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 <head> and </head> 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.

 

FernInteriors
New Member
1 0 0

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.

 

 

oreoorbitz
Shopify Partner
212 26 123

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.

Available for freelance. I specialize in speed improvement and theme development.
https://www.upwork.com/fl/orionholmes

If your looking for a pagespeed solution for your Website, take a look at: https://renderbetter.com/
Chrayley
Excursionist
32 0 11

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...