SELECT 'outpipe_events' AS table_name, COUNT(*) AS row_count
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_events
UNION ALL
SELECT 'outpipe_event_items', COUNT(*)
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_event_items
UNION ALL
SELECT 'outpipe_user_data', COUNT(*)
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_user_data
UNION ALL
SELECT 'outpipe_user_properties', COUNT(*)
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_user_properties
SELECT *
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_events
WHERE DATE(event_timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
ORDER BY event_timestamp DESC
LIMIT 10
UTC timestamp of when the event occurred, converted from GA4 timestamp_micros. Table partition key (DATE granularity). For offline events this is when reported, not when occurred (see conversion_time_offline).
client_id
STRING
REQUIRED
255
GA4 browser client identifier from the _ga cookie. Persists across sessions for the same browser. Clustering key. Links to outpipe_event_items, outpipe_user_data, and outpipe_user_properties.
pii_mode
STRING
NULLABLE
10
PII handling mode for the event. Values: none (no PII processing — default, no outpipe_user_data row created), hashed (PII fields are SHA-256 hashed), full (raw plaintext PII included — requires explicit consent). When set to hashed or full, a corresponding row is written to outpipe_user_data.
session_id
STRING
NULLABLE
—
GA4 session identifier stored as a Unix timestamp string. Unique per client_id + session_id combination.
session_number
INTEGER
NULLABLE
—
Sequential session count for this client_id (1 = first visit, 2 = second, etc.).
session_engaged
INTEGER
NULLABLE
—
GA4 engagement flag: 1 = engaged session (10+ seconds, 2+ page views, or conversion), = not engaged. Stored as INTEGER (not BOOLEAN) matching actual GA4 implementation.
page_location
STRING
NULLABLE
2048
Full URL where the event occurred, including protocol, domain, path, and query parameters.
page_title
STRING
NULLABLE
500
HTML <title> tag content of the page.
page_referrer
STRING
NULLABLE
2048
Full URL of the referring page. Null for direct traffic or when referrer policy blocks it.
utm_source
STRING
NULLABLE
255
Campaign traffic source from the utm_source URL parameter (e.g., google, facebook, newsletter). Raw value — see source for processed attribution.
utm_medium
STRING
NULLABLE
255
Campaign traffic medium from utm_medium (e.g., cpc, email, organic, social). Raw value — see medium for processed attribution.
utm_campaign
STRING
NULLABLE
255
Campaign name from utm_campaign. Clustering key for fast campaign queries.
utm_term
STRING
NULLABLE
255
Paid search keyword from utm_term. Primarily for Google Ads / Bing Ads.
utm_content
STRING
NULLABLE
255
Ad content differentiator from utm_content (e.g., header_banner, sidebar_cta).
source
STRING
NULLABLE
255
Processed/resolved traffic source after TS-Engine attribution logic. May differ from raw utm_source. Use for final attribution reporting.
medium
STRING
NULLABLE
255
Processed/resolved traffic medium after TS-Engine attribution logic. May differ from raw utm_medium. Use for final channel grouping.
click_id
STRING
NULLABLE
500
Universal click tracking ID from any ad platform (gclid, fbclid, ttclid, msclkid, etc.). Platform identified by click_source.
click_source
STRING
NULLABLE
50
Ad platform that generated the click_id. Values: google_ads, facebook, microsoft_ads, tiktok, twitter, linkedin, pinterest, snapchat, amazon.
user_id
STRING
NULLABLE
255
Authenticated user identifier. Persists across devices/browsers unlike client_id. Links to outpipe_user_data and outpipe_user_properties.
user_agent
STRING
NULLABLE
1000
Raw browser User-Agent string. Parsed into device_category, device_model, device_brand, operating_system, browser.
ip_override
STRING
NULLABLE
45
Client IP address (IPv4 or IPv6). Used for geo-resolution into user_country, user_region, user_city.
accept_language
STRING
NULLABLE
255
Browser Accept-Language header (e.g., en-US,en;q=0.9,th;q=0.8). Used for fingerprinting and locale analytics — reveals user language preferences independently of geo-IP.
user_country
STRING
NULLABLE
2
ISO 3166-1 alpha-2 country code resolved from IP (e.g., US, GB, DE).
user_region
STRING
NULLABLE
100
State/province resolved from IP (e.g., California, Ontario).
user_city
STRING
NULLABLE
100
City name resolved from IP (e.g., San Francisco, London).
SELECT
event_name,
JSON_VALUE(custom_fields, '$.lead_quality') AS lead_quality,
SAFE_CAST(JSON_VALUE(custom_fields, '$.deal_size') AS FLOAT64) AS deal_size
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_events
WHERE JSON_VALUE(custom_fields, '$.lead_quality') = 'high'
PII identity table — stores hashed and optionally plaintext PII for Enhanced Conversions. Populated per-event based on the pii_mode flag set on each event in outpipe_events. Default is none (no PII processing) unless explicitly set per event.
PII consent mode copied from the source event. Values: hashed (SHA-256 hashes only) or full (hashes + plaintext PII). Rows only exist when pii_mode is hashed or full — events with pii_mode=none do not create a user_data row.
source_event_name
STRING
NULLABLE
Event type that provided PII (e.g., checkout_email_captured).
Always filter on partition key to control query costs:
-- Events: filter on event_timestamp
WHERE DATE(event_timestamp) = '2026-02-23'
WHERE DATE(event_timestamp) BETWEEN '2026-02-01' AND '2026-02-28'
-- User data/properties: filter on created_at
WHERE DATE(created_at) >= '2026-01-01'
Join events to items:
SELECT e.event_name, e.transaction_id, i.item_name, i.price, i.quantity
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_events e
JOIN YOUR_PROJECT.YOUR_DATASET.outpipe_event_items i
ON e.event_id = i.event_id
WHERE DATE(e.event_timestamp) = '2026-02-23'
AND e.event_name = 'purchase'
Pivot user properties:
SELECT
client_id,
MAX(IF(property_name = 'membership_tier', property_value, NULL)) AS membership_tier,
MAX(IF(property_name = 'preferred_language', property_value, NULL)) AS preferred_language
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_user_properties
WHERE DATE(created_at) >= '2026-01-01'
GROUP BY client_id
Identity resolution (events to user data):
SELECT e.event_name, e.client_id, e.pii_mode,
u.sha256_email, u.email, u.gorilla_food
FROM YOUR_PROJECT.YOUR_DATASET.outpipe_events e
JOIN YOUR_PROJECT.YOUR_DATASET.outpipe_user_data u
ON e.event_id = u.event_id
WHERE DATE(e.event_timestamp) = '2026-02-23'