A lot of facebook unused java script

DELONG_HUANG
Excursionist
49 0 8

Hi

 

when I test my website it shows a lot of unused java script from Facebook. Is it because of my Facebook chat plug in that is causing it?

my store: www.minidrago.com

thanks

 

unused java script.JPG

Replies 3 (3)

eStoreSpeed
Explorer
43 6 12

Hi @DELONG_HUANG,

I understand you would like to know the origin of the requests where facebook appears in url. I had a look at your site www.minidrago.com and some of the requests are from your facebook chat and the others are from the facebook pixel (used to track events). See screenshot below for request breakdown.

Screenshot 2021-05-23 at 07.56.51.png

I wouldn't used google page speed insights as an indicator of unused requests, mostly i use it to find ways optimize performance for a site. Consider using a tool like webpagetest.org to find unused requests. 

Hope it helps!

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

JohnCodes
Shopify Partner
134 10 74

hi @DELONG_HUANG 

As mentioned by @eStoreSpeed, your unused Facebook code is related to chat and your tracking pixel.

Unfortunately, there isn't much that can be done to reduce these warnings since the code is being delivered from a 3rd party source. The only way to remove the unused code warnings for Facebook would be to remove your pixel and chat, which we don't recommend. It's just a trade-off you'll have to make in return for having a better customer experience and improved customer tracking details.

What I mentioned above will apply to just about all unused JavaScript warnings coming from 3rd party sources. Not much can be done as long as the particular app is installed, so it's best to keep your app list to a minimum.

I hope this helps!

Developer at SpeedBoostr (Shopify optimization and dev agency).
Try out our Shopify Analyzer (free performance analysis tool).
Check out Order Automator (app that auto tags + fulfills orders, and more automation)
More Apps: Theme Scientist (A/B testing tool), Tip Jar (add a tip button to your store), File Optimizer (optimize CSS, JS, Liquid)

PageFly-Victor
Shopify Partner
7865 1785 3055

Hi @DELONG_HUANG 

As far as I know, there's not much we can do for javascript code from 3rd party (especially for tracking code). I even found Google code show up in Google page speed report for our website.

So if you want to optimize page speed, I'd recommend you check on other tools like this one https://analyze.speedboostr.com/result/fyx23l3lf0 (I've seen another fellow introduce this tool on this forum as well and personally, I think it's useful). The link above is the report of your site.

From the result, you can improve by optimizing images and enable lazy loading:

PageFly_0-1621908006096.png

You can click on each line to see the list of images. We have some recommended free tools for image optimization here if you're interested in 

https://pagefly.link/xQKRAfpQ#01_Optimize_image_loading_times  (more tips in this guide too)

For Lazy loading, you can implement by using code (you may refer to this https://stackoverflow.com/questions/64016582/how-do-i-add-lazy-loading-to-my-product-page-on-shopify) or using a page builder (no code required).

I work for PageFly - a top trusted page builder on Shopify, so it'd be amazing if you can take a look, we offer free plan for you to try (no time limits) and you can enable lazy loading with a single click. 

I hope those information can be useful, if they are, please give me a 'like'

Thank you so much in advance and Have a wonderful day!