Analytics (GA4)
The marketing site reports to Google Analytics 4. The admin reads that data back through a server-side reporting function and shows it in-dashboard.
GA4 property
Section titled “GA4 property”sitecrate.ca reports to GA4 property G-ZQDTTDS80V (this measurement ID is
genuinely public — it ships in the page markup).
All tracking flows through src/analytics.js:
track— preset eventstrackEvent— custom eventstrackPageView— fired on every route change
Tracked events
Section titled “Tracked events”| Event | Fires on |
|---|---|
cta_click | Any primary call-to-action click |
generate_lead | Intake form submission |
pricing_click | Pricing-section interaction |
portfolio_filter | Portfolio filter change |
Status-route privacy
Section titled “Status-route privacy”Hash routes like status/abc-123 are normalized to Project Status before
being sent to GA4 — the raw status_token UUID is never transmitted as a page
title. The capability token stays out of analytics entirely.
Client-site analytics
Section titled “Client-site analytics”Each client site has its own GA4 property. In sitecrate-presence,
src/analytics.js reads CLIENT.gaId, and window.gtag existence is checked
before every call (safe if the GA script hasn’t loaded yet).
Reporting in the admin
Section titled “Reporting in the admin”The admin’s ga-report.js Netlify function pulls GA4 data for sitecrate.ca
(7-day / 30-day windows) and returns { summary, pages, sources, events }. It’s
gated to admin or sales roles and authenticated with a Bearer JWT.
It uses Google OAuth credentials (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET,
GOOGLE_REFRESH_TOKEN) and a GA_PROPERTY_ID — all server-side only. See the
credential index. The SitecrateShell
view renders the result.