Skip to main content

Events

Design & Features

  • One row per GA4 event
  • Flattened
  • Incremental build (delete + insert)
  • Partitioned by event_date
  • Clustered by event_name, session_id
  • event_id is generated with farm_fingerprint() over: event_name, event_timestamp, user_pseudo_id, GA session ID, batch IDs, transaction ID, engagement time, etc.
  • An is_final flag marks rows that are older than 3 days (72h)
  • Reads from analytics_<property_id>.events_* and optionally fresh_ / intraday_ shards, depending on config
    • A table_suffix column keeps the original shard name.
  • is_measurement_protocol_hit column to flag MP hits.
  • (not set) transaction IDs are converted to NULL.
  • Filter out Audience Events.
  • Create a traffic source struct with this precedence:
    • Manual params (if present).
    • Otherwise, fallback to event params (for backwards compatibility).
    • Otherwise, fallback to UTM parameters.
  • Fix various misattribution issues
  • Contains a wide set of standard & recommended GA4 parameters:
    • Session-level: ga_session_id, ga_session_number, engagement_time_msec, etc.
    • Campaign & traffic: medium, source, campaign, term, gclid, dclid, srsltid, aclid, etc.
    • Page info: page_location, page_referrer, page_title.
    • Ecommerce: currency, shipping, tax, transaction_id, value, etc.
    • Engagement & video: percent_scrolled, video_duration, video_percent, etc.
    • Form, file downloads, search, lead params and more.

Config Options

  • GA4_START_DATE – baseline start date if the table is empty.
  • USE_FRESH_EVENTS, USE_INTRADAY_EVENTS – control whether fresh_* and intraday_* shards are included.
  • EXTRA_GA4_DATASETS_ARRAY – additional analytics datasets to UNION.
  • CUSTOM_EVENT_PARAMS_ARRAY → added to event_params_custom.
  • CUSTOM_USER_PROPERTIES_ARRAY → added to user_properties.
  • CUSTOM_ITEM_PARAMS_ARRAY → added to items.item_params_custom.
  • CUSTOM_URL_PARAMS_ARRAY → added to url_params_custom (if configured).
  • EVENTS_TO_EXCLUDE Event denylist.
  • HOSTNAME_EXCLUDE/HOSTNAME_INCLUDE_ONLY Hostname allowlist / denylist.