GA4 implementation
How we provision Google Analytics 4 properties and web streams by API for owned sites—process, not a sales pitch.
This page describes what PunkSolid Company actually does in the knowledgepunk.com monorepo for GA4 setup. Confirm Google API behavior against current documentation before you copy steps into a client tenant.
What we automate today
- Script:
scripts/google-gsc-ga4-provision.ts(Search Console domain properties plus GA4 web streams) npm run google:provision -- --registry ai-networkreads domains fromapps/ai-network/src/network/sites.ts- Measurement IDs stored in
apps/ai-network/src/network/ga4-measurement-ids.ts(merged intosites.tsasga4Id) - Storefront sites still use
packages/site-config/src/ga4-measurement-ids.ts - Production-only tag loading in web builds (no GA in dev by default)
Implementation checklist
- Account structure — separate GA4 properties per brand/site where reporting should stay isolated
- Web stream — default URL matches canonical apex; cross-domain only when documented
- Consent — align with your CMP; do not fire tags before allowed
- Events — name purchase and lead events to match backend truth (Medusa order IDs, form endpoints)
- Verification — DebugView smoke test, then GSC sitemap submit per site
What we do not claim
- Guaranteed attribution accuracy in all browsers
- Replacement for finance-grade revenue reporting without reconciliation
- One-size setup for client GA accounts without their Google admin access
For stack context see martech stack. For DNS verification patterns, follow the script’s Cloudflare TXT steps and Google admin console prompts.