问题原文
原帖链接 · Success Man · CC BY-SA 4.0
My score website on gtmetrix is A. When I add facebook pixel code, the scrore is B
Look at this :
How can I solve this problem?
I want to add the Facebook pixel code on my website, but I don't want it to reduce the score
已采纳解答
原帖链接 · Maximillian Laumeister · CC BY-SA 4.0
To answer your questions:
Why adding facebook pixel code reduces the score on gtmetrix?
The reason the Facebook pixel reduces your GTMetrix score is because it is an additional script with a short caching time, and GTMetrix's algorithms give better scores when you have fewer scripts and they have longer caching times.
How can I solve this problem?
Having a "B" score with GTMetrix is not a problem, since GTMetrix is an artificial measurement that only loosely correlates with actual page speed in practice.
I want to add the Facebook pixel code on my website, but I don't want it to reduce the score
The solution to this is to prevent it from blocking page rendering by including it before the end of your body tag instead of in the head tag. This has tradeoffs, however, as it's more likely to be blocked or to not get the chance to finish loading before the user navigates away from the page.
I would not recommend doing this, as it may negatively impact your site. I think it makes much more sense to just be okay with the "B" rating on GTMetrix.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
