Not all first purchases are equal. Some products attract one-time buyers; others reliably convert customers into repeat purchasers. This query identifies which Shopify products have the highest repeat purchase rate.
The question
The SQL Taptic generates
WITH first_orders AS ( SELECT o.customer_id, MIN(o.created_at) AS first_order_date, MIN(o.shopify_order_id) AS first_order_id FROM shopify_orders o WHERE o.is_test_order = false AND o.cancelled_at IS NULL AND o.customer_id IS NOT NULL GROUP BY o.customer_id ), first_products AS ( SELECT fo.customer_id, li.product_title AS first_product FROM first_orders fo JOIN shopify_order_line_items li ON li.shopify_order_id = fo.first_order_id ), repeat_buyers AS ( SELECT DISTINCT customer_id FROM shopify_orders WHERE is_test_order = false AND cancelled_at IS NULL GROUP BY customer_id HAVING COUNT(shopify_order_id) > 1 ) SELECT fp.first_product, COUNT(DISTINCT fp.customer_id) AS total_first_buyers, COUNT(DISTINCT rb.customer_id) AS repeat_buyers, ROUND(COUNT(DISTINCT rb.customer_id) * 100.0 / NULLIF(COUNT(DISTINCT fp.customer_id), 0), 1) AS repeat_rate_pct FROM first_products fp LEFT JOIN repeat_buyers rb ON rb.customer_id = fp.customer_id GROUP BY fp.first_product HAVING COUNT(DISTINCT fp.customer_id) >= 10 ORDER BY repeat_rate_pct DESC LIMIT 25
This query was generated by Taptic Data from plain English against a real Shopify schema. In Taptic, you type the question — the AI writes the SQL, runs it, and returns the result. You can edit the SQL, ask for explanations, and save it as a refreshable report. This type of analysis is commonly used in shopify revenue dashboard and shopify inventory management.
How this query works
What it returns
Top 25 products ranked by repeat purchase rate, showing total first buyers, number who returned for a second purchase, and the repeat rate percentage.
Why it matters
All queries and use cases on this page relate to analyzing your Shopify data in Taptic. To see the full analytics workflow, explore shopify revenue dashboard, shopify inventory management.
FAQ
Generate this automatically
In Taptic Data, you type "Show me which products customers bought first and what perce..." and this SQL runs automatically against your real Shopify data.
Try Taptic Free — $29.99/moNo credit card required. Connect your data source in under 5 minutes.
Related use cases