feat(site): 接入 Google Analytics (G-L02QK4EVDL) + CSP 放行 - #67
Merged
Conversation
在每页 <head> 加入 gtag.js(异步加载器 + 内联 config)。 同步放行严格 CSP(否则 GA 被拦): - script-src 增加 https://www.googletagmanager.com(加载器);内联 config 块由 CSP hash 收集器自动加白名单 - connect-src 增加 google-analytics / analytics.google / googletagmanager (上报埋点) - img-src 增加 google-analytics / googletagmanager(beacon) 验证:重建 42 页;GA 代码在 head;CSP 含上述域名;全站 126 处内联脚本 hash 全命中 CSP(0 缺失,站点不被打断、GA 内联可执行)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
每页 head 加 gtag.js;严格 CSP 同步放行 googletagmanager/google-analytics 域名,GA 内联块 hash 自动加白名单。验证 126 处内联脚本 0 缺失。