feat(analytics): add Google Tag Manager for hosted environments#3993
feat(analytics): add Google Tag Manager for hosted environments#3993waleedlatif1 merged 1 commit intostagingfrom
Conversation
PR SummaryMedium Risk Overview The new scripts are injected via Next.js Reviewed by Cursor Bugbot for commit b04e815. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryAdds Google Tag Manager and Google Analytics 4 (
Confidence Score: 5/5Safe to merge — change is minimal, cleanly gated behind isHosted, and prior P1 concerns are resolved. All remaining findings are P2 (potential analytics misconfiguration that cannot be confirmed from the codebase alone). No runtime errors, security issues, or data-loss risks introduced. apps/sim/app/layout.tsx — verify GTM container configuration does not also fire a GA4 tag for G-DR7YBE70VS to avoid double-counting. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant GTM as GTM (GTM-T7PHSRX5)
participant GA4 as GA4 (G-DR7YBE70VS)
participant ODS as OneDollarStats
Note over Browser: isHosted = true
Browser->>GTM: Load gtm.js (afterInteractive)
GTM-->>GA4: Fire GA4 tag (if configured in container)
Browser->>GA4: Load gtag/js?id=G-DR7YBE70VS (afterInteractive)
Browser->>GA4: gtag('config', 'G-DR7YBE70VS') — direct init
Note over GA4: ⚠️ Potential double-counting if GTM also fires GA4
Browser->>ODS: Load stonks.js (defer)
Note over Browser: isHosted = false → GTM & GA4 skipped, ODS still loads
Reviews (2): Last reviewed commit: "feat(analytics): add Google Tag Manager ..." | Re-trigger Greptile |
3b73fc2 to
bbf0769
Compare
bbf0769 to
8ef25bd
Compare
8ef25bd to
b04e815
Compare
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b04e815. Configure here.
Summary
isHostedso self-hosted/OSS deployments are unaffectedType of Change
Testing
Tested manually
Checklist