Shopify Customer Retention Analysis With AI | Tugger

Free live webinar, 19 November, 1:00pm GMT.
Questions your systems can't answer alone: watch Claude answer them across six connected systems.

Shopify Customer Retention Analysis With AI

Shopify customer retention analysis is something most store owners know they should do and almost nobody does regularly. You know your conversion rate, your ad spend and your cost per acquisition. You probably do not have a current list of which customers are drifting away, which ones are worth the most, or whether your repeat-purchase profile is getting better or worse.

The data is already in Shopify. Every order links to a customer record, and every customer record carries order count, total spend and account age. The gap is between having the data and being able to reason over it soon enough to act. This guide is for Shopify merchants who want to run that analysis in Claude, ChatGPT or Gemini against their own store, with three prompts you can copy and adapt.

Why retention gets ignored

Acquiring a new customer costs several times more than keeping an existing one, and a first-time buyer who never returns is worth a fraction of a customer who orders four or five times a year. Every store owner knows this. Churn still goes unmeasured because measuring it is a chore.

Doing it by hand means exporting your customer list, exporting your order history, joining them on customer ID, calculating days since last purchase, counting orders per customer and summing spend. That is an hour in a spreadsheet, and the result starts going stale the moment you save it. So it gets done once, before a board meeting or a Black Friday plan, and then not again.

What Shopify holds about your customers

Three entities in the Shopify data Tugger syncs do most of the work.

ShopifyCustomers carries numberOfOrders, amountSpent_amount (lifetime spend in your shop currency), createdAt, marketing consent state and tags. It also carries two fields Shopify calculates itself: statistics_rfmGroup and statistics_predictedSpendTier. Those are a useful sanity check, but you cannot see or change the thresholds behind them, which is the whole point of doing the analysis yourself.

ShopifyOrders holds the order history: order date, financial status, cancellation, order value and the customer_id that links each order back to the customer. Last order date is not stored on the customer record, so recency always comes from here.

ShopifyOrderLineItems goes a level deeper, with the product_id, variant_id, SKU, title and vendor for every line purchased. Joined to ShopifyProducts for productType, this is what lets you see which categories a customer buys from, and it is what turns a generic "we miss you" email into a relevant one.

Recency, frequency, monetary value

Retention analysis usually works on three dimensions: when did the customer last buy, how often do they buy, and how much have they spent. Analysts call it RFM. The prompts below use recency to segment, then frequency and spend to prioritise within each segment.

The thresholds in this guide are a starting point for a store where customers typically reorder every one to three months. If your average purchase cycle is longer, stretch them.

SegmentLast orderWhat it usually means
Active0 to 60 days agoHealthy. Protect the high spenders in here.
At Risk61 to 120 days agoGone quiet. Strongest return on a targeted re-engagement.
Lapsing121 to 365 days agoRevenue captured and then lost. Win-back campaign territory.
ChurnedOver 365 days agoIf dominated by one-order buyers, the problem is first-purchase experience, not retention.

How the prompts reach your Shopify data

Tugger syncs your Shopify store into a managed data warehouse on a schedule, and its built-in MCP server lets Claude, ChatGPT and Gemini query that warehouse directly. If MCP is new to you, our MCP server guide covers it. The connection is read-only: the AI queries the warehouse, never your Shopify admin. Setup is in how to connect Shopify to Claude.

Prompt 1: Your customer base by segment

Start with the population view. It tells you where the customers are and where the revenue risk sits.

Role: You are a customer retention analyst for an ecommerce business.

Context: Use the ShopifyCustomers and ShopifyOrders data provided via Tugger MCP. Exclude cancelled orders and orders with a financial status of voided or refunded when working out the date of a customer's most recent order.

Task: Segment every customer with at least one order into four groups by the date of their most recent order: Active (last 60 days), At Risk (61 to 120 days ago), Lapsing (121 to 365 days ago) and Churned (more than 365 days ago). For each segment, calculate the number of customers, average lifetime spend (amountSpent_amount), average number of orders (numberOfOrders) and the combined lifetime spend of the segment.

Output: One table with a row per segment. Below it, a short paragraph identifying which segment represents the greatest revenue at risk and which is the clearest re-engagement opportunity, with the reasoning.

What you will probably see. The Active segment is smaller than you expected. The At Risk segment contains customers with significant lifetime spend who have gone quiet without anyone noticing. And the closing paragraph is as useful as the table: if At Risk has a high average spend and order count, those are proven loyal customers worth a personal effort. If Churned is mostly single-order buyers, that is a first-purchase problem and a different fix.

Prompt 2: Your highest-value customers at risk

