大网数据广告活动
网站运营与故障问答

Why adding facebook pixel code reduces the score on gtmetrix?

· 52CE 我爱测

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

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。