Skip to content

Google Analytics Runbook

Updated: 2026-07-06

Scope

This runbook covers public analytics for:

SiteRepoRuntime env
book.designcorp.eu/home/admin/workspace/BookDesignCorp/opt/designcorp/book-designcorp/prod/shared/.env.local
designcorp.eu/home/admin/workspace/designcorp/opt/designcorp/designcorp/prod/.env
hub.designcorp.eu/home/admin/workspace/hub/opt/designcorp/hub/prod/.env

Source Of Truth

Current GA4 web streams in account Design Corporation, property Design Corp - GA4:

SiteGA4 Measurement IDWeb stream ID
book.designcorp.euG-FYLFVL29ND15207835113
designcorp.euG-108T4DY8424170263498
hub.designcorp.euG-6TXTDX5C3J15207821962

Cabinet Map

Use one GA4 property for the DesignCorp ecosystem, with one Web stream per site.

QuestionGA screenHow to read it
Which sites are connected?Admin -> Data streamsOne row per site: stream name, site URL, stream ID, recent traffic status
Is tracking live right now?Reports -> Realtime overviewCheck active users and the Views / Page title and screen name card
Which site is a page from?Reports -> Engagement -> Pages and screensAdd or use dimension Stream name / Hostname when the table needs site separation
Where did visitors come from?Reports -> AcquisitionUse Session source / medium, Default channel group, then compare/filter by Stream name
Which pages lead to action?Reports -> Engagement -> EventsWatch generate_lead, submit_lead, telegram_click, email_click
Which events are business goals?Admin -> Data display -> Events -> Key eventsMark lead/funnel events as key events after GA has received them

Current UI state:

  • Reports snapshot has been initialized with the User behavior template.
  • Realtime overview has confirmed page views for:
    • book.designcorp.eu
    • designcorp.eu
    • hub.designcorp.eu
  • Saved comparisons should use Stream name (Название потока) with exact matching. GA may only show stream values after the stream has processed data in reports, so newly-created streams can appear in Realtime before they appear in the saved-comparison value picker.

Recommended saved comparisons:

NameDimensionMatchValue
Site - BookDesignCorpStream nameexactly matchesBook Design Corp - GA4
Site - DesignCorpStream nameexactly matchesDesign Corp - GA4
Site - HubDesignCorpStream nameexactly matchesHub Design Corp - GA4

Use the saved comparisons across reports when the question is "what happened on each site?" Use All Users only for total DesignCorp ecosystem traffic.

Use direct GA4 first:

bash
NEXT_PUBLIC_GA4_ID=G-XXXXXXXXXX
NEXT_PUBLIC_GTM_ID=

Use GTM only when we intentionally manage tags/conversions inside Google Tag Manager:

bash
NEXT_PUBLIC_GA4_ID=
NEXT_PUBLIC_GTM_ID=GTM-XXXXXXX

Avoid enabling direct GA4 and a GTM container that also fires GA4 page views for the same site. That creates duplicate sessions/events.

Current Code Contract

Each site has an analytics runtime that:

  1. Does not load tags on dev hosts or when IDs are empty/placeholders.
  2. Sets Google Consent Mode defaults before sending events.
  3. Shows a small consent prompt when a real tag ID is present and no stored choice exists.
  4. Sends route-level page_view manually with send_page_view: false.
  5. Tracks telegram_click, email_click, and outbound_click through delegated link clicks.
  6. Excludes admin paths such as /admin, /ru/admin, /ua/admin, /pl/admin, /it/admin.

Event Taxonomy

EventPurpose
page_viewManual page view for App Router route changes
form_startVisitor starts a lead form
generate_leadGA4-recommended lead conversion event
submit_leadInternal custom lead event kept for existing dashboards
form_submit_successForm success diagnostics
form_submit_errorForm failure diagnostics
telegram_clickTelegram funnel entry
email_clickEmail contact click
outbound_clickExternal link click
analytics_consent_updateConsent choice changed/stored

Business Goals

Use these events as business-facing goals:

PriorityEventMeaningKey event status
P0generate_leadLead submitted through a site formMark as key event after first real lead event appears
P0telegram_clickVisitor entered the Telegram funnelMark as key event after first real Telegram click appears
P1submit_leadInternal lead-submit tracking eventKeep for diagnostics or mark as key event only if generate_lead is missing
P1email_clickVisitor clicked email contactOptional key event

Do not generate fake lead submissions just to make events appear in GA. Use real traffic or a clearly-labeled test window, then annotate the date if a test lead is unavoidable.

Google Setup

  1. In Google Analytics, create or open a GA4 property.
  2. Create one Web data stream per production domain:
    • https://book.designcorp.eu
    • https://designcorp.eu
    • https://hub.designcorp.eu
  3. Copy each stream Measurement ID. GA4 Measurement IDs use the G-... format.
  4. Put the matching ID into the production env file for that site.
  5. Rebuild/redeploy the site through the normal CI/CD path.
  6. Open the production site, accept analytics, and verify events in Realtime/DebugView.
  7. Mark generate_lead as a key event when lead tracking is confirmed.
  8. Create saved comparisons for each stream using Stream name so normal reports can be split by site.

VNC Workflow

If Google login is required, open GA in the VNC browser and let the owner complete authentication. Do not ask for raw Google passwords or recovery codes in chat.

After login, the agent can read/copy:

  • property name;
  • web stream URL;
  • Measurement ID;
  • whether GTM is already installed for the same domain.

References

  • Google: Consent Mode setup: https://developers.google.com/tag-platform/security/guides/consent
  • Google: GA4 Measurement ID: https://support.google.com/analytics/answer/12270356
  • Google: Find Google tag ID / manual install: https://support.google.com/analytics/answer/9539598
  • Google: GA4 recommended events: https://support.google.com/analytics/answer/9267735
  • Google: Apply comparisons to reports: https://support.google.com/analytics/answer/9269518