sessions
The sessions schema captures online store sessions, with one row per session. Use it to report on storefront behavior, traffic, engagement, devices, geography, and the conversion funnel.
Anchor to Use casesUse cases
- Traffic by geography: Group
sessionsandonline_store_visitorsbysession_countryorsession_regionto break traffic and distinct visitors down by location. - Engagement: Show
pageviews,pageviews_per_session, andaverage_session_durationtogether to gauge how deeply visitors engage with the store. - Closed funnel: Use
sessions_with_cart_additions,sessions_that_reached_checkout, andsessions_that_completed_checkoutto trace where sessions drop out of the purchase funnel. - Conversion breakdown: Break down
bounce_rateorconversion_ratebysession_device_browser,session_device_os, orsession_api_clientto see which devices and clients convert best.
ShopifyQL
Examples
Description
Track the session-to-checkout funnel day by day this month, against the prior period. This example uses [`WHERE`](/docs/api/shopifyql/2026-01/syntax/where) `human_or_bot_session = 'human'` to filter out bots.
ShopifyQL
FROM sessions SHOW sessions, online_store_visitors, sessions_with_cart_additions, sessions_that_reached_checkout, sessions_that_completed_checkout, conversion_rate WHERE human_or_bot_session = 'human' TIMESERIES day WITH PERCENT_CHANGE DURING this_month COMPARE TO previous_period ORDER BY day ASC VISUALIZE sessions, conversion_rate TYPE lineDescription
Rank the top 50 referrer-and-device pairs by `sessions_that_completed_checkout` since the start of last year. This example uses [`GROUP_TOTALS`](/docs/api/shopifyql/2026-01/syntax/with#group-total-columns) to subtotal each referrer across its devices.
ShopifyQL
FROM sessions SHOW sessions, conversion_rate, sessions_that_completed_checkout, average_session_duration GROUP BY referrer_source, session_device_type WITH TOTALS, GROUP_TOTALS HAVING sessions > 100 SINCE last_year UNTIL today ORDER BY sessions_that_completed_checkout DESC LIMIT 50 VISUALIZE sessions_that_completed_checkout TYPE stacked_horizontal_barDescription
Track daily `pageviews` for human sessions, with `pageviews_per_session` and `bounces`, last month. This example uses [`WHERE`](/docs/api/shopifyql/2026-01/syntax/where) `human_or_bot_session = 'human'` to exclude bot traffic.
ShopifyQL
FROM sessions SHOW pageviews, pageviews_per_session, bounces WHERE human_or_bot_session = 'human' TIMESERIES day DURING last_month ORDER BY day ASC VISUALIZE pageviews TYPE lineDescription
Rank `average_session_duration` by `session_device_type` last month. This example uses [`GROUP BY`](/docs/api/shopifyql/2026-01/syntax/group-by) `session_device_type` to split session duration across device types.
ShopifyQL
FROM sessions SHOW average_session_duration GROUP BY session_device_type WITH TOTALS DURING last_month ORDER BY average_session_duration DESC LIMIT 10 VISUALIZE average_session_duration TYPE horizontal_bar
Anchor to MetricsMetrics
Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.
Metrics you can use when querying FROM sessions.
- Anchor to added_to_cart_rateadded_
to_ cart_ rateadded_ to_ cart_ rate PERCENTPERCENT The share of online store visits where a visitor added at least one item to the cart.
Added to cart rate = sessions with cart additions / sessions- Anchor to average_session_durationaverage_
session_ durationaverage_ session_ duration SECOND_DURATIONSECOND_DURATION Average duration, in seconds, of online store visits
- Anchor to bounce_ratebounce_
ratebounce_ rate PERCENTPERCENT Percentage of online store visits that ended after a single pageview
Bounce rate = bounces / sessions- Anchor to bouncesbouncesbouncesINTEGERINTEGER
Online store visits that ended after a single pageview
- Anchor to checkout_conversion_ratecheckout_
conversion_ ratecheckout_ conversion_ rate PERCENTPERCENT For visits that reached checkout, the share that completed a purchase.
Checkout conversion rate = sessions that completed checkout / sessions that reached checkout- Anchor to completed_checkout_ratecompleted_
checkout_ ratecompleted_ checkout_ rate PERCENTPERCENT For visits where a visitor added items to cart and reached checkout, the share that completed a purchase.
Completed checkout rate = sessions with cart additions that reached checkout and completed checkout / sessions with cart additions that reached checkout- Anchor to conversion_rateconversion_
rateconversion_ rate PERCENTPERCENT Percentage of online store visits (sessions) that resulted in a sale
Conversion rate = sessions that completed checkout / sessions- Anchor to online_store_visitorsonline_
store_ visitorsonline_ store_ visitors INTEGERINTEGER The number of unique visitors to your online store. A visitor might have multiple sessions.
- Anchor to pageviewspageviewspageviewsINTEGERINTEGER
Total pageviews across all online store visits
- Anchor to pageviews_per_sessionpageviews_
per_ sessionpageviews_ per_ session DECIMALDECIMAL Average number of pageviews per online store visit
Pageviews per session = pageviews / sessions- Anchor to reached_checkout_ratereached_
checkout_ ratereached_ checkout_ rate PERCENTPERCENT Online store visits that reached checkout relative to total visits
Reached checkout rate = sessions that reached checkout / sessions- Anchor to sessionssessionssessionsINTEGERINTEGER
Number of online store visits
- Anchor to sessions_that_completed_checkoutsessions_
that_ completed_ checkoutsessions_ that_ completed_ checkout INTEGERINTEGER Online store visits in which a purchase was completed
- Anchor to sessions_that_reached_and_completed_checkoutsessions_
that_ reached_ and_ completed_ checkoutsessions_ that_ reached_ and_ completed_ checkout INTEGERINTEGER Online store visits in which the checkout page was reached, then purchase was completed
- Anchor to sessions_that_reached_checkoutsessions_
that_ reached_ checkoutsessions_ that_ reached_ checkout INTEGERINTEGER Online store visits in which the checkout page was reached
- Anchor to sessions_with_cart_additionssessions_
with_ cart_ additionssessions_ with_ cart_ additions INTEGERINTEGER Online store visits in which a visitor added an item to cart
PERCENT
A percentage value represented as a decimal, where 0.25 represents 25%.
SECOND_DURATION
A duration measured in seconds.
INTEGER
A whole number without decimal places, used for counts, quantities, and other discrete numeric values.
DECIMAL
A precise decimal number used for calculations where fixed-point precision matters.
Anchor to DimensionsDimensions
Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.
Dimensions you can use when querying FROM sessions.
- Anchor to customer_idcustomer_
idcustomer_ id IDENTITYIDENTITY - Anchor to daydaydayDAY_TIMESTAMPDAY_TIMESTAMP
The day an online store visit started.
- Anchor to day_of_weekday_
of_ weekday_ of_ week DAY_OF_WEEKDAY_OF_WEEK The day of the week an online store visit started, with values Monday through Sunday.
- Anchor to hourhourhourHOUR_TIMESTAMPHOUR_TIMESTAMP
The hour an online store visit started.
- Anchor to hour_of_dayhour_
of_ dayhour_ of_ day HOUR_OF_DAYHOUR_OF_DAY The hour of day an online store visit started, with values 0 through 23.
- Anchor to human_or_bot_sessionhuman_
or_ bot_ sessionhuman_ or_ bot_ session STRINGSTRING Whether an online store visit comes from a human visitor (Human) or an automated bot (Bot).
- Anchor to landing_page_pathlanding_
page_ pathlanding_ page_ path STRINGSTRING Values contain only the page path, such as
, and the homepage appears as/.- Anchor to landing_page_typelanding_
page_ typelanding_ page_ type STRINGSTRING The type of page a visitor first landed on, such as a product page, collection page, or homepage.
- Anchor to landing_page_urllanding_
page_ urllanding_ page_ url STRINGSTRING Values include the domain and page path for the page where the visit begins.
- Anchor to minuteminuteminuteMINUTE_TIMESTAMPMINUTE_TIMESTAMP
The minute an online store visit started.
- Anchor to monthmonthmonthMONTH_TIMESTAMPMONTH_TIMESTAMP
The month an online store visit started.
- Anchor to month_of_yearmonth_
of_ yearmonth_ of_ year MONTH_OF_YEARMONTH_OF_YEAR The month of the year an online store visit started, with values 1 through 12.
- Anchor to quarterquarterquarterQUARTER_TIMESTAMPQUARTER_TIMESTAMP
The quarter an online store visit started.
- Anchor to referrer_domainreferrer_
domainreferrer_ domain STRINGSTRING Values are referring site domains such as google.com, facebook.com, or pinterest.com.
- Anchor to referrer_namereferrer_
namereferrer_ name STRINGSTRING Name of the site that led to the online store visit
- Anchor to referrer_pathreferrer_
pathreferrer_ path STRINGSTRING - Anchor to referrer_sitereferrer_
sitereferrer_ site STRINGSTRING Site that led to the online store visit
- Anchor to referrer_sourcereferrer_
sourcereferrer_ source STRINGSTRING Referrer type that led to the online store visit (organic, email, etc.)
- Anchor to referrer_termsreferrer_
termsreferrer_ terms STRINGSTRING - Anchor to referrer_urlreferrer_
urlreferrer_ url STRINGSTRING The external page that sent the visitor to your online store. The same referring page groups together regardless of query parameters.
- Anchor to rollout_idsrollout_
idsrollout_ ids ARRAY<INTEGER>ARRAY<INTEGER> A session might include more than one rollout ID when the visitor is exposed to multiple active rollouts.
- Anchor to rollout_treatment_idsrollout_
treatment_ idsrollout_ treatment_ ids ARRAY<INTEGER>ARRAY<INTEGER> A session might include more than one rollout treatment ID when the visitor is exposed to multiple active treatments.
- Anchor to secondsecondsecondSECOND_TIMESTAMPSECOND_TIMESTAMP
The second an online store visit started.
- Anchor to session_api_clientsession_
api_ clientsession_ api_ client STRINGSTRING The storefront client used for the online store visit, such as Hydrogen, headless, or Online Store.
- Anchor to session_bouncedsession_
bouncedsession_ bounced BOOLEANBOOLEAN Values are
truewhen the online store visit ended after a single pageview andfalsewhen it continued past the first pageview.- Anchor to session_citysession_
citysession_ city STRINGSTRING City from which a visitor browsed your online store
- Anchor to session_countrysession_
countrysession_ country STRINGSTRING Country from which a visitor browsed your online store
- Anchor to session_country_codesession_
country_ codesession_ country_ code STRINGSTRING Country code of the country from which a visitor browsed your online store
- Anchor to session_device_browsersession_
device_ browsersession_ device_ browser STRINGSTRING Browser used to visit your online store
- Anchor to session_device_browser_versionsession_
device_ browser_ versionsession_ device_ browser_ version STRINGSTRING Version number of the browser used to visit your online store
- Anchor to session_device_ossession_
device_ ossession_ device_ os STRINGSTRING Operating system of the device used for visiting your online store
- Anchor to session_device_os_versionsession_
device_ os_ versionsession_ device_ os_ version STRINGSTRING Operating system version of the visitor's device
- Anchor to session_device_typesession_
device_ typesession_ device_ type STRINGSTRING The kind of device a visitor uses to browse your store, such as Desktop, Mobile, Tablet, or Smart TV.
- Anchor to session_durationsession_
durationsession_ duration INTEGERINTEGER Duration, in seconds, of the online store visit
- Anchor to session_idsession_
idsession_ id STRINGSTRING Shopify identifier for a visit to your online store
- Anchor to session_regionsession_
regionsession_ region STRINGSTRING State or province from which a visitor browsed your online store (e.g., California, Ontario)
- Anchor to shop_idshop_
idshop_ id IDENTITYIDENTITY - Anchor to utm_campaignutm_
campaignutm_ campaign STRINGSTRING - Anchor to utm_contentutm_
contentutm_ content STRINGSTRING - Anchor to utm_mediumutm_
mediumutm_ medium STRINGSTRING - Anchor to utm_sourceutm_
sourceutm_ source STRINGSTRING - Anchor to utm_termutm_
termutm_ term STRINGSTRING - Anchor to weekweekweekWEEK_TIMESTAMPWEEK_TIMESTAMP
The week an online store visit started.
- Anchor to week_of_yearweek_
of_ yearweek_ of_ year WEEK_OF_YEARWEEK_OF_YEAR The week of the year an online store visit started, with values 1 through 53.
- Anchor to yearyearyearYEAR_TIMESTAMPYEAR_TIMESTAMP
The year an online store visit started.
- Anchor to abandoned_checkout_dateabandoned_
checkout_ dateabandoned_ checkout_ date DAY_TIMESTAMPDAY_TIMESTAMP Date the customer most recently abandoned a cart
- Anchor to customer_account_statuscustomer_
account_ statuscustomer_ account_ status STRINGSTRING The customer's account state, with values Declined, Disabled, Enabled, and Invited.
- Anchor to customer_added_datecustomer_
added_ datecustomer_ added_ date DAY_TIMESTAMPDAY_TIMESTAMP The day the customer record was added, reported in your store's time zone.
- Anchor to customer_created_by_app_idcustomer_
created_ by_ app_ idcustomer_ created_ by_ app_ id IDENTITYIDENTITY The Shopify identifier for the app that created the customer.
- Anchor to customer_emailcustomer_
emailcustomer_ email STRINGSTRING Email address of the customer
- Anchor to customer_email_domaincustomer_
email_ domaincustomer_ email_ domain STRINGSTRING The part of the customer's email address after the @ symbol, such as gmail.com or your company's domain.
- Anchor to customer_languagecustomer_
languagecustomer_ language STRINGSTRING Language associated with the customer
- Anchor to customer_namecustomer_
namecustomer_ name STRINGSTRING Full name of the customer
- Anchor to shop_nameshop_
nameshop_ name STRINGSTRING Name of your store
- Anchor to customer_email_subscription_statuscustomer_
email_ subscription_ statuscustomer_ email_ subscription_ status STRINGSTRING The customer's email marketing subscription state, with values such as Invalid, Not subscribed, Pending, and Subscribed.
- Anchor to customer_citiescustomer_
citiescustomer_ cities ARRAY<STRING>ARRAY<STRING> All cities in the customer's history of addresses
- Anchor to customer_countriescustomer_
countriescustomer_ countries ARRAY<STRING>ARRAY<STRING> All countries from the customer's address history. Values are country codes such as US, CA, GB, and AU.
- Anchor to customer_regionscustomer_
regionscustomer_ regions ARRAY<STRING>ARRAY<STRING> All states or provinces from the customer's address history. Values are region codes such as US-CA, US-NY, CA-ON, and GB-ENG.
- Anchor to customer_amount_spentcustomer_
amount_ spentcustomer_ amount_ spent MONEYMONEY The customer's all-time spend is shown in your store's currency.
- Anchor to customer_last_order_datecustomer_
last_ order_ datecustomer_ last_ order_ date DAY_TIMESTAMPDAY_TIMESTAMP The day the customer most recently placed an order, reported in your store's time zone.
- Anchor to customer_number_of_orderscustomer_
number_ of_ orderscustomer_ number_ of_ orders INTEGERINTEGER Number of orders the customer has placed across all time
- Anchor to first_order_sales_channelfirst_
order_ sales_ channelfirst_ order_ sales_ channel STRINGSTRING The sales channel where the customer's first order was placed, shown as a channel name such as Online Store or POS.
- Anchor to customer_cohort_monthcustomer_
cohort_ monthcustomer_ cohort_ month MONTH_TIMESTAMPMONTH_TIMESTAMP The month of the customer's first order, reported in your store's time zone.
- Anchor to customer_cohort_quartercustomer_
cohort_ quartercustomer_ cohort_ quarter QUARTER_TIMESTAMPQUARTER_TIMESTAMP The quarter of the customer's first order, reported in your store's time zone.
- Anchor to customer_cohort_weekcustomer_
cohort_ weekcustomer_ cohort_ week WEEK_TIMESTAMPWEEK_TIMESTAMP The week of the customer's first order, reported in your store's time zone.
- Anchor to customer_first_order_datecustomer_
first_ order_ datecustomer_ first_ order_ date DAY_TIMESTAMPDAY_TIMESTAMP The day the customer placed their first order, reported in your store's time zone.
- Anchor to predicted_spend_tierpredicted_
spend_ tierpredicted_ spend_ tier STRINGSTRING The customer's predicted spend tier for the next year, with values Low, Medium, and High.
- Anchor to customer_sms_subscription_statuscustomer_
sms_ subscription_ statuscustomer_ sms_ subscription_ status STRINGSTRING The customer's SMS marketing subscription state, with values such as Not subscribed, Pending, Redacted, and Subscribed.
- Anchor to customer_tagcustomer_
tagcustomer_ tag STRINGSTRING Tag associated with the customer
- ARRAY<STRING>ARRAY<STRING>
Set of tags associated with the customer
- Anchor to rfm_grouprfm_
grouprfm_ group STRINGSTRING A customer relationship label based on recency, frequency, and monetary spend. Values include Champions, Loyal, Needs attention, and At risk.
- Anchor to referring_channelreferring_
channelreferring_ channel STRINGSTRING Channel that led to an online store session
- Anchor to referring_mediumreferring_
mediumreferring_ medium STRINGSTRING The category of referring channel that led to an online store session, such as email, social, search, or affiliate.
- Anchor to referring_platformreferring_
platformreferring_ platform STRINGSTRING Platform that led to an online store session
- Anchor to traffic_typetraffic_
typetraffic_ type STRINGSTRING The type of traffic that led to an online store session, with values Direct, Paid, Organic, Unknown, and Unattributed.
- Anchor to rollout_idrollout_
idrollout_ id IDENTITYIDENTITY Unique identifier for the rollout that was exposed to the buyer in the session
- Anchor to rollout_treatment_idrollout_
treatment_ idrollout_ treatment_ id IDENTITYIDENTITY Unique identifier for the specific treatment exposed to the session
IDENTITY
A unique identifier for a Shopify resource such as a customer, product, or order.
DAY_TIMESTAMP
A date value truncated to day precision.
DAY_OF_WEEK
A day within a week, used for weekday-based grouping and filtering.
HOUR_TIMESTAMP
A timestamp truncated to hour precision.
HOUR_OF_DAY
An hour within a day, typically represented as an integer from 0 to 23.
STRING
A sequence of characters representing text data.
MINUTE_TIMESTAMP
A timestamp truncated to minute precision.
MONTH_TIMESTAMP
A date value representing the start of a month.
MONTH_OF_YEAR
A month number within a year.
QUARTER_TIMESTAMP
A date value representing the start of a fiscal quarter.
ARRAY
A list of values. The element type appears inside angle brackets, such as ARRAY<STRING>.
SECOND_TIMESTAMP
A timestamp truncated to second precision.
BOOLEAN
A true or false value representing binary states.
WEEK_TIMESTAMP
A date value representing the start of a week.
WEEK_OF_YEAR
A week number within a year.
YEAR_TIMESTAMP
A date value representing the start of a year.
MONEY
A monetary amount representing currency values such as prices, revenue, costs, and discounts.
searches: Storewide search volume and intent for what shoppers look for during sessions.search_conversions: Search-driven funnel volume for isolating sessions that included a search.web_performance: Page load metrics to pair session behavior with performance signals.