Skip to content

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.

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 events
  • trackEvent — custom events
  • trackPageView — fired on every route change
EventFires on
cta_clickAny primary call-to-action click
generate_leadIntake form submission
pricing_clickPricing-section interaction
portfolio_filterPortfolio filter change

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.

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).

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.