gtm-present
它能做什么
这项技能审查 Google Tag Manager 的设置方式,以及它让页面变慢的程度。适用于使用 GTM 进行分析和广告的网站所有者和开发者。
适用场景
- ✓当你添加 Google Tag Manager 后页面感觉变慢的时候。
- ✓当你的容器中有许多陈旧或未使用的标签的时候。
- ✓当你希望把部分追踪工作从访客的浏览器中移出的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/gtm-present/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查 Google Tag Manager 是否拖慢了我的网站。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会查看 GTM 脚本的加载方式,并统计运行的标签和触发器数量。它会建议移除未使用的标签、异步加载,并考虑服务器端标签。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Optimize Google Tag Manager implementation
An unoptimized GTM setup can lead to significant main-thread blocking and increased page weight, slowing down the overall user experience.
Quick Reference
- Place the GTM script in the
<head>but audit its impact - Minimize the number of tags and triggers to reduce execution
- Use Server-Side GTM to offload processing from the client
Check
Verify that GTM is implemented correctly and evaluate its impact on page performance using Lighthouse.
Fix
Clean up unused tags, use asynchronous loading, and consider moving to a server-side implementation.
Explain
Explain how GTM affects performance and how to balance tracking needs with speed.
Code Review
Review the routes, assets, and loading behavior that affect Optimize Google Tag Manager implementation. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/gtm-present
常见问题
什么是服务器端 GTM?
它将部分标签处理转移到服务器上,使访客浏览器中运行的工作减少。
如何衡量影响?
这项技能建议使用 Lighthouse,查看 GTM 对主线程和页面体积的影响。
应该移除 GTM 吗?
这项技能并不建议移除它,而是建议在追踪需求与速度之间取得平衡。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Optimize Google Tag Manager implementation. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2863
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。