A validated GA4 id set from the SEO settings tab and served by a small public, cacheable config endpoint containing nothing but that id. The analytics beacon fetches it, and if an id is present injects the gtag script with IP anonymisation on. If no id is set, nothing is injected at all.
Also called: google analytics · GA4 measurement id · analytics tag
- 1The setGa4 action validates the id against the G-XXXXXXX pattern before storing it.
- 2/api/site-config returns { ga4 } and only ever returns an id that still matches the pattern.
- 3The beacon fetches it after load, appends the gtag script, and configures it with anonymize_ip.
- 4A fetch failure is swallowed — analytics must never break the page.
Written in the beacon: "GA4 (Keith 08-20): tag id lives in the platform (SEO settings) — injected here so the static pages never need a rebuild to change it." A measurement id hard-coded into static marketing pages makes swapping properties a code change, and the endpoint is deliberately minimal — "Public, cacheable config for the static marketing pages (GA4 id). No secrets."
- The measurement id was compiled into static pages.
- Analytics configuration required a release.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →