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.
Support data comes from your help desk integration (supported help desks) and lands in two tables that join on sm_ticket_key:A help desk connected to one store covers that store only. Gorgias and Richpanel fill the tables differently, which changes what these queries return; the platform notes on the messages and tickets pages say how.
What you’ll learn: How ticket volume and one-touch resolution varies by support channel (email, chat, Instagram DM, etc.). Use this to identify which channels are driving the most workload and where your team is resolving issues efficiently.
What you’ll learn: Which teams are closing tickets fastest and how complete your CSAT data is by team. Use this for staffing, training, and process improvement.
What you’ll learn: How old your open ticket backlog is (age buckets + p50/p90) broken out by team and channel. Useful for backlog management and escalation.
What you’ll learn: Which teams/channels have the highest unread share of open tickets. Useful for triage and staffing.
What you’ll learn: Which tagged issue types generate the most tickets, and whether they tend to be one-touch or slow to resolve. Useful for product feedback loops, macro coverage, and staffing.
One ticket can have multiple tags, so a single ticket may appear in multiple tag rows. Use this for per-tag diagnostics, not for global totals. Many tags are routing labels (channel, store, automation, priority) rather than topics, so read the list before treating it as themes.
What you’ll learn: Which topics come up most in what customers actually wrote, counted once per ticket, for tickets created in the last 30 days. Edit the keyword list to match your business. A ticket that mentions two keywords counts under both, so the rows do not add up to the ticket total. HTML tags are stripped first, because some help desks pass markup through and an inline style such as font-size would count as a mention of “size”.
Some channels carry no transcript, so their tickets never match a keyword. Check message_communication_channel before reading a low count as a quiet topic.
What you’ll learn: How long customers wait for the first reply they can see, by channel, for tickets created in the last 30 days. There is no first-response column on the ticket table, so this derives it from the messages: the earliest public agent message after the customer’s first message. Tickets an agent started, tickets with no reply yet, and internal notes are left out. The median sits next to the average because a few slow replies pull the average up.
A phone channel can come out near zero when the help desk logs both sides of a call at once; hold time has to come from the phone system. Automated replies count as agent messages. Where the help desk marks them, leave them out of first_agent_reply_at, for example message_entry_method = 'rule' in Gorgias. The messages table’s platform notes say which calls and automations each help desk marks.
What you’ll learn: How much of the conversation volume customers generate versus your team, and which agents send the most replies. Internal notes are excluded so the split only counts messages customers could see.
Help desk bots appear as agents under their own sender name, so the agent rows include automation unless you filter them out by name.
What you’ll learn: Which products were in the orders of customers who opened tickets, as a stand-in for “which products generate tickets”. Nothing on a ticket names a product, so this links each ticket to the same customer’s orders in the 90 days before the ticket. A ticket counts once per product in those orders, and only tickets whose customer_id matches an order in the same store are covered. linked_ticket_share is the share of all tickets in the window that linked to an order, the same on every row; quote it with the result. Non-product lines such as package protection show up near the top; exclude them by title.
What you’ll learn: Which priority/channel/team combinations generate the most tickets, and whether they are being resolved quickly. Useful for triage rules and staffing.

Back to the SQL Query Library.

Customers & Retention

Compare support patterns with repeat behavior and lifecycle segments.

Orders & Revenue

Evaluate support load alongside sales and revenue trends.

Attribution & Data Health

Check data quality when support metrics shift unexpectedly.