Canonical UTM fields
You’ll commonly see:sm_utm_sourcesm_utm_mediumsm_utm_campaignsm_utm_contentsm_utm_termsm_utm_source_medium(combined convenience field)
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
How SourceMedium normalizes UTM fields and how to query UTM-based dimensions safely.
LOWER(TRIM(value)).sm_utm_sourcesm_utm_mediumsm_utm_campaignsm_utm_contentsm_utm_termsm_utm_source_medium (combined convenience field)SELECT
COALESCE(NULLIF(LOWER(TRIM(sm_utm_source)), ''), '(unknown)') AS sm_utm_source,
COALESCE(NULLIF(LOWER(TRIM(sm_utm_medium)), ''), '(unknown)') AS sm_utm_medium,
COUNT(*) AS order_count,
SUM(order_net_revenue) AS net_revenue
FROM `your_project.sm_transformed_v2.obt_orders`
WHERE is_order_sm_valid = TRUE
AND order_processed_at_local_datetime >= DATETIME_SUB(CURRENT_DATETIME(), INTERVAL 30 DAY)
GROUP BY 1, 2
ORDER BY net_revenue DESC
LIMIT 200;
Was this page helpful?