The first prompt shows you the shape of the problem. It does not tell you who to contact this week. This one does, and because the data is already connected it is a follow-up question, not a new export.

Role: You are a customer retention analyst for an ecommerce business.

Context: Use the ShopifyCustomers, ShopifyOrders, ShopifyOrderLineItems and ShopifyProducts data provided via Tugger MCP. Apply the same order exclusions as before.

Task: From customers whose most recent order was 61 to 120 days ago, list the top 30 by amountSpent_amount. For each, show displayName or customer id, lifetime spend, numberOfOrders, date of most recent order, days since that order, and the two productType values (via ShopifyOrderLineItems joined to ShopifyProducts) they have bought most often.

Output: A table sorted by lifetime spend, highest first. Add a final column, Personal outreach, set to Yes where lifetime spend is above £500 and numberOfOrders is greater than 2, otherwise No. Below the table, state the total lifetime spend of the Yes group.

Why the refinement works. The final column turns analysis into a decision. The product categories turn a discount code into a recommendation. A customer who has only ever bought from your premium range should get a different message from one who buys across the catalogue, and this is the data that tells you which is which.

Prompt 3: Protecting VIPs before they drift

Retention is not only recovery. Your best customers are still inside the Active window, and a well-timed message before they go quiet works better than a win-back offer after.

Role: You are a customer success analyst for an ecommerce business.

Context: Use the ShopifyCustomers and ShopifyOrders data provided via Tugger MCP. Apply the same order exclusions as before.

Task: Identify the top 50 customers by amountSpent_amount who have numberOfOrders of 4 or more. For each, show lifetime spend, number of orders, average order value and days since their most recent order. Flag any whose most recent order was more than 45 days ago.

Output: A ranked table by lifetime spend, then a second section headed "VIP attention required" listing only the flagged customers, sorted by days since last order with the longest gap first.

Why it works. Anyone on the flagged list is still Active but approaching the point where a personal note, early access to a new collection or a recommendation based on what they usually buy will land well. The 45-day threshold is a starting point; set it to roughly half your average reorder interval and rerun.

From list to action

For At Risk high-value customers, personalised and product-specific beats generic. A discount works, but it trains people to wait for one. A recommendation based on their past categories performs better, and early access to something that fits their buying pattern better still, because it reads as a benefit rather than a markdown.

For VIPs approaching the threshold, a message from a named person rather than an automated flow is usually the difference. The line-item history gives whoever sends it something specific to say.

If you run the same checks every month, put the segment thresholds and the outreach rule in a short instruction file and load it into a Claude Project or a ChatGPT custom GPT. Then anyone on the team can ask "run the retention check" and get the same answer, built the same way.

Related guides

Get started

Connect your Shopify store to Tugger, open Claude, ChatGPT or Gemini and run the first prompt against your own customers. Tugger is UK-based and ISO 27001:2022 certified, and it connects 70+ systems including Xero, HubSpot, Simpro and Harvest, no code, no faff.

Try Tugger free for 10 days or book a demo.

More Reasons to Choose Tugger®

Don't just take our word for it.

Before Tugger, our reporting was fragmented. Our data lacked clarity. Tugger changed all of that, giving us unified, visually engaging reports across all areas of our business, making data insights much easier to understand and act on.
Gary Moorhouse
Commercial Director
Thompsons Group
We used to struggle with the time it took to manually refresh many clients' reports each month, where small errors could derail the process. Tugger has completely streamlined this, automating updates and allowing our staff to access reports daily. It’s been a game-changer for our team and our clients.
Sam King
Head of Xero and Xero Education
Thorne Widgery
I want to commend Tugger's team for being a credit to the company. Every person I've interacted with has been knowledgeable, friendly, and incredibly helpful. I've felt well supported and looked after throughout the entire process. Well done!
Josie Lawton
Finance & BI Analyst
Make.Contact
I've never encountered something as user-friendly as Tugger – a simple flip of the switch, and it's up and running. I was genuinely impressed. With standard reporting templates right from the start, I gained instant visibility into our individual companies and entities. To be honest, it was quite remarkable.
Matthew Hughes
Chief Information Officer
UDL Group
Tugger has revealed data that has given us brand new ideas around the ways in which we can deliver our service to our customers. If you want somebody to work with to grow your business, you definitely need to work with Tugger
Jeff Smith
Partner & Director of Digital Disruption
Envirotech Group
It’s a simple set-up for getting your data and being able to report straight away. Even if you’ve got no Power BI knowledge.
Damian Winstone
Commercial Business Partner
ARH Group Ltd
With Tugger, reporting has become straightforward and remarkably clear, making it easy for us to get what we need.
Dean Kahl
Marketing and Systems Manager
TAG Catering Equipment UK