Understanding GA4's Evolving Architecture

Key Differences from Universal Analytics

GA4 introduces a flexible event-based model, moving away from category-action-label structures. It supports:

  • Automatic and custom events
  • User-centric reporting with identity stitching
  • BigQuery integration for raw data export

This flexibility increases capability but also expands the surface area for errors, especially during migration or multi-platform integration.

Data Collection Flow

Understanding the data path is key to diagnosing issues:

  1. Frontend tags (GTM, gtag.js) trigger events
  2. Events are batched and sent to GA4 via Measurement Protocol or client libraries
  3. Backend processing adds sessionization, attribution, and dimensions
  4. Data appears in UI (or BigQuery) after ~24 hours

Common Production Issues

1. Event Data Not Appearing in Reports

Causes include:

  • Incorrect measurement ID or configuration
  • Blocked requests by ad blockers or CSP headers
  • Improper event parameters (reserved keywords, type mismatches)

Use the Realtime tab and DebugView for live diagnostics. Check browser console:

// Example console error
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT

2. Duplicate or Missing Conversions

Common root causes:

  • Multiple trigger conditions in GTM firing the same tag
  • Lack of session control in SPA (single-page apps)
  • Inconsistent use of once_per_event settings

3. Traffic Source Misattribution

Issues arise from:

  • Missing or malformed UTM parameters
  • Incorrect cross-domain linking
  • Fragmentation due to 3rd-party redirects

Inspect source, medium, and campaign via BigQuery exports:

SELECT traffic_source.source, COUNT(*)
FROM `project.dataset.events_*`
WHERE event_name = "session_start"
GROUP BY 1

4. Broken Enhanced Measurement

GA4's Enhanced Measurement auto-tracks actions like scrolls, outbound clicks, and video engagement. Problems occur when:

  • JS errors block listeners
  • SPA routes interfere with automatic triggers
  • Events are disabled in UI unintentionally

Solution: Explicitly implement missing events using gtag("event", ...).

5. BigQuery Export Delays or Gaps

Enterprise users relying on BigQuery may experience:

  • Delayed ingestion (beyond 24 hours)
  • Partitioned tables missing expected event rows

Diagnostics:

  • Check project quota and region settings
  • Validate streaming export is enabled

Step-by-Step Fixes

1. Validate Tags with Preview Mode

Use GTM's Preview and Debug mode to verify firing logic. Confirm only one instance of the GA4 config tag is present per page.

2. Use Tag Sequencing for Accurate Ordering

Ensure that dependent tags (e.g., conversions after consent) use sequencing:

// Tag setup in GTM
Tag A: GA4 Config
Tag B: GA4 Event (fires after A completes)

3. Resolve SPA Tracking Gaps

Implement virtual pageviews on route changes:

gtag("event", "page_view", {
  page_location: window.location.href,
  page_path: window.location.pathname,
  page_title: document.title
});

4. Implement Server-Side Tagging

Mitigate ad blockers and improve data quality using server containers in GTM Server-Side setup. Proxy GA4 requests through your domain.

5. Monitor with BigQuery and Custom Alerts

Set up anomaly detection on key metrics using SQL or Looker dashboards. Example:

SELECT event_name, COUNT(*)
FROM `events_*`
WHERE _TABLE_SUFFIX BETWEEN "20240801" AND "20240807"
GROUP BY event_name

Best Practices

  • Always use consistent event naming and parameters
  • Implement consent logic early in tag execution
  • Version control GTM containers using workspaces
  • Use BigQuery for long-term storage and reprocessing
  • Document all custom events and triggers for audits

Conclusion

Google Analytics offers powerful insights, but only when implemented and monitored correctly. Misfired tags, unoptimized configurations, and inconsistent data collection can silently erode trust in analytics outputs. By understanding GA4's data model, proactively validating implementations, and leveraging tools like BigQuery and server-side tagging, teams can maintain a robust and reliable analytics infrastructure that drives accurate business intelligence.

FAQs

1. Why don't my GA4 events show in real-time?

Possible causes include blocked network requests, incorrect tag configuration, or client consent restrictions. Use DebugView for immediate validation.

2. How do I track virtual pageviews in SPAs?

Manually trigger page_view events on route changes using gtag or GTM with history change listeners.

3. Can GA4 handle multiple domains?

Yes, but cross-domain linking must be explicitly configured using linker parameters or tag settings.

4. What's the best way to debug missing conversions?

Use GTM Preview mode and browser dev tools to inspect tag firing, triggers, and network calls to GA4 endpoints.

5. How do I export GA4 data for advanced analysis?

Enable BigQuery linking in the GA4 property settings. Use SQL for querying raw event data with custom filters and aggregations.