search_ queries
The search_queries schema captures online store search with one row per search term. Use it to report how often terms are searched and how often they get a click, rather than for broader funnel analysis.
Anchor to Use casesUse cases
- Query volume: Group
search_queriesbysearch_queryto rank the most-searched terms. - Clicked queries: Filter
search_result_was_clickedwhen counting queries that resulted in a click. - Click trend: Trend
search_queries_with_clicksby week to see how often searches lead to a click over time.
ShopifyQL
Examples
Description
Show the 50 most-run `search_queries` last month, split by whether the result was clicked. This example uses [`HAVING`](/docs/api/shopifyql/latest/syntax/having) `search_queries > 10` to drop long-tail queries from the ranking.
ShopifyQL
FROM search_queries SHOW search_queries, search_queries_with_clicks GROUP BY search_query, search_result_was_clicked WITH TOTALS, GROUP_TOTALS HAVING search_queries > 10 DURING last_month ORDER BY search_queries DESC LIMIT 50 VISUALIZE search_queries TYPE list_with_dimension_valuesDescription
Break down `search_queries` and clicked queries by hour of day this month. This example uses [`WITH TOTALS`](/docs/api/shopifyql/latest/syntax/with#total-columns) to add the total across all hours.
ShopifyQL
FROM search_queries SHOW search_queries, search_queries_with_clicks GROUP BY hour_of_day WITH TOTALS DURING this_month ORDER BY hour_of_day ASC VISUALIZE search_queries TYPE grouped_barDescription
Compare `search_queries` and `search_queries_with_clicks` last month against the month before. This example uses [`COMPARE TO previous_period`](/docs/api/shopifyql/latest/syntax/compare-to) to benchmark your date range against the equal-length period right before it.
ShopifyQL
FROM search_queries SHOW search_queries, search_queries_with_clicks WITH PERCENT_CHANGE DURING last_month COMPARE TO previous_periodDescription
Track weekly `search_queries_with_clicks` across this quarter. This example uses [`WITH TOTALS`](/docs/api/shopifyql/latest/syntax/with#total-columns) to add a quarter-to-date total beside the weekly rows.
ShopifyQL
FROM search_queries SHOW search_queries_with_clicks TIMESERIES week WITH TOTALS DURING this_quarter ORDER BY week ASC VISUALIZE search_queries_with_clicks TYPE 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 .
- Anchor to search_queriessearch_
queriessearch_ queries INTEGERINTEGER Number of search queries
- Anchor to search_queries_with_clickssearch_
queries_ with_ clickssearch_ queries_ with_ clicks INTEGERINTEGER Number of search queries in which the customer clicked on a search result
INTEGER
A whole number without decimal places, used for counts, quantities, and other discrete numeric values.
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 .
- Anchor to daydaydayDAY_TIMESTAMPDAY_TIMESTAMP
Day (timestamp) the data was recorded
- Anchor to day_of_weekday_
of_ weekday_ of_ week DAY_OF_WEEKDAY_OF_WEEK The day of the week, with values Monday through Sunday.
- Anchor to hourhourhourHOUR_TIMESTAMPHOUR_TIMESTAMP
Hour (timestamp) the data was recorded
- Anchor to hour_of_dayhour_
of_ dayhour_ of_ day HOUR_OF_DAYHOUR_OF_DAY The hour of the day, with values 0 through 23.
- Anchor to minuteminuteminuteMINUTE_TIMESTAMPMINUTE_TIMESTAMP
Minute (timestamp) the data was recorded
- Anchor to monthmonthmonthMONTH_TIMESTAMPMONTH_TIMESTAMP
Month (timestamp) the data was recorded
- Anchor to month_of_yearmonth_
of_ yearmonth_ of_ year MONTH_OF_YEARMONTH_OF_YEAR The month of the year, with values 1 through 12.
- Anchor to quarterquarterquarterQUARTER_TIMESTAMPQUARTER_TIMESTAMP
Quarter (timestamp) the data was recorded
- Anchor to search_querysearch_
querysearch_ query STRINGSTRING Search query made on your online store
- Anchor to search_result_was_clickedsearch_
result_ was_ clickedsearch_ result_ was_ clicked BOOLEANBOOLEAN Whether a search led to a click on one of its results, with values
trueandfalse.- Anchor to secondsecondsecondSECOND_TIMESTAMPSECOND_TIMESTAMP
Second (timestamp) the data was recorded
- Anchor to shop_idshop_
idshop_ id IDENTITYIDENTITY - Anchor to weekweekweekWEEK_TIMESTAMPWEEK_TIMESTAMP
Week (timestamp) the data was recorded
- Anchor to week_of_yearweek_
of_ yearweek_ of_ year WEEK_OF_YEARWEEK_OF_YEAR The week of the year, with values 1 through 53.
- Anchor to yearyearyearYEAR_TIMESTAMPYEAR_TIMESTAMP
Year (timestamp) the data was recorded
- Anchor to shop_nameshop_
nameshop_ name STRINGSTRING Name of your store
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.
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.
STRING
A sequence of characters representing text data.
BOOLEAN
A true or false value representing binary states.
SECOND_TIMESTAMP
A timestamp truncated to second precision.
IDENTITY
A unique identifier for a Shopify resource such as a customer, product, or order.
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.
searches: Storewide search volume and intent for a higher-level view of search activity.search_conversions: Search-driven funnel volume for tracking queries downstream to checkout.global_searches: Catalog exposure from search requests outside your storefront.