Skip to main content
Use the same query standards from the SQL Query Library overview: is_order_sm_valid = TRUE for order analyses, sm_store_id scoping for multi-store setups, and your_project placeholders.
These templates use:
  • sm_transformed_v2.obt_funnel_event_history for event-level lead capture + timing analysis, and
  • sm_experimental.obt_purchase_journeys_with_mta_models for purchase-journey first-touch vs last-touch analysis (MTA).
The MTA tables are experimental: treat results as directional and validate against your owned analytics + business context.
What you’ll learn: Which normalized funnel events are present in your warehouse so you can pick the correct lead-capture event names (email signup, subscribe, generate lead, etc.) without guessing.
What you’ll learn: For users with a lead capture event, how long it takes to reach their next purchase after that lead (p50/p90 hours). Results are broken out by the UTM source/medium on the user’s first lead event. Purchases that happened before the lead are ignored, so a user who bought first and signed up later still counts if they buy again.
What you’ll learn: What share of tracked users with a lead capture event later have a purchase event (identity-based, using DISTINCT event_user_id). Useful for directional lead-to-purchase monitoring.
This is event-identity based (tracking-user-based), not customer-based. Coverage depends on your tracking setup and identity stitching.
What you’ll learn: For purchases, what the first-touch vs last-touch marketing channels were (journey-level). Useful for quantifying “what brings users in” vs “what closes”.
What you’ll learn: How long it takes to convert by acquisition channel, using MTA-derived days-to-conversion (journey-level).
What you’ll learn: Which landing pages are the first-touch landing page for purchases, and the revenue that first-touch attribution assigns to each (directional). Journeys with no valid landing-page touch show as (unknown), and $0 orders are kept in the order count.
What you’ll learn: What customers say drove their purchase (post‑purchase survey tags), and how it differs for new vs repeat orders and subscription orders.
What you’ll learn: How last-click orders attributed to Klaviyo perform, segmented by new vs repeat and subscription sequence. This uses sm_utm_source/sm_utm_medium (last-click) from the order attribution hierarchy.
If you don’t see sm_utm_source = 'klaviyo' in your organization, run the “UTM source/medium discovery” template and choose the exact source values for your messaging stack.

Back to the SQL Query Library.

Funnel

Pair journey timing with step-level conversion analysis.

Messaging

Compare lead capture and journeys with campaign/flow outcomes.

Attribution & Data Health

Validate touchpoint and attribution data quality.