Skip to main content

Overview

Use these queries as starting points for analysis in BigQuery. Replace your_project with your BigQuery project ID (e.g., sm-yourcompany) and your-sm_store_id with your store identifier.
Query Standards:
  • Always include is_order_sm_valid = TRUE for order-based analyses
  • If you have multiple stores, add sm_store_id = 'your-sm_store_id' to filter for a specific store’s data
  • Use your_project.sm_transformed_v2.* for standard tables
  • Use your_project.sm_experimental.* for MTA tables
If you’re not sure which table to use, start with: obt_orders and obt_order_lines.

Browse by Category


CategoryTopics
Marketing & AdsCAC, ROAS by platform, ROAS trends
MessagingEmail/SMS performance, flows vs campaigns, list growth
FunnelFunnel step counts, conversion rates, top converting pages
Journeys & Lead CaptureLead capture → purchase timing, landing pages, first vs last touch (MTA)
Customers & RetentionFirst vs repeat orders, repeat rates by source, new vs repeat trends
ProductsTop products by revenue/units, gateway products, product combos
Orders & RevenueAOV by channel, subscription revenue, refund rates, sales channel mix
LTV & RetentionCohort LTV, payback period, LTV:CAC, repeat purchase rates, 90-day LTV by product
Attribution & Data HealthTable freshness, UTM coverage, fallback signals, click-id coverage, tracking regressions
Customer SupportTicket volume, one-touch rate, resolution time, CSAT

Most examples default to the last 30 days for performance and “current state” analysis. Adjust the timeframe and add sm_store_id scoping when needed.

Request a Query

Have a question that’s not covered here? We regularly add new queries. If there’s a template you’d like added (subscription churn, cohort LTV curves, creative performance, etc.), reach out to your SourceMedium team and include the business question and the table(s) you’re using.