How Gatemi Customer Analytics Works

The plugin builds a snapshot: one row per customer in its own table, with their totals, three scores and a segment. Every screen reads that table. Nothing is worked out on a storefront page, and the heavy work — reading your orders — happens when the snapshot is rebuilt.

Building the snapshot, step by step

  1. A rebuild starts — from the cron event (gmcaf_rebuild in the free edition, gmca_rebuild in the full edition), or from Save and rebuild now.
  2. Orders are read with WooCommerce's own wc_get_orders(), 200 at a time, only in the statuses you ticked. Refund records are not orders and are never read as one.
  3. Each order is filed under its billing email, lower-cased. The order's total, minus anything refunded on it, is added to that customer's spend, and their order count goes up by one. The newest order sets their name and country.
  4. The table is emptied and refilled. A rebuild forgets, so a customer whose orders have since been deleted does not stay in a segment for ever.
  5. Every customer is scored against everybody else (below), given a segment, and stored.
  6. The time of the build is recorded, and the screen shows it.

The score rule — ranks within your own shop

A score is a customer's rank among your customers, in fifths (quintiles), from 1 to 5. It is never a fixed threshold.

"Ordered within 30 days = 5" means nothing for a shop selling mattresses, and nothing for one selling coffee, in opposite directions. Worse, fixed thresholds still fill the segments — just with the wrong people — so the mistake is invisible. Ranking against your own distribution avoids it.

  • Recency — days since the last order. Scored the other way round: the fewest days earns the highest score. Getting that backwards would treat lapsed customers as your best.
  • Frequency — number of orders.
  • Monetary — total spent, after refunds.

The cut points are the values at 20%, 40%, 60% and 80% of your customers. A value equal to a cut point stays in the lower band. That matters: in a shop where four customers in five bought exactly once, every cut point for frequency is one, and counting "equal" as "above" would give your least frequent buyers the second-highest score.

The segments

Frequency and monetary are averaged into one figure (rounded), and the segment is the first one in this list whose ranges fit:

Segment Recency Frequency + spend What to do
Champions 4–5 4–5 Reward them
Loyal 3–5 3–5 Ask them for reviews
Potential loyalists 4–5 2–3 Nudge them to a third order
New customers 4–5 1 The second order is the one that matters
Promising 3 1–2 Fairly recent, spending little so far
Need attention 2–3 3–5 Reach them before they lapse
At risk 1–2 4–5 A win-back pays here
Hibernating 1–2 2–3 Bought a few times, long ago
Lost 1 1 Cheap to mail, unlikely to return

A combination no segment covers is Everyone else — counted openly rather than filed under Lost, which would tell you customers had left when they had not.

Worked example. A shop with 500 customers. Anna last ordered 6 days ago (recency 5), has placed 9 orders (frequency 5) and spent more than most (monetary 4). (5 + 4) ÷ 2 rounds to 5: Champions. Ben ordered once, 300 days ago, for a small amount: recency 1, frequency 1, monetary 1 — Lost.

The identity rule — a customer is an email address

Guests place orders, often the same guest repeatedly, and often a person who later creates an account. Grouping by account would report your best customers as "guest" and much of your revenue as unattributed. So a customer is their billing email, and the table has a unique index on it: three guest orders and one account order under the same address are one customer, whatever order they are read in. An order with no billing email is not counted.

The money rule — only sales count, refunds come off

Only orders in the statuses you chose are read, and each order's refunded amount is taken off its total. A customer who returned everything is not a Champion.

The honesty rule — the snapshot says how old it is

Every screen shows when the snapshot was built: "Built 3 hours ago." Once it is older than the threshold — 48 hours in the free edition, your own number in the full edition — the screen says so in as many words and asks you to check that cron is running. A stale segment that looks fresh is worse than none, because somebody acts on it.

Full edition: the cohort grid

How many came back groups customers by the month of their first order and shows, for the six months after, how many of each group placed another order. A month that has not happened yet is blank rather than nought, because a nought there would draw a cliff that is a fact about the calendar, not about your shop. Each group is measured from its own first order, so shops with different launch dates read the same way.

The grid is worked out from the snapshot's first-order and last-order months for each customer.

Full edition: acting on a segment

  • CSV — every customer in a segment (or everyone), with their totals and scores. Every cell is neutralised so a customer's name cannot run as a spreadsheet formula.
  • The query service — other plugins and your own code can ask which segment an address is in, or for every address in a segment. It reads the snapshot, so asking costs one indexed query. See the developer reference.

Next: FAQ and troubleshooting.

Shopping Cart
Scroll to Top