
Is my referral program working? How to diagnose a drop, step by step
In short
A referral program works when its six counts hold and each of its five rates sits inside its placement's band.
A drop is real if it survives reconciliation (period, campaigns, filters) and lands outside the program's monthly range; Talkable reads a rate as changed at 10%. The stage that changed most is the rate with the largest relative change.
Why it matters
"Referral sales are down" is a common question, and the first answer can be wrong:
- the periods did not match;
- a campaign was left out of one report;
- or a placement was switched off and took its share of the numbers with it.
Talkable's analysts answer it in three moves:
- reconcile first;
- walk the referral funnel from the top;
- name the stage whose rate changed most.
Start by pulling the six counts for both periods.
What "working" means, measurably
In Talkable, a referral program is measured on the referral funnel: six counts, impressions, sharers, shares, clicks, visits and friend referral sales, and the five rates between them, each count taken in the period its own event happened (sharers by the offer's creation). "Working" is a judgement on three comparisons, in this order.
- Volume against the program's own history, and against the store. Two figures place the program inside the store:
- post-purchase impressions against store orders (how many buyers met the prompt);
- referral revenue share (referral revenue ÷ total store revenue).
- Each rate against the band for its placement. Talkable publishes a band per placement: the typical range of programs on that placement. A whole-program rate is compared with the all-placements band, never with one placement's band, because a whole-program rate is mostly a post-purchase rate: post-purchase carried 63% of impressions across 102 programs running four placements (Talkable benchmark data, 2022–2024).
- Each rate against the program's own monthly range, the twelve months before the period.
| Rate | Formula | Standalone | Floating widget | Post-purchase | All placements |
|---|---|---|---|---|---|
| Advocacy rate | sharers ÷ impressions | 7.79–16.32% · n=128 | 4.72–14.41% · n=73 | 2.12–7.27% · n=64 | 3.31–8.72% · n=125 |
| Sharing rate | shares ÷ sharers | 1.31–1.80 · n=122 | 1.21–1.71 · n=70 | 1.11–1.37 · n=65 | 1.26–1.49 · n=119 |
| Click rate | clicks ÷ shares | 1.43–2.64 · n=120 | 0.93–1.66 · n=72 | 0.61–0.89 · n=66 | 1.16–2.35 · n=123 |
| Visit rate | visits ÷ clicks | 35.70–49.16% · n=121 | 35.21–53.69% · n=73 | 34.11–49.48% · n=66 | 34.1–49.0% · n=111 |
| Conversion rate | friend referral sales ÷ visits | 11.09–25.00% · n=108 | 11.19–24.56% · n=64 | 6.84–15.61% · n=53 | 10.09–22.90% · n=119 |
Published bands, Talkable benchmark data, 2025: the typical range of programs on that placement, n = programs in the cell. Bands are built from each program's monthly rates; the two-period comparison itself is made on period totals. Sharing rate and click rate are ratios, not percentages.
Placement names are the Talkable admin's (placements and campaign types in the Talkable documentation); the API names are in the code section.
Bands are published for the Standalone page, the Floating widget and Post-purchase:
- the Advocate dashboard is a standalone-type page, usually counted with the Standalone page, and is read against the Standalone band;
- so is the row “Other campaigns (no type)”, campaign types run as a page of their own (Leaderboard, Tiered Rewards, full-bleed Invite);
- the Reward Gleam row is read against the program's own history.
Bands are re-published every year and move with the market, so compare a program with the current edition.
For example, ask the AI Assistant: “Show my referral funnel for last quarter by placement, and tell me which rates sit below the Talkable band for that placement.”
The five-line health check
- Friend referral sales and referral revenue for the period, against the previous period and the same period last year: up, flat or down, and by how much.
- Impressions the same way; a program cannot sell more than its reach allows.
- Each placement's five rates against its own band in the table above; mark every rate below the band.
- Each rate against the program's own twelve-month range; mark every rate outside it.
- Every marked rate explained by a known cause (a change you made, a placement switched off, a promotion), or sent to the audit.
Five lines with nothing marked and volume holding: the program is working. Marks you can explain: it is working as configured, and the explanation is the decision. Marks you cannot explain: reconcile, then audit.
A worked example: one mix change and one real change
Round numbers chosen to show the method; they are not benchmarks and match no program.
A store runs two placements and compares this quarter with the same quarter last year. Its orders held at 90,000 in both, so whatever changed is inside the program. Friend referral sales fell from 1,008 to 621.
| Stage or rate | Same quarter last year (base) | This quarter (current) | Change |
|---|---|---|---|
| Impressions | 100,000 | 95,000 | −5.0% |
| Sharers | 5,600 | 4,600 | −17.9% |
| Shares | 8,400 | 6,900 | −17.9% |
| Clicks | 12,600 | 10,350 | −17.9% |
| Visits | 5,040 | 3,105 | −38.4% |
| Friend referral sales | 1,008 | 621 | −38.4% |
| Advocacy rate | 5.60% | 4.84% | −13.6% |
| Sharing rate | 1.50 | 1.50 | 0.0% |
| Click rate | 1.50 | 1.50 | 0.0% |
| Visit rate | 40.0% | 30.0% | −25.0% |
| Conversion rate | 20.0% | 20.0% | 0.0% |
Two rates moved by 10% or more, advocacy and visit rate; the stage that changed most is the visit rate.
Advocacy is a mix change. Split by placement, nothing moved:
- Post-purchase turned 4.0% of its impressions into sharers in both quarters;
- Standalone 12.0%.
What changed is the mix:
- Post-purchase went from 80,000 to 85,000 impressions (89% to 94% of the store's orders met the prompt);
- Standalone fell from 20,000 to 10,000, half the traffic to the referral page gone.
The current rates at the base mix give:
- (4.0% × 80,000 + 12.0% × 20,000) ÷ 100,000 = 5.60%, exactly the base quarter's blended rate.
So the mix explains all of the advocacy change, and both placement rates sit inside their bands.
The mix is not noise: Standalone lost half its impressions, which alone cost about 160 of the 387 lost sales at this quarter's rates; step 4 looks for the link that stopped sending people to the page.
The visit rate is the real change. It fell from 40% to 30% on both placements.
At the old 40%, the quarter's 10,350 clicks would have given 4,140 visits:
- the rate change alone cost 1,035 of them;
- the fewer clicks the other 900.
At 30% the visit rate sits below every placement's Talkable band, whose lowest bound is 34.11%, so the audit continues at step 7.
Before diagnosing: is the change real?
Reconcile the two sides of a comparison on every row below before reading any rate.
| Check | How | What it looks like when it is the cause |
|---|---|---|
| 1. Same period, closed dates. Both sides cover whole calendar months of the same length and both end dates are in the past. | Compare the start and end dates of the two reports; both days are included. Never compare a running month with a finished one. | The current side is a month that is not over, or a 28-day window against a 31-day month: every count is low by the missing days and every rate is near normal. |
| 2. Same campaigns. Both sides are filtered to the same campaign list, or both to the whole site. | Read the campaign filter in the Metrics Aggregation report; list the campaigns live in each period from the campaign list, with their status and live period. | One side has a campaign the other lacks: a placement's whole column appears or vanishes. A campaign that stopped showing still records clicks and sales on links already sent, so it keeps a row with almost no impressions. |
| 3. Same clock. Talkable's report and metrics API count a day in the account's time zone, on the same clock as each other. | Compare Talkable with Talkable at day level; compare Talkable with the store's own analytics at month level, and match any refund or currency filter. | Daily figures from two tools disagree by a few percent and the gap flips sign at month ends; monthly totals agree. |
| 4. Same status filters. Friend referral sales count pending, flagged and approved referrals, purchases only, and leave blocked and voided ones out. | Check whether the other report counts "all referrals", "approved only", or every purchase with a referral coupon (referral statuses). | A report built on approved referrals only is low for the latest period, because approval lags the purchase; a report counting all statuses is high everywhere. |
| 5. Test data excluded. Test traffic is what comes from the testing addresses, emails and phones configured on the site. | Sales metrics always leave it out; the activity metrics (impressions to visits) leave it out by default; keep the same setting on both sides. | A period with set-up or redesign work shows a bump in impressions and shares that no customer produced. |
| 6. Same date basis per stage. Each stage is counted by its own event date; sharers are dated by the offer's creation, sales by the purchase. | Make sure neither side follows one month's offers to their later purchases (a cohort). A cohort's last month is always incomplete. | The latest period's conversion rate is far below the rest and rises every time the report is refreshed. |
| 7. Numbers that still move after the period closes. A closed period is not frozen. | Pull both sides of a comparison on the same day and keep the date with the figures; re-pull a recent period before quoting it. | Sharers of a closed month grow a little (an offer created in the month, first shared after it). Friend referral sales of a closed month shrink when referrals are blocked or voided later, because a referral's status rewrites the history it sits in; a full refund voids a pending or flagged referral by itself, while an approved one stays counted. |
| 8. Same metric, same unit. | Name the metric on both sides: friend referral sales (count) or referral sales (friend plus advocate); friend referral revenue or referral revenue; conversion over visits, not clicks; click rate as a ratio. The admin's names: Advocacy percentage, Visit Percentage, Friend Conversion Percentage, Revenue percentage (referral revenue share), and "People Who Have Shared" for sharers, which are offers. | A number about twice the other (total against friend side), or a "rate" of 150% that is a ratio of 1.5. |
| 9. Dashboard revenue is configurable. | The revenue tile a store sees is a per-site setting; referral revenue in the report and the API is friend plus advocate referral revenue, two columns in the report. | Tile and report differ by a fixed share every month. |
| 10. A campaign that moved placement. | A campaign is reported under the placement it uses today, including its past months. For a comparison across years, group by campaign id and assign the placement per period yourself. | A placement's history changes after a campaign is moved; one placement "grows" while another shrinks by the same amount. |
| 11. Settings that changed between the periods. A year apart, the program itself may have been re-set. | List the settings changes between the two periods (the AI Assistant lists them): the attribution window of each tracking method, tracking methods switched on or off, fraud checks moved from flag to block, the friend offer's eligibility rules, a reward amount edited on a live campaign, a campaign expired or replaced. | Friend referral sales fell from one date while visits held; the Referrals report shows the tracking-method mix shifting on that date; a campaign's row ends in the middle of the comparison. |
| 12. Impressions that are not people. Impressions = share-page views + sign-up-page views − sign-ups, and an offer created through an API origin or at Shopify checkout records one with no page shown. | Split impressions into their three parts and read them by traffic source and device. | Impressions jump with no shares behind them, so advocacy falls; or sign-ups stop being recorded and impressions rise, because sign-ups are subtracted. A rise in impressions with nothing else moving is a tracking question, not growth. |
When a row explains the change, report it as a reporting change, give the corrected figures, and stop. When none does, the change is real: go to the audit.
For example, ask the Talkable AI Assistant: “Compare July–September with April–June for the same campaigns, and list every settings change made on this site in July–September with who made it.”
The audit, step by step
Run it in this order and stop at the first stage that explains the change.
The order matters because counts cascade and rates do not: when impressions fall by a fifth, every count below falls by a fifth with every rate unchanged, so a stage is only "the cause" when its own rate moved.
The thresholds are the working rules Talkable's analysts apply; they are practice, not a statistical test.
Year over year, and when store traffic held. For "why did referral performance drop year over year":
- The base period is the same period last year, which holds the season constant: a drop from a holiday quarter to the next is a season; a drop from last year's holiday quarter is a change.
- The previous period is the second reference that dates the change.
A program younger than a year has only the previous period.
Talkable records orders, not site sessions: the program's view of store activity is store orders and total store revenue (every purchase and event the store sends, unless filtered), so set:
- your own analytics' sessions beside Floating widget and Standalone impressions;
- store orders beside Post-purchase impressions.
When orders held (above), the cause is one of two kinds:
- fewer customers met the program (step 4: the prompt's eligibility, a campaign that quietly expired, a placement switched off or losing traffic);
- or fewer of those who met it acted (steps 5–8).
The decomposition below separates the two; each stage also has its own deeper topic in this library (impressions, advocacy and shares, click rate, claim page, conversion and spikes, AOV, sharing channel).
| Decision | Threshold | Audit steps that use it |
|---|---|---|
| Impressions read as changed | relative change ≥ 15% | Steps 2, 4 |
| A rate read as changed | relative change ≥ 10% | Steps 2–8 |
| Placement carrying the impressions change | ≥ 80% of the change; none carrying half = the cause is outside the program | Step 4 |
| Placements whose rate changed | by 10% or more, with at least 30 impressions in both periods; how to read one, several or opposite moves: step 5 | Steps 5, 8 |
| An offer or settings change as the lead | within one month of the start of the change = strong; more than two months away = look elsewhere | Steps 5, 8 |
| A widely opened link explains the change | ≥ 70% of the change | Step 7 |
| An outlier advocate's share of a period's sales | ≥ 60% = artifact; 20–60% = material, both views; < 15% = normal tail | Step 8 |
| A cause is "found" | it explains ≥ 85% of the change | Step 10 |
Step 0 · Reconcile
Every row of the checklist.
Step 1 · Pull both periods, whole program and by placement
- The six counts and referral revenue for the current period and the base period (the same period last year, or the previous period), whole program and by campaign type; the five rates on the period totals.
- On a Shopify store, compare the Shopify checkout-extension campaign as the post-purchase offer in both periods, whichever placement it was recorded under. It used to be set up as a Floating widget, now as Post-purchase.
- Pull it by campaign id (
campaign_ids[]), not by placement row. - The script moves that campaign's Floating widget counts to Post-purchase and says so. Reach, the band, the switch date and the mix check then read one checkout offer.
- Pull it by campaign id (
- The campaigns that showed the post-purchase row in each period decide which band it reads against:
- A campaign named “Shopify Extension(s)” or tagged
shopify-new-checkout: the Shopify checkout-extension band. - Any other campaign that starts on an order (in the campaign list,
joinable_category_namesis["purchase"]): the Post-purchase band. - A Post Event popup, one that starts on another event such as a review email, never sets the band. A row shown only by Post Event popups has no band.
- A campaign named “Shopify Extension(s)” or tagged
- If the store switched, or the row holds more than one kind:
- Switched to the extension inside a period, and no day showed both: split that period at the switch date. If the two showed on the same days, compare their campaigns by id.
- Switched between the two periods, or more than one kind has counts in the row in either period: read each kind as a placement of its own, against its own band in the periods it showed. The second kind can be a Post Event popup, or the other kind's clicks and sales after it stopped showing.
- A kind that started or stopped showing is a mix change.
- Keep each campaign's counts with its own kind, late clicks, sales and revenue included. Read Post Event popups as a row of their own, with no band.
- If a period's popup campaigns do not add up to the row, read the row as one placement. Part of its change can then be a change between kinds.
- Without a band, only the band read is missing: the placement read and the mix check still run.
- The store's orders and total store revenue for both periods (reach and revenue share, above).
- Monthly counts for the twelve months before the current period (twenty-four if the trend is unclear), for the program's own range.
Step 2 · Is the change material?
- Relative change = (current − base) ÷ base, per count and per rate. A 10% move is relative: a conversion rate going from 30% to 27% is a 10% change, not a 3-point one.
- Impressions changed 15% or more, or any rate 10% or more: continue.
- Below both, check that small changes did not add up: expected sales = base sales × current impressions ÷ base impressions.
- Actual sales within 10% of that (or within one sale): the whole program held.
- If not, small rate changes added up (five rates down 8% each cut sales by a third): go through the rates.
- Before you stop on a whole program that held, read the placements from step 1 the same way. Advocacy can double on Standalone and halve on Floating widget while the program's totals stay the same.
- Count a placement as moved when it has at least 30 impressions in both periods and its impressions changed 15% or more, or a rate 10% or more. Go to that rate's step.
- A placement that started or stopped showing moved too, whatever its impressions: a mix change. Go to the mix check.
- None moved: report "no material change" and stop.
- The script does this check: when the whole program held, it names the placements that moved, or says there was no material change.
Step 3 · Name the pattern, and the stage that changed most
- Counts fell together, every rate held: check sales as in step 2.
- Actual sales within 10% of base sales × current impressions ÷ base impressions (or within one sale): sales are consistent with a change in reach. Go to step 4.
- If not, small rate changes added up: go through the rates.
- Report any rate that moved inside the funnel, even when the changes cancel out at sales.
- One rate moved: check the placement mix first (method). More impressions in a placement with a lower rate lowers the program's rate with no change inside any placement. Then go to that rate's step.
- Several rates moved: check the placement mix first too, since one shift between placements can move several rates at once. Then read each rate at its own step.
- Click rate up and visit rate down together: the signature of one link opened by many people. Go to step 7 before anything else.
- The stage that changed most is the one with the largest relative change in its rate, current against base. Report it with the count with the largest relative change and the absolute change beside each.
Step 4 · Impressions
Rule out impressions that are not people first (checklist row 12). Then find the placement that carries 80% or more of the change and read it by placement:
- Post-purchase follows the store's orders. Divide the post-purchase impressions of the campaigns that start on an order by store orders.
- Leave out a Post Event popup, such as a review-email popup: it follows something else.
- If the store replaced an older extension copy with a new one, count both as one.
- If the store switched between the classic prompt and the extension between the two periods, the script skips this ratio and says so.
- Both fell together: the store sold less and the program did not change.
- Impressions fell much more than orders: the prompt stopped showing for some buyers, because a campaign expired, an eligibility rule or a frequency cap changed, or the order-confirmation integration broke, on a date the settings history gives.
- Impressions ÷ offers for the campaign type sits near 95–99% when the prompt renders and collapses when it does not (Talkable's working practice, not a benchmark).
- A Shopify checkout extension that replaced the classic post-purchase page is compared with the Post-purchase history, never with the Floating widget: its median advocacy was 1.3% across 23 programs in 2023–2025 against a post-purchase median of 4.5% across 64 programs in 2025 (Talkable benchmark data).
- Floating widget creates an offer when the widget is shown and an impression when the advocate opens it. Offers steady while impressions fall to near zero means the widget no longer opens the share page; fewer live widget campaigns than before means some were turned off.
- Standalone depends on the links that send people to the page. Split its impressions by traffic source and find the source that disappeared, such as an email that stopped linking to it.
- No placement leads (none carries half of the change): the cause is outside the program. Compare with site traffic, orders, the marketing calendar and the season.
For example, ask the AI Assistant: “Compare impressions by placement for last quarter and the quarter before, next to the store's order count for both.”
Step 5 · Advocacy rate
- Run the mix check first (method). The share the mix explains is a change in reach, not a reason to stop: go to step 4 for the placement that lost impressions. The rest is behaviour inside the placements: continue here.
- Count the placements whose advocacy rate changed by 10% or more (a rise from zero counts too). A placement needs at least 30 impressions in both periods to be counted. One that started or stopped showing is a mix change. Then read the count:
- One placement: the change is in that placement.
- Two or more, same direction: something they share moved. In practice that is the offer, both the advocate and the friend reward, because the advocate reads both on the share page.
- Same direction, very different amounts (more than 20 points apart, for example +50% and +100%): it is still a shared change. Read each placement's size on its own.
- Two or more, opposite directions (for example +50% and −50%): check whether the offer changed between the two periods.
- Opposite directions, and the offer changed: start with the offer. Each placement reaches different customers, and a new reward is not worth the same to all of them. $15 off → 20% off is worth less on a $50 order and more on a $100 order, so one change can raise one placement and lower another.
- Opposite directions, same offer: read each changed placement on its own.
- The Metrics Aggregation report's Incentive Combinations split shows which reward pair served the impressions in each period (the one-month rule in the table above).
- One placement changed: compare the advocate and friend rewards of its campaign with the others. Placements usually run the same offer.
- Same offer, unchanged between the two periods (the Incentive Combinations split shows which reward pair ran in each): the offer is not the cause, since the other placements with that offer did not move.
- The offer changed between the periods: start with the offer. A new reward can move placements by different amounts.
- Its own offer, such as an offer test or an offer for one customer segment: start with that offer.
- Read that placement by sharing channel, by device (the advocate's device for impressions, sharers and shares) and by traffic source, and look at its share page for hidden or missing share buttons; the site's settings-change history dates such edits.
For example, ask the AI Assistant: “Show advocacy rate by placement for the last two quarters and which incentive combination served the impressions in each.”
Step 6 · Sharing rate and the channel mix
- The sharing rate usually holds. Two things move it:
- a campaign that re-engages old offers, such as an email to past customers, adds shares against few new sharers, because sharers are dated by offer creation;
- a change in the share page's channels changes how many channels each sharer uses.
- Split shares by sharing channel for both periods. The channel mix sets the two rates below it:
- across programs the click rate of a copied link is 3.09 and of an email 0.61;
- their visit rates are 35.1% and 71.7% (Talkable benchmark data, January 2025 – June 2026, 199 and 149 programs recording the channel).
Step 7 · Click rate and visit rate
- Outlier first. A normal share brings two or three clicks; one link posted publicly can bring hundreds, which lifts the click rate and sinks the visit rate in the same period because most of those people never meant to buy.
- Illustrative, on the worked example's current quarter:
- 6,900 shares and 10,350 clicks (1.50);
- one link adds 4,000 clicks and 80 visits,
- so clicks are 14,350 (click rate 2.08, +39%),
- while visits are 3,185 (visit rate 22.2%, −26%).
- Find the advocate in the Top Referrers or Offer Shares report in the Talkable admin, or the week and channel in which copied-link clicks jump while visits barely move, and recompute both rates without them.
- The outlier explains 70% or more of the change: it is the cause, stop. The cleaned rate moves by less than 10%: performance is stable; the change was one link. It still moves by 10% or more: continue on the cleaned numbers, and report both views.
- Then the channel mix from step 6: a shift from email to the copied link raises the click rate and lowers the visit rate with nothing changed on any page.
- Then the claim page: a new email gate, a reward that no longer shows, a change dated by the settings history. Clicks on expired links count, and so do the visits that follow; friends on expired links rarely convert, which pulls the friend-side rates down.
For example, ask the AI Assistant: “Which advocates had the most clicks last month, with their shares, clicks and visits?”
Step 8 · Conversion rate
- Outlier first, especially when the earlier period was the high one: a "decline" is often an inflated period unwinding.
- The signature is an advocate whose link records about as many friend referral sales as visits; Talkable's practice flags an advocate with 10 or more friend referral sales at 0.6 or more sales per visit, while organic conversion runs 10–25% of visits.
- Count the biggest advocate's and the top four advocates' share of the period's friend referral sales:
- 60% or more, the period is an artifact and the funnel is recomputed without them in both periods;
- 20–60%, report both figures;
- under 15%, a normal tail.
- Remove the top advocates from both periods and re-read: a change that survives is organic.
- Then the tracking-method mix: the Referrals report in the Talkable admin carries the tracking method of every sale.
- A fall in coupon-tracked sales points to an exhausted code pool or codes that no longer apply at checkout;
- a rise in sales matched by address can credit several purchases to one visit.
- Then the friend reward: only the friend's reward affects conversion, because the friend never sees the advocate's; read the incentive-combination split again, with the one-month rule.
- Then the store: a site-wide promotion that beats the friend reward takes the friend's reason to use it (practice).
- Then placement: the post-purchase conversion band sits about 40% below Standalone's (table above), so a post-purchase campaign added in the current period lowers the blended rate with no friend behaving differently.
For example, ask the AI Assistant: “Which advocates had the most friend referral sales last quarter, with their visits, and what share of the quarter's sales do the top four hold?”
Step 9 · Revenue
- Friend referral sales held and referral revenue fell: the average order moved, not the funnel. Compare referral AOV (referral revenue ÷ referral sales, both sides) between the periods.
Step 10 · Stop rule and write-up
- Stop when the cause you found explains 85% or more of the change.
- Before presenting, verify every figure in the write-up against the same period and campaign set in the Metrics Aggregation report (how); a figure that does not reproduce there is not presented.
- Write it as analysis, in this order:
- which metric changed, by how much and from which month;
- the cause in plain words;
- both versions when an outlier was removed;
- anything that needs a check outside the data (a page in the admin, a promotion calendar), labelled as an assumption;
- what to do.
For example, ask the AI Assistant: “Referral sales fell last quarter. Compare it with the same quarter last year by placement, starting with impressions, tell me which rate changed most, and list the settings changes in that window.”
Real decline or noise
Two periods of one program are not a randomised test: season, promotions and order volume differ between them. After the step 2 rule, Talkable's analysts read a material change against three references, in this order, and call it noise when it fails to clear them.
Is it outside the program's own range?
Compute each rate for each of the twelve months before the current period and take the lowest and the highest; the current period is not part of its own range.
A current rate inside that range is something the program has done before; one outside it is new.
Illustrative: a program whose monthly conversion rate has swung between 12% and 20% for a year is not in decline at 14%, while a program that has sat between 15% and 16% is.
Why bottom-of-funnel rates swing more. A rate built on few events moves more from one period to the next than one built on many. Advocacy rests on impressions, usually the largest count; conversion rests on visits, the smallest count before sales.
The program's own range shows how wide each rate's swing is at the program's volume, which is why it comes before any fixed threshold.
Does it hold month after month?
Find the month the change started. A step that stays is a change; one bad month followed by recovery is usually an event, such as a promotion or an outage.
Read whole months: each stage is dated by its own event, so weekly rates swing.
The last days of an open period have produced shares whose purchases have not happened yet:
- in the median program half of the referral purchases arrive within 2 days of the share;
- in the middle half of programs within 1–7 days (Talkable benchmark data, 185 programs, 2023–2025).
So the last week of an open period reads low (checklist row 1).
Is it outside the band?
A rate that falls but stays inside its placement's band is still normal for that placement; one that leaves the band has a gap worth working on whatever its history.
Daily watching
For a daily monitor Talkable's analysts use a rolling 28-day median per metric as the baseline (not the previous day, not the mean):
- a day at half the median or less is a warning;
- two such days in a row are a break;
- a day with no data at all is a failed pull, never a zero.
Day-over-day rules fire on ordinary weekends and go quiet on a sustained new level, which is the opposite of what a monitor is for.
For example, ask the AI Assistant: “Show my five funnel rates by month for the twelve months before last quarter, and tell me whether last quarter is inside or outside that range.”
Deep dive: the mix check
The mix check: separating reach from behaviour
Placements differ several-fold on advocacy (table above), so a whole-program rate moves whenever the share of impressions each placement carries moves, with no advocate behaving differently. The check: weight each placement's current rate by its base volume and sum:
rate at base mix = Σ (current rate of placement p × base denominator of placement p) ÷ Σ base denominator of placement p
mix share of the change = (current rate − rate at base mix) ÷ (current rate − base rate)
The same formula applies to each rate with its own denominator (sharers for the sharing rate, shares for the click rate, clicks for the visit rate, visits for conversion), because a mix shift drags the lower stages too.
Read the result against the two blended figures:
- near the base, the change is mix;
- near the current, behaviour changed inside the placements;
- in between, both, and the mix share says how much.
Both parts are real and have different fixes:
- for advocacy, the mix part is a change in reach: fewer people reached the placement that converts best. It routes to step 4 (why that placement lost impressions);
- for a later rate, the mix part is that rate's denominator (sharers, shares, clicks or visits) moving between placements, which follows the earlier rates: find the placement that gained or lost that count (the script's weighted-by column names it);
- the rest is the share page or claim page converting differently within a placement, steps 5–8.
The script runs the mix check rate by rate:
- A placement with no base for a rate in one of the two periods keeps its base rate in the sum, because its appearance or disappearance is itself a mix change.
- So does a placement that started or stopped showing, even when late clicks or sales give it a rate in the other period.
- If a placement has sales but no visits in a period (late sales), the script skips the mix check for that rate and says so.
The same check applies to campaign groups, channels and devices whenever a blended rate is compared across periods.
For example, ask the Talkable AI Assistant: “For last quarter and the quarter before, show each placement's share of impressions and its advocacy rate, and compute last quarter's advocacy at the earlier quarter's placement mix.”
Calculate it for your own program
Every count and rate in this article is one Talkable API or MCP call per period. The result equals the Metrics Aggregation Report in the Talkable admin for the same period, campaigns and filters. There are three ways to get it:
- Talkable AI Assistant, in your Talkable admin: ask in one sentence, no set-up.
- Talkable MCP server: your own agent (OpenClaw, Claude Code or any other) calls the tool
calculate_metric. - Talkable metrics API: an HTTP request or the Python script below, with your API key.
The Talkable MCP server and the AI Assistant are enabled per site by your Customer Success Manager (CSM). The HTTP and Python examples need only the API key.
Get your API key
- In the Talkable admin, open All site settings → General → Integrations → API integration.
- Copy two values: the API key (the site's private key; keep it server-side) and the Site ID, which is the site slug. A scoped key that an account admin creates under Account settings → API Keys & MCP works too.
- Set them as
TALKABLE_API_KEYandTALKABLE_SITE_SLUGin your environment. No example on this page contains a key.
Authentication and error codes: Talkable API introduction.
What Talkable tracks
| Article term | API metric identifier | Metrics Aggregation | Returns · use in the audit |
|---|---|---|---|
| Impressions | advocate_impressions = offer_shown + signup_shown − sign_up | Advocate Impressions = Advocate Share Page Shown + Signup Page shown − Sign Up | number · steps 4 and 5; the three parts for checklist row 12 |
| Sharers | sharers | Sharers | number · dated by the offer's creation |
| Shares | shares | Shares | number · step 6, by channel |
| Clicks | clicks | Offer Clicks | number · step 7 |
| Visits | visits | Site Visits | number · steps 7 and 8 |
| Friend referral sales | ideal_friend_sales_count | # Ideal FR sales | number · the funnel's outcome |
| Referral revenue (friend + advocate) | ideal_sales_sum | $ Ideal sales, under Hidden Metrics (= $ Ideal FR sales + $ Ideal AD sales) | money · step 9 |
| Store orders | total_sales_count | # Sales, under Hidden Metrics | number · every purchase and event the store sends; step 4, Post-purchase |
| Total store revenue | total_sales_sum | $ Sales, under Hidden Metrics | money · the denominator of referral revenue share |
| Referral revenue share | revenue_percentage | Revenue percentage | percent · referral revenue ÷ total store revenue, the program's share of the store |
| Offers | offers | Offers | number · step 4, the render check and the Floating widget |
| Advocacy rate | advocacy_percentage | Advocacy percentage | percent |
| Sharing rate | sharing_rate | Sharing rate | ratio |
| Click rate | click_rate | Click Rate | ratio, not a percent |
| Visit rate | visit_percentage | Visit Percentage | percent |
| Conversion rate | conversion_percentage | Friend Conversion Percentage | percent |
How a call works
- One metric:
GET https://www.talkable.com/api/v2/metrics/{metric}withsite_slug,start_dateandend_date. - A split (by month, placement, channel): add
/segmentizeto the same path. - The answer: one value as
{"plain": …, "formatted": "…", "result_type": …}. A split returns{"segmented": [ … ]}, one value per row with its label (period,campaign_type,sharing_channel). - Precision: percents come back with two decimals, ratios with four. Each rate metric equals the rate computed from its two counts.
- Money comes back in the site's reporting currency;
formattedcarries its symbol. - Through the Talkable MCP server the tool is
calculate_metric: the same identifiers, several metrics in one call. - Two periods: a comparison is two calls, one per period.
API reference: Talkable API documentation.
Filters and segmentations for this question
| Parameter | Values | Use it to |
|---|---|---|
start_date, end_date | YYYY-MM-DD, e.g. 2026-07-01 (REST also takes M/D/YYYY); both days included; days run in the account time zone | One call per period: the current period, then the base period |
segment_by[campaign_types]=true | one row per placement the store runs: post_purchase, standalone, dashboard, floating_widget, gleam, claim_by_name | The per-placement comparison and the mix check. Campaigns with no campaign type count in the site total only (Troubleshooting) |
segment_by[period]=month | day, week, month, quarter, year; up to 1,000 rows per request | The program's own range over the twelve months before the current period |
segment_by[sharing_channels]=true | one row per channel, keyed sharing_channel | Step 6: the channel mix behind click and visit rate |
segment_by[traffic_sources]=true, device_type | identifiers from GET /api/v2/traffic_sources; mobile / desktop: the advocate's device for impressions, sharers and shares, the friend's for clicks and visits, the buyer's for sales | Steps 4 and 5: where Standalone impressions came from; whether one device carries the change |
campaign_ids[] | ids from GET /api/v2/campaigns, which also returns each campaign's status, live period and appearance | The same campaign set on both sides; a campaign that moved placement, grouped by id (checklist row 10) |
exclude_qa_generated | default true | Keep the default on both sides (checklist row 5) |
MCP calculate_metric adds | segment_by: date_range with aggregate_period (day, week, month), campaigns, campaign_types, incentive_combinations, sharing_channels, traffic_sources, device_type; exclude_refunded; currency. MCP names its filters exclude_qa, campaign_ids, sharing_channel_ids and traffic_source_ids (ids, not names); dates are YYYY-MM-DD in period_start / period_end | Step 5's offer check (incentive_combinations) and the same cuts from an agent, several metrics per call |
MCP list_settings_changes | created_at_from, created_at_to, campaign_id, changes_in (Campaigns, Site, Account) | What was changed in the window, by whom, on which campaign (steps 5, 7, 8) |
Examples in four tabs
The same comparison four ways: ask in plain language, call the Talkable MCP server, send the HTTP requests, or run the Python script.
Talkable AI Assistant (in your Talkable admin; what it can report)
One sentence is enough:
Compare my referral funnel for July 1 – September 30, 2026 with July 1 – September 30, 2025, overall and by placement; tell me which stage changed most and whether the placement mix explains it, and list the settings changes made in July–September 2026.
Your own agent (OpenClaw, Claude Code or any other agent)
Your agent does not know how Talkable defines the funnel, its bands or the rules for reading a change. Send it the same sentence and use the method in this report:
Compare my referral funnel for July 1 – September 30, 2026 with July 1 – September 30, 2025, overall and by placement; tell me which stage changed most and whether the placement mix explains it, and list the settings changes made in July–September 2026. Use the method in this report: https://www.talkable.com/analytics/is-my-referral-program-working
The agent also needs your API key or a connection to the Talkable MCP server.
Talkable MCP server, tool calculate_metric, one call per period
To connect your agent (endpoint, credentials, client set-up), see the Talkable MCP server documentation.
{
"site_slug": "your-site",
"metrics": ["advocate_impressions", "sharers", "shares", "clicks", "visits",
"ideal_friend_sales_count", "ideal_sales_sum",
"total_sales_count", "total_sales_sum"],
"period_type": "custom",
"period_start": "2026-07-01",
"period_end": "2026-09-30",
"segment_by": ["campaign_types"]
}
The response, on the worked example: each metric is one object with a key per campaign type and a total.
{"metrics": {
"advocate_impressions": {"campaign_types=post_purchase": 85000,
"campaign_types=standalone": 10000, "total": 95000},
"sharers": {"campaign_types=post_purchase": 3400,
"campaign_types=standalone": 1200, "total": 4600},
...}}
- One call gives both the site totals and the placement split for the current period. Campaigns with no campaign type sit in the total only.
- Base period: repeat with
"period_start": "2025-07-01", "period_end": "2025-09-30". Compute the rates from the counts and apply steps 2–5 of the report method. - The offer check (audit step 5): replace
segment_bywith["incentive_combinations"]. - The monthly range:
["date_range"]with"aggregate_period": "month", one quarter per call.
The settings changed in the window: tool list_settings_changes.
{
"site_slug": "your-site",
"created_at_from": "2026-07-01",
"created_at_to": "2026-09-30",
"changes_in": "Campaigns"
}
It returns one row per change: its time, the user, the action (created, updated, deleted), the campaign id and what was changed.
HTTP (curl): the raw requests any language can send
The responses below are the shapes the Python script parses, illustrative, on the worked example's current quarter (3,105 visits) and base quarter (5,040). Authentication and errors: Talkable API introduction.
# one metric, the current period, then the same for the base period
curl -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/visits?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30"
# -> {"ok":true,"result":{"plain":3105,"formatted":"3,105","result_type":"number"}}
curl -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/visits?site_slug=$TALKABLE_SITE_SLUG&start_date=2025-07-01&end_date=2025-09-30"
# -> {"ok":true,"result":{"plain":5040,"formatted":"5,040","result_type":"number"}}
# the same metric by placement, one row per campaign_type (campaigns with no type are in the period total only)
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/visits/segmentize?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30&segment_by[campaign_types]=true"
# -> {"ok":true,"result":{"segmented":[
# {"plain":0,"formatted":"0","result_type":"number","campaign_type":"dashboard"},
# {"plain":0,"formatted":"0","result_type":"number","campaign_type":"floating_widget"},
# {"plain":0,"formatted":"0","result_type":"number","campaign_type":"gleam"},
# {"plain":2535,"formatted":"2,535","result_type":"number","campaign_type":"post_purchase"},
# {"plain":570,"formatted":"570","result_type":"number","campaign_type":"standalone"}]}}
# shares by sharing channel (step 6)
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/shares/segmentize?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30&segment_by[sharing_channels]=true"
# -> {"ok":true,"result":{"segmented":[
# {"plain":3900,"formatted":"3,900","result_type":"number","sharing_channel":"Email"},
# {"plain":2100,"formatted":"2,100","result_type":"number","sharing_channel":"Direct link"}, ... ]}}
# the twelve months before the current period, by month (the program's own range)
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/visits/segmentize?site_slug=$TALKABLE_SITE_SLUG&start_date=2025-07-01&end_date=2026-06-30&segment_by[period]=month"
# -> {"ok":true,"result":{"segmented":[
# {"plain":1680,"formatted":"1,680","result_type":"number","period":"7/1/25 - 7/31/25"}, ... ]}}
# a range too heavy to split at once
# -> HTTP 503 {"ok":false,"error_message":"Metric is temporarily unavailable, please try again.
# Narrow the segmentation, or schedule it with POST /api/v2/metrics/visits/segmentize ..."}
# -> call each half of the range
- Repeat the calls for each identifier in the metrics table above, and for both periods.
- The
-gflag stops curl from interpreting the square brackets insegment_by[…]. - An error comes back as
{"ok":false,"error_message":"…"}, for exampleNo metric found.for an unknown identifier.
Python: the full script
Prints both periods side by side: counts, rates and referral revenue with their changes, the verdict, the store beside the program, each placement against its band, the mix check and the twelve-month range. Needs Python 3 and requests (pip install requests); reads the key from TALKABLE_API_KEY and TALKABLE_SITE_SLUG.
"""Did my referral program change? Two periods of one Talkable site side by side.
Prints, for a current period and a base period (the previous period, or the same period last year):
the six funnel counts, the five rates and referral revenue with their relative change; the stage whose
rate changed most and the pattern; the store beside the program (orders, post-purchase impressions
against orders, referral revenue share, and whether orders held); the same funnel by placement (campaign
type), each rate read against the published 2025 band; the placement-mix check (current rates at the base
period's mix, and the share of the change the mix explains: for advocacy a change in reach, for a later rate its
denominator moving between placements); and the program's
own monthly range over the twelve months before the current period. A placement is counted in the change across
placements only with at least 30 impressions in both periods; one that started or stopped showing is a mix change.
When the whole program held, the placement read decides: a placement whose impressions moved 15% or more, or a rate
10% or more, rules out "no material change", and so does one that started or stopped showing (a mix change). In the
mix check, a placement that started or stopped showing keeps its base rate: its late clicks and sales after it
stopped are not behaviour inside it.
Usage:
pip install requests
export TALKABLE_API_KEY=... # All site settings -> General -> Integrations -> API integration: "API key"
export TALKABLE_SITE_SLUG=... # same page, "Site ID"
python3 referral_change.py 2026-07-01 2026-09-30 2025-07-01 2025-09-30
^ current period ^ base period
Dates are YYYY-MM-DD, both days included, in the account time zone. Money is in the site's reporting
currency. Rates are computed without rounding; only display rounds percents to 2 decimals and ratios to 4, and a
rate that rounds onto a band end reads "just below band" or "just above band". A relative change prints with more
decimals when one decimal would put it on the other side of the 10% or 15% cut-off (+14.96%, not +15.0%). A zero
denominator prints "n/a";
measured gains from zero remain changes, with no relative percentage.
The post-purchase band of each period is decided by the campaigns that showed the row in that period (their
impressions in it), not by today's Live status: a campaign that starts on an order (joinable_category_names
["purchase"]) and is named "Shopify Extension(s)" or tagged shopify-new-checkout means the Shopify checkout
extension band, any other order-started campaign the Post-purchase band. A Post Event popup (one that starts on
another event, such as a review-email popup) is named and never sets the band; a row shown only by Post Event
popups has no band. If the store switched between the classic prompt and the extension inside a period and no day
showed both (the days each showed impressions), the script prints the switch date and leaves that period without a
band: run it for the days before it and for the days from it; if the two showed on the same days, read their
campaigns by id. If the store switched between the two periods, the post-purchase row is read as two placements,
each against its own band: one stopped and one started showing, a mix change. The row is split the same way
whenever more than one kind has counts in it (a Post Event popup, or the other kind's clicks and sales after it
stopped showing), so a kind that started or stopped is a mix change, not a change inside the placement. Each
campaign's counts stay with its own kind, late clicks, sales and revenue included, and Post Event popups are a row
of their own with no band; a kind is read against its band only in a period in which it showed. A period whose
popup campaigns do not add up to the row is not split, and the script says so: part of a change in that row can then
be a change between kinds. A period with the other kind's late clicks or sales in it (revenue alone does not count)
has no band. With no band, only the band read is missing: the placement read and
the mix check still run.
An extension in its older setup, shown through the floating widget, sits in the Floating widget row: the script
moves that campaign's counts to the post-purchase row and says so, so reach, the band, the switch date and the mix
check read one checkout offer. Its six funnel counts must fit in that row (its revenue is matched on its own, so a
cent of currency rounding moves no count); if its counts cannot be read, or a count, read a moment later, does not
fit in either period, the campaign stays in the Floating widget row in both periods, that row has no band (it may hold
checkout traffic), and the script says which reads that touches. Such a
campaign starts on the widget's event (["affiliate_member"]), not on an order: its name or tag identifies it. Reach
(post-purchase impressions per store order) counts only order-started campaigns and the extension (an older copy only
by its impressions in the Floating widget row), an older extension copy and its replacement as one; if the store
switched between the classic prompt and the extension between the
two periods, the reach ratio is skipped. If an extra check fails after its retries, only that check is skipped; a
failed main call stops the script. Campaign names, tags and dates are today's settings: check past changes in the
Talkable admin.
"""
import os
import re
import sys
import time
from datetime import date, timedelta
from fractions import Fraction
import requests
API = "https://www.talkable.com/api/v2"
STAGES = [ # article term -> API metric identifier
("Impressions", "advocate_impressions"),
("Sharers", "sharers"),
("Shares", "shares"),
("Clicks", "clicks"),
("Visits", "visits"),
("Friend referral sales", "ideal_friend_sales_count"),
]
MONEY = [("Referral revenue", "ideal_sales_sum")] # friend + advocate referral revenue
STORE = [ # the program's view of store activity: purchases and events the store sends, unless filtered
("Store orders", "total_sales_count"),
("Total store revenue", "total_sales_sum"),
]
RATES = [ # rate -> (numerator stage, denominator stage, unit)
("Advocacy rate", "Sharers", "Impressions", "%"),
("Sharing rate", "Shares", "Sharers", "ratio"),
("Click rate", "Clicks", "Shares", "ratio"),
("Visit rate", "Visits", "Clicks", "%"),
("Conversion rate", "Friend referral sales", "Visits", "%"),
]
PLACEMENT = { # API campaign_type -> placement or campaign type name in the Talkable admin
"post_purchase": "Post-purchase",
"standalone": "Standalone",
"dashboard": "Advocate dashboard",
"floating_widget": "Floating widget",
"gleam": "Reward Gleam",
"claim_by_name": "Claim by name",
}
OTHER = "Other campaigns (no type)" # Leaderboard, Tiered Rewards, full-bleed Invite on a page of their own: in the total only
EXTENSION = "shopify_extension"
CHECKOUT = {"post_purchase": "the classic prompt", EXTENSION: "the Shopify checkout extension"}
BANDS = { # published typical range per placement, Talkable benchmark data, 2025 (percents for %, plain for ratios)
"standalone": {"Advocacy rate": (7.79, 16.32), "Sharing rate": (1.31, 1.80), "Click rate": (1.43, 2.64),
"Visit rate": (35.70, 49.16), "Conversion rate": (11.09, 25.00)},
"floating_widget": {"Advocacy rate": (4.72, 14.41), "Sharing rate": (1.21, 1.71), "Click rate": (0.93, 1.66),
"Visit rate": (35.21, 53.69), "Conversion rate": (11.19, 24.56)},
"post_purchase": {"Advocacy rate": (2.12, 7.27), "Sharing rate": (1.11, 1.37), "Click rate": (0.61, 0.89),
"Visit rate": (34.11, 49.48), "Conversion rate": (6.84, 15.61)},
EXTENSION: {"Advocacy rate": (0.89, 2.17), "Sharing rate": (1.10, 1.17), "Click rate": (1.08, 1.91),
"Visit rate": (34.6, 45.7), "Conversion rate": (8.6, 21.7)}, # 2023-2025
"all": {"Advocacy rate": (3.31, 8.72), "Sharing rate": (1.26, 1.49), "Click rate": (1.16, 2.35),
"Visit rate": (34.1, 49.0), "Conversion rate": (10.09, 22.90)},
}
READ_AS = {"dashboard": "standalone", "other": "standalone"} # standalone-type pages: Standalone bands
# Working rules Talkable's analysts apply (practice, not a statistical test):
RATE_MATERIAL = Fraction(1, 10) # a rate that moved less than 10% is read as stable
IMPRESSIONS_MATERIAL = Fraction(15, 100) # impressions that moved less than 15% are read as stable
CUTS = (RATE_MATERIAL, IMPRESSIONS_MATERIAL) # a printed change keeps the side of each cut-off that its exact value is on
PLACEMENT_SPREAD = 20.0 # magnitude differences, not the number of changed placements
MIN_IMPRESSIONS = 30 # working rule: a placement is read on its own only with 30+ impressions in both periods
class Narrow(Exception):
"""HTTP 503 narrowing hint: split monthly ranges; retry placement queries within the request limit."""
def get(path, **params):
params = {"site_slug": SITE, **params}
for attempt in range(5):
r = requests.get(f"{API}/{path}", params=params,
headers={"Authorization": f"Bearer {KEY}"}, timeout=120)
if r.status_code == 503 and "Narrow the segmentation" in r.text:
# Monthly history splits immediately; placement budgets use the bounded retry below.
if params.get("segment_by[campaign_types]") != "true" or attempt == 4:
raise Narrow(f"{path}: {params.get('start_date')} -> {params.get('end_date')}: "
f"HTTP 503: {r.text}")
if r.status_code in (429, 503) and attempt < 4: # 429 API throttle, 503 metrics budget spent
time.sleep(5 * 2 ** attempt) # 5, 10, 20, 40 s
continue
try:
body = r.json()
except ValueError:
body = {}
if body.get("ok") is False: # e.g. 400 "No metric found.", 422 over 1,000 segmentation rows
raise RuntimeError(f"{path}: HTTP {r.status_code}: {body.get('error_message')}")
r.raise_for_status()
return body["result"]
def metric(name, start, end):
return get(f"metrics/{name}", start_date=start, end_date=end)
def segmented(name, start, end, **segment):
params = {f"segment_by[{k}]": v for k, v in segment.items()}
return get(f"metrics/{name}/segmentize", start_date=start, end_date=end, **params)["segmented"]
def by_month(name, start, end):
"""Month split for one metric; a range the API asks to narrow is split in half until it answers."""
try:
return segmented(name, start, end, period="month")
except Narrow:
first, last = date.fromisoformat(start).replace(day=1), date.fromisoformat(end).replace(day=1)
if first == last:
raise
months = (last.year - first.year) * 12 + last.month - first.month + 1
mid = first
for _ in range(months // 2):
mid = (mid.replace(day=28) + timedelta(days=4)).replace(day=1)
return by_month(name, start, (mid - timedelta(days=1)).isoformat()) + by_month(name, mid.isoformat(), end)
def exact(x):
"""A count or rate as an exact fraction: the 10% / 15% cut-offs are decided on counts; display rounds."""
return x if isinstance(x, Fraction) else Fraction(str(x))
def rate(num, den, unit):
if not den:
return None
return 100 * exact(num) / exact(den) if unit == "%" else exact(num) / exact(den)
def rates(c):
return {name: rate(c[n], c[d], u) for name, n, d, u in RATES}
def rel(cur, base):
"""Relative change, current against base: -0.25 = a quarter lower. None when the base is 0."""
if cur is None or base is None or not base:
return None
return (exact(cur) - exact(base)) / exact(base)
def fmt(x, unit=""):
if x is None:
return "n/a"
if unit == "rel": # +14.96% prints as +14.96%, not +15.0%: the decision is on the exact value
for places in (1, 2, 3, 4):
shown = round(100 * exact(x), places)
if all((abs(shown) >= 100 * cut) == (abs(exact(x)) >= cut) for cut in CUTS):
return f"{float(shown):+.{places}f}%"
cut = min(c for c in CUTS if abs(exact(x)) < c)
return f"just {'above -' if x < 0 else 'under +'}{float(100 * cut):g}%" # -9.99998% is just above -10%
if isinstance(x, Fraction):
x = float(x)
if unit == "%":
return f"{x:.2f}%"
if unit == "ratio":
return f"{x:.4f}"
if unit == "money":
return f"{x:,.2f}"
return f"{x:,}"
def band(value, ct, name, unit=None):
lo_hi = BANDS.get(READ_AS.get(ct, ct), {}).get(name)
if value is None or lo_hi is None:
return ""
lo, hi = exact(lo_hi[0]), exact(lo_hi[1]) # the published bounds as written: 1.10 is exactly 11/10
read = "below band" if value < lo else "above band" if value > hi else "in band"
if unit and read != "in band" and lo <= exact(fmt(value, unit).rstrip("%")) <= hi:
return "just " + read # the printed value rounds onto the band end
return read
def counts(start, end):
raw = {term: metric(m, start, end) for term, m in STAGES + MONEY + STORE}
c = {term: r["plain"] for term, r in raw.items()}
c["currency"] = re.sub(r"[\d.,\s-]", "", raw["Referral revenue"]["formatted"]) # e.g. "$"
return c
def by_placement(start, end, total):
"""Return placement rows and reconciliation status; no-type campaigns count in the total only."""
cols = {term: {r["campaign_type"]: r["plain"] for r in segmented(m, start, end, campaign_types="true")}
for term, m in STAGES + MONEY}
seen = {ct for col in cols.values() for ct in col}
types = [ct for ct in PLACEMENT if ct in seen] + sorted(seen - set(PLACEMENT))
rows = {PLACEMENT.get(ct, ct): {term: cols[term].get(ct, 0) for term, _ in STAGES + MONEY} for ct in types}
other = {term: round(total[term] - sum(r[term] for r in rows.values()), 2) for term, _ in STAGES + MONEY}
reconciled = not any(other[t] < 0 for t, _ in STAGES)
for term, _ in MONEY:
residual = other[term]
if residual:
print(f" {term} left over for {start} -> {end}: {residual:+,.2f} (site total minus placement rows: "
"currency rounding or revenue with no placement; the funnel counts are not affected).")
other[term] = max(0, residual) # Never label a negative currency residual as Other revenue.
if not reconciled: # A negative funnel residual is not a no-type campaign count; re-pull matching snapshots.
print(f" The placement rows add up to more than the site total for {start} -> {end} (site total minus rows: "
+ ", ".join(f"{t}: {v:,}" for t, v in other.items())
+ "). Pull both again on the same day; the placement read is skipped.")
if any(other[t] for t, _ in STAGES):
rows[OTHER] = other
return rows, reconciled
def day_of(period):
"""'7/15/26 - 7/15/26' -> '2026-07-15' (the first day of a period row)."""
m, d, y = re.match(r"(\d{1,2})/(\d{1,2})/(\d{2,4})", period).groups()
return date(int(y) + 2000 if len(y) == 2 else int(y), int(m), int(d)).isoformat()
def popup_rows(metric, campaign_id, start, end, row="post_purchase", **params):
"""One campaign's rows in one placement row of the period (by default the post_purchase row)."""
rows = get(f"metrics/{metric}/segmentize", start_date=start, end_date=end,
**{"campaign_ids[]": [campaign_id], "segment_by[campaign_types]": "true", **params})["segmented"]
return [r for r in rows if r.get("campaign_type") == row]
def is_extension(c):
"""A campaign named "Shopify Extension(s)" or tagged shopify-new-checkout is the Shopify checkout extension."""
return "shopify extension" in (c.get("name") or "").lower() or "shopify-new-checkout" in (c.get("tag_names") or [])
def widget_extension(start, end, placements, campaigns):
"""-> (moved, problem): each extension in its older setup, shown through the floating widget, with its counts in the
period, to move to Post-purchase (move_widget_extension); problem says why they cannot move, else None.
Reach already counts such a campaign as the extension; its counts sit in the Floating widget row. Moved to the
Post-purchase row, reach, the band and the mix check read one checkout offer. Other widget campaigns stay. Only the
six funnel counts must fit in the row: revenue is matched on its own (move_widget_extension)."""
if campaigns is None or "Floating widget" not in placements:
return [], None
moved = []
for c in campaigns: # it starts on the widget's event, such as ["affiliate_member"]: its name or tag identifies it
if c.get("appearance") in (None, "popup") or not is_extension(c):
continue
try:
counts = {term: sum(r["plain"] for r in popup_rows(m, c["id"], start, end, "floating_widget"))
for term, m in STAGES + MONEY}
except (Narrow, RuntimeError, requests.RequestException) as e:
return [], (f"could not read campaign {c['id']} ({e}), named or tagged as the Shopify checkout extension "
"(whether it showed through the floating widget is not known)")
if any(counts.values()):
moved.append((c["id"], counts))
widget = placements["Floating widget"]
over = [t for t, _ in STAGES if sum(counts[t] for _, counts in moved) > widget.get(t, 0)]
if over: # the campaign read came a moment after the row read: never move more than the row holds
return moved, (f"campaign {', '.join(str(i) for i, _ in moved)}, the Shopify checkout extension shown through "
f"the floating widget, holds more {', '.join(t.lower() for t in over)} than the Floating widget "
"row (a share or sale recorded between the two reads, in a period that includes today)")
return moved, None
def move_widget_extension(placements, moved):
"""Move the counts from widget_extension into the Post-purchase row -> a note, or None when nothing moved.
Revenue is matched apart from the funnel counts: per-order currency conversion can put the campaign's revenue a cent
off the row's. The move takes the campaign's revenue, never more than the row holds; the note gives any difference."""
if not moved:
return None
widget = placements["Floating widget"]
row = placements.setdefault("Post-purchase", {t: 0 for t, _ in STAGES + MONEY})
for _, counts in moved:
for term, _ in STAGES:
widget[term] -= counts[term]
row[term] += counts[term]
read = round(sum(counts["Referral revenue"] for _, counts in moved), 2)
held = widget.get("Referral revenue", 0)
take = min(read, held)
moved[-1][1]["Referral revenue"] = round(moved[-1][1]["Referral revenue"] + take - read, 2) # what moved, for the split
widget["Referral revenue"] = round(held - take, 2)
row["Referral revenue"] = round(row.get("Referral revenue", 0) + take, 2)
rest = widget["Referral revenue"] if not any(widget[t] for t, _ in STAGES) else 0 # revenue with no count left
if not any(widget.values()):
del placements["Floating widget"]
ids = ", ".join(str(i) for i, _ in moved)
gap = round(read - take, 2)
return (f"campaign {ids}, the Shopify checkout extension shown through the floating widget (its older setup), is "
"read in this row with the extension, not in Floating widget"
+ (f"; its referral revenue reads {gap:,.2f} above the Floating widget row's (currency rounding, or a sale "
f"recorded between the two reads): the row's {take:,.2f} moved with it, the funnel counts are not affected"
if gap else "")
+ (f"; its referral revenue reads {rest:,.2f} below the Floating widget row's, and that {rest:,.2f} stays "
"in Floating widget with no funnel counts (currency rounding, or another widget campaign's referral "
"revenue): the funnel counts are not affected" if rest else ""))
def day_ranges(start, end, size=1000):
"""The period in pieces of at most 1,000 days: one by-day request covers at most 1,000 days."""
a, z = date.fromisoformat(start), date.fromisoformat(end)
while a <= z:
b = min(z, a + timedelta(days=size - 1))
yield a.isoformat(), b.isoformat()
a = b + timedelta(days=1)
def switch_day(kinds, start, end):
"""-> (from, to, day) when one checkout kind stopped before the other started showing (no day with both), else None.
kinds holds (campaign id, placement row) pairs: the extension in its older setup shows in the floating_widget row."""
days = {}
for key, ids in kinds.items():
days[key] = sorted(day_of(r["period"]) for i, row in ids for a, z in day_ranges(start, end)
for r in popup_rows("advocate_impressions", i, a, z, row, **{"segment_by[period]": "day"})
if r["plain"])
if not all(days.values()):
return None
(first, a), (then, b) = sorted(days.items(), key=lambda kv: kv[1][0])
return (first, then, b[0]) if a[-1] < b[0] else None
def post_purchase_band(start, end, expected, campaigns, moved=()):
"""-> (band key or None, notes, split): the band of the post_purchase row, from the campaigns that showed it in the period.
A campaign named "Shopify Extension(s)" or tagged shopify-new-checkout means the Shopify checkout extension band,
any other campaign that starts on an order the Post-purchase band. Post Event popups stay in the row and are named;
they never block the band, and they never set one: with no order-started campaign the row has no band. Late
clicks or sales of the other checkout kind in the row leave it without a single band.
split holds the row's counts by kind ("post_purchase", EXTENSION, "post_event"), each campaign under its own kind
with its late activity; None when the popup campaigns do not add up to the row.
campaigns is None when the campaign list could not be read; moved holds the widget-shown extension campaigns
whose counts were moved into this row (widget_extension)."""
row_revenue = expected.get("Referral revenue", 0)
expected = {t: expected.get(t, 0) for t, _ in STAGES}
covered = {t: 0 for t, _ in STAGES}
kinds = {} # band key -> (id, placement row) of the order-started campaigns with impressions in the period
split = {} # kind -> the counts of its campaigns, late activity included
post_event = []
if campaigns is None:
return None, ["could not read the campaign list: check in the Talkable admin which post-purchase offer ran"], None
for c in campaigns:
if c.get("appearance") and c["appearance"] != "popup": # only popups count in the post_purchase row
continue
counts = {}
for term, metric in STAGES + MONEY:
try:
counts[term] = sum(r["plain"] for r in popup_rows(metric, c["id"], start, end))
except (Narrow, RuntimeError, requests.RequestException) as e:
return None, [f"could not read campaign {c['id']} ({metric}: {e}): check in the Talkable admin "
"which post-purchase offer ran"], None
for term in covered:
covered[term] += counts[term]
if c.get("joinable_category_names") != ["purchase"]: # a Post Event popup, e.g. a review-email popup
kind = "post_event"
if any(counts[t] for t, _ in STAGES):
post_event.append(str(c["id"]))
else:
kind = EXTENSION if is_extension(c) else "post_purchase"
row = split.setdefault(kind, {t: 0 for t, _ in STAGES + MONEY})
for term in row:
row[term] += counts[term]
if kind == "post_event" or not counts["Impressions"]:
continue # late clicks or sales of a campaign that no longer showed do not decide the band
kinds.setdefault(kind, []).append((c["id"], "post_purchase"))
for cid, counts in moved: # the extension in its older setup: its counts were moved into this row
for term in covered:
covered[term] += counts[term]
row = split.setdefault(EXTENSION, {t: 0 for t, _ in STAGES + MONEY})
for term in row:
row[term] += counts[term]
if counts["Impressions"]:
kinds.setdefault(EXTENSION, []).append((cid, "floating_widget"))
notes = [f"Post Event popups in this row (campaign {', '.join(post_event)})"] if post_event and kinds else []
if covered != expected:
return None, notes + ["the popup campaigns do not add up to the post-purchase row: check in the Talkable "
"admin which post-purchase offer ran"], None
gap = round(sum(r["Referral revenue"] for r in split.values()) - row_revenue, 2)
if gap: # read a moment apart: a sale recorded in between (a period that includes today), or currency rounding
notes.append(f"the campaigns' referral revenue differs from the row's by {gap:+,.2f} (a sale recorded between "
"the two reads, in a period that includes today, or currency rounding): the counts by kind are "
"not affected")
if len(kinds) > 1:
try:
switch = switch_day(kinds, start, end) # from the days each kind showed impressions
except (Narrow, RuntimeError, requests.RequestException):
switch = None
if switch:
first, then, day = switch
before = (date.fromisoformat(day) - timedelta(days=1)).isoformat()
return None, notes + [f"the store switched from {CHECKOUT[first]} to {CHECKOUT[then]} on {day}: run the "
f"report for {start} -> {before} and for {day} -> {end}"], split
return None, notes + ["the classic prompt and the Shopify checkout extension both showed in this period: "
"read their campaigns by id"], split
if not kinds: # no campaign that starts on an order showed the row: nothing sets its band
if post_event:
notes.append(f"only Post Event popups showed this row (campaign {', '.join(post_event)}): no campaign that "
"starts on an order sets its band, so the row is read without one")
elif any(expected.values()):
notes.append("no campaign showed this row in the period (only late activity from earlier shares): "
"the row is read without a band")
return None, notes, split
kind = next(iter(kinds))
late = [k for k in CHECKOUT if k != kind and any(split.get(k, {}).get(t, 0) for t, _ in STAGES)]
if late: # the other kind's clicks or sales after it stopped showing would blend into this kind's band read
# (revenue alone, such as an advocate's coupon used later, does not touch the rates)
return None, notes + [f"{CHECKOUT[late[0]]} still had clicks or sales in this period after it stopped showing: "
f"with {CHECKOUT[kind]} in one row there is no single band; each kind is read as a row "
"of its own where both periods' campaigns add up"], split
return kind, notes, split
def month_history(before):
"""Twelve calendar months ending the month before `before` (the current period's start)."""
stop = date.fromisoformat(before).replace(day=1) - timedelta(days=1)
start = stop.replace(day=1)
for _ in range(11):
start = (start - timedelta(days=1)).replace(day=1)
cols = {term: by_month(m, start.isoformat(), stop.isoformat()) for term, m in STAGES}
return [(row["period"], {term: cols[term][i]["plain"] for term, _ in STAGES})
for i, row in enumerate(cols["Impressions"])]
def print_table(head, rows):
widths = [max(len(str(r[i])) for r in [head] + rows) for i in range(len(head))]
for r in [head] + rows:
print(" " + " ".join(str(x).ljust(w) if i == 0 else str(x).rjust(w)
for i, (x, w) in enumerate(zip(r, widths))))
def compare(label, cur, base, ct=None, base_ct=None):
"""Counts, rates, relative changes and the band read for one row set (the site, or one placement).
ct is the current period's band key, base_ct the base period's: a rate measured only in the base period is read
against the base band."""
rc, rb = rates(cur), rates(base)
print(f"\n{label}")
rows = [(t, fmt(cur[t]), fmt(base[t]), fmt(rel(cur[t], base[t]), "rel")) for t, _ in STAGES]
rows.append(("Referral revenue", fmt(cur["Referral revenue"], "money"), fmt(base["Referral revenue"], "money"),
fmt(rel(cur["Referral revenue"], base["Referral revenue"]), "rel")))
print_table(("count", "current", "base", "change"), rows)
rows = [(name, fmt(rc[name], u), fmt(rb[name], u), fmt(rel(rc[name], rb[name]), "rel"),
f"base: {band(rb[name], base_ct, name, u)}" if rc[name] is None and rb[name] is not None
and base_ct is not None
else f"no band; base: {band(rb[name], base_ct, name, u)}" if ct is None and rc[name] is not None
and rb[name] is not None and base_ct is not None
else "no band" if ct is None
else band(rc[name], ct, name, u) if rc[name] is not None else "")
for name, _, _, u in RATES]
print_table(("rate", "current", "base", "change", "current vs 2025 band"), rows)
return rc, rb
def verdict(cur, base, rc, rb):
"""Which stage changed most = the rate with the largest relative change; then the pattern.
-> True when the whole program held (the placements still decide whether nothing changed), else None."""
changes = {name: rel(rc[name], rb[name]) for name, _, _, _ in RATES}
known = {k: v for k, v in changes.items() if v is not None}
print("\nVerdict")
from_zero = [name for name, _, _, _ in RATES
if rb[name] == 0 and rc[name] is not None and rc[name] > 0]
missing = [name for name, _, _, _ in RATES if rb[name] is None or rc[name] is None]
if len(missing) == len(RATES):
print(" No comparable rate data: choose periods with measured denominators.")
return
kc = {t: rel(cur[t], base[t]) for t, _ in STAGES}
kc = {k: v for k, v in kc.items() if v is not None}
imp = rel(cur["Impressions"], base["Impressions"])
if known:
top = max(abs(v) for v in known.values())
worst = [k for k, v in known.items() if abs(v) == top] # ties are named together
print(" Rate with the largest relative change: "
+ " and ".join(f"{k} ({fmt(known[k], 'rel')})" for k in worst) + ".")
for name in from_zero:
unit = next(u for k, _, _, u in RATES if k == name)
print(f" {name} rose from zero to {fmt(rc[name], unit)}; relative change is undefined.")
if kc:
top = max(abs(v) for v in kc.values())
wc = [k for k, v in kc.items() if abs(v) == top] # ties are named together
print(" Count with the largest relative change: "
+ " and ".join(f"{k} ({fmt(kc[k], 'rel')}, {fmt(cur[k] - base[k])} in absolute terms)" for k in wc) + ".")
moved = [name for name, _, _, _ in RATES
if name in from_zero or abs(known.get(name, 0)) >= RATE_MATERIAL]
if not moved:
projected_sales = exact(base["Friend referral sales"]) * exact(cur["Impressions"]) / exact(base["Impressions"]) \
if base["Impressions"] else None
tolerance = max(1, abs(projected_sales) * RATE_MATERIAL) if projected_sales is not None else None
volume_agrees = projected_sales is not None and abs(exact(cur["Friend referral sales"]) - projected_sales) <= tolerance
if base["Impressions"]:
scale = exact(cur["Impressions"]) / exact(base["Impressions"])
departures = [t for t, _ in STAGES[1:-1]
if abs(exact(cur[t]) - exact(base[t]) * scale) > max(1, abs(exact(base[t]) * scale) * RATE_MATERIAL)]
if departures:
print(" Counts that did not follow impressions (off by more than 10%, or one count): "
+ ", ".join(departures) + ".")
print(" Rate changes (including ones that cancel out): "
+ ", ".join(f"{name} {fmt(value, 'rel')}" for name, value in known.items() if value != 0)
+ ".")
if missing:
print(" Rates that cannot be compared: " + ", ".join(missing) + "; do not read the funnel as stable.")
elif not volume_agrees:
print(" Pattern: small rate changes added up (or base impressions are zero): sales did not follow "
"impressions. Go through the rates and the placement mix.")
if projected_sales is not None:
print(f" Sales at base rates and current impressions: {float(projected_sales):.1f}; "
f"actual friend referral sales: {fmt(cur['Friend referral sales'])}.")
elif imp is not None and abs(imp) >= IMPRESSIONS_MATERIAL:
print(f" Pattern: sales consistent with a change in reach. Every rate moved less than "
f"{float(RATE_MATERIAL):.0%} and actual sales are within 10% of base sales at current impressions (or "
f"within one sale). Impressions {fmt(imp, 'rel')}; read impressions by placement (step 4).")
gap = exact(cur["Friend referral sales"]) - projected_sales
if gap:
print(f" Sales at base rates and current impressions: {float(projected_sales):.1f}; actual friend "
f"referral sales: {fmt(cur['Friend referral sales'])}. The {float(abs(gap)):.1f} "
f"{'fewer' if gap < 0 else 'more'} sales come from the small rate changes listed above: report "
"them too.")
else:
print(f" Pattern: the whole program held. Every rate moved less than {float(RATE_MATERIAL):.0%} and "
f"impressions less than {float(IMPRESSIONS_MATERIAL):.0%}; the placement read below says whether "
"anything changed inside it.")
return True
return
print(f" Pattern: rates moved: {', '.join(moved)}."
" Check the placement mix first: a shift between placements moves the program's rate"
" with no change inside any placement.")
if known.get("Click rate", 0) >= RATE_MATERIAL and known.get("Visit rate", 0) <= -RATE_MATERIAL:
print(" Click rate up with visit rate down: check for one share link opened many times first (step 7).")
if "Conversion rate" in from_zero or known.get("Conversion rate", 0) >= RATE_MATERIAL:
print(" Conversion rate up: check for advocates whose link records about as many sales as visits (step 8).")
def checkout_reach(cs, ce, bs, be, campaigns):
"""Post-purchase reach from order-started campaigns; an older extension copy and its replacement count as one.
-> (current, base, kind); None when the populations cannot be matched; a string when a read failed (the reason)."""
totals = [{"post_purchase": 0, EXTENSION: 0} for _ in range(2)]
kinds = [set(), set()]
for c in campaigns:
origin = c.get("joinable_category_names")
legacy = is_extension(c) and c.get("appearance") not in (None, "popup")
if legacy:
origin = ["purchase"] # its older setup starts on the widget's event, but it is the checkout offer
if origin is not None and origin != ["purchase"]:
continue # Known non-purchase campaigns cannot contribute to checkout reach.
for i, (start, end) in enumerate(((cs, ce), (bs, be))):
try: # an older copy counts only where it showed as the extension: the Floating widget row
impressions = (sum(r["plain"] for r in popup_rows("advocate_impressions", c["id"], start, end,
"floating_widget")) if legacy else
get("metrics/advocate_impressions", start_date=start, end_date=end,
**{"campaign_ids[]": [c["id"]]})["plain"])
except (Narrow, RuntimeError, requests.RequestException) as e:
# Only reach is skipped; the placement read and the history still run.
return f"the impressions of campaign {c['id']} could not be read ({e})"
if not impressions:
continue
if origin is None:
return None
period = c.get("live_period") or {}
began, ended = period.get("starts_at"), period.get("ends_at")
if not c.get("name") or not began or began[:10] > end or (ended and ended < began):
return None
kind = EXTENSION if is_extension(c) else "post_purchase"
kinds[i].add(kind)
totals[i][kind] += impressions
if len(kinds[0]) != 1 or kinds[0] != kinds[1]:
return None # Mixed, absent or changed populations are not comparable.
kind = next(iter(kinds[0]))
return totals[0][kind], totals[1][kind], kind
def store_check(cur, base, cur_p, base_p, reconciled, reach):
"""The program against the store: orders, post-purchase reach, referral revenue share."""
print("\nThe store beside the program")
rows = []
for term, _ in STORE:
rows.append((term, fmt(cur[term], "money" if "revenue" in term else ""),
fmt(base[term], "money" if "revenue" in term else ""), fmt(rel(cur[term], base[term]), "rel")))
failed = reach if isinstance(reach, str) else None
pp_c, pp_b, kind = reach if reconciled and reach is not None and not failed else (None, None, None)
label = "Shopify checkout extension" if kind == EXTENSION else "Post-purchase (order-started campaigns)"
rows.append((label + " impressions / orders",
fmt(rate(pp_c, cur["Store orders"], "%") if pp_c is not None else None, "%"),
fmt(rate(pp_b, base["Store orders"], "%") if pp_b is not None else None, "%"), ""))
if failed:
print(f" Post-purchase reach skipped: {failed}; the rest of the report runs.")
elif pp_c is None:
print(" Post-purchase reach skipped: the order-started campaigns could not be matched in both periods "
"(for example, the store switched between the classic prompt and the extension). "
"Check past names and tags in the Talkable admin.")
rows.append(("Referral revenue share", fmt(rate(cur["Referral revenue"], cur["Total store revenue"], "%"), "%"),
fmt(rate(base["Referral revenue"], base["Total store revenue"], "%"), "%"), ""))
print_table(("store", "current", "base", "change"), rows)
orders, sales = rel(cur["Store orders"], base["Store orders"]), rel(cur["Friend referral sales"], base["Friend referral sales"])
if cur["Friend referral sales"] == base["Friend referral sales"]:
print(" Friend referral sales were flat; no referral-sales decline to diagnose.")
return
if orders is None or sales is None:
return
direction = "rose" if orders > 0 else "fell" if orders < 0 else "were flat"
if sales > 0 or orders >= IMPRESSIONS_MATERIAL:
print(f" Orders {direction} {fmt(orders, 'rel')}; friend referral sales moved {fmt(sales, 'rel')}. "
"Read the funnel before attributing the change.")
elif orders < 0 and orders <= sales: # Check proportional declines before the stable-orders threshold.
print(f" Orders fell {fmt(orders, 'rel')}, as much as friend referral sales ({fmt(sales, 'rel')}): the store changed.")
elif abs(orders) < IMPRESSIONS_MATERIAL:
print(f" Orders held ({fmt(orders, 'rel')}) while friend referral sales fell {fmt(sales, 'rel')}: "
"the cause is inside the program (reach, step 4, or a rate, steps 5-8).")
else:
print(f" Orders fell {fmt(orders, 'rel')}, friend referral sales {fmt(sales, 'rel')}: part store, part program.")
def points(spread, known):
"""The spread in points, with as many decimals as the printed changes it spans, on the right side of 20 points."""
places = max([1] + [len(fmt(v / 100, "rel").rstrip("%").partition(".")[2]) for v in known.values()])
while places < 4 and (round(exact(spread), places) > PLACEMENT_SPREAD) != (spread > PLACEMENT_SPREAD):
places += 1
if (round(exact(spread), places) > PLACEMENT_SPREAD) != (spread > PLACEMENT_SPREAD): # still on the cut-off
return f"just {'over' if spread > PLACEMENT_SPREAD else 'under'} {PLACEMENT_SPREAD:.0f}"
return f"{float(spread):.{places}f}"
def placement_check(cur_p, base_p, reconciled, checkout=(None, None), split=(None, None), held=False, no_band=()):
"""Per-placement comparison with band read, changed-placement count, spread, and mix check.
no_band: placements read without a band (the Floating widget row when a known Shopify checkout extension in its
older setup could not be separated from it: the counts stay, only the band read goes).
held: the whole program held (verdict); then any placement whose impressions moved 15% or more, or a rate 10% or
more, with at least 30 impressions in both periods, or that started or stopped showing, rules out "no material
change": changes inside placements can offset each other in the totals."""
if not reconciled:
print("\nPlacement bands, the placement read and the mix check skipped: the placement rows do not add up "
"to the site total."
+ (" The whole program held, but a change inside it (one placement up, another down) cannot be ruled "
"out: pull both again on the same day." if held else ""))
return
print("\nBy placement (current vs base), each rate read against its placement's 2025 band")
kinds = {"post_purchase": "Post-purchase (classic prompt)", EXTENSION: "Post-purchase (Shopify checkout extension)",
"post_event": "Post-purchase (Post Event popups)"}
order = [PLACEMENT["post_purchase"], *kinds.values(), *list(PLACEMENT.values())[1:], OTHER]
key = {**{v: k for k, v in PLACEMENT.items()}, **{v: k for k, v in kinds.items()}, OTHER: "other",
kinds["post_event"]: None}
checkout_active = any(placements.get("Post-purchase", {}).get(t, 0)
for placements in (cur_p, base_p) for t, _ in STAGES + MONEY)
base_key = dict(key)
if checkout_active:
key["Post-purchase"], base_key["Post-purchase"] = checkout # each period's band; None removes only the band read
unsplit = [name for name, placements, parts in (("current", cur_p, split[0]), ("base", base_p, split[1]))
if parts is None and any(placements.get("Post-purchase", {}).get(t, 0) for t, _ in STAGES)]
active = [k for k in kinds if any(any(r.get(k, {}).values()) for r in split if r is not None)]
changed_kind = None not in checkout and checkout[1] != checkout[0]
showed = [{k for k in CHECKOUT if parts and parts.get(k, {}).get("Impressions")} for parts in split]
if not changed_kind and None not in split and len(showed[0]) == len(showed[1]) == 1 != len(showed[0] | showed[1]):
switched = (next(iter(showed[0])), next(iter(showed[1]))) # a switch, with the old kind's late clicks in the row
else:
switched = tuple(checkout) if changed_kind else None
if changed_kind or (None not in split and len(active) > 1):
# Each kind is a placement of its own, against its own band: one that started or stopped showing is a mix
# change. Each campaign's counts stay with its kind; Post Event popups are a row of their own, with no band.
def by_kind(placements, parts, kind):
rows = {p: r for p, r in placements.items() if p != "Post-purchase"}
if parts is None: # not split by campaign: the whole row under the kind that set its band
if "Post-purchase" in placements:
rows[kinds[kind]] = placements["Post-purchase"]
else: # revenue alone keeps a row: an advocate's coupon can be used after the prompt stopped
rows.update({kinds[k]: r for k, r in parts.items() if any(r.values())})
return rows
base_p, cur_p = by_kind(base_p, split[1], checkout[1]), by_kind(cur_p, split[0], checkout[0])
if switched:
print(f" Post-purchase changed between the periods: {CHECKOUT[switched[1]]} in the base period, "
f"{CHECKOUT[switched[0]]} now. They are read as two placements, each against its own band: "
"one stopped and one started showing, a mix change. Each campaign's counts stay with its own "
"kind, late clicks and sales included"
+ ("; the Post Event popups named above are a row of their own here, with no band."
if kinds["post_event"] in set(base_p) | set(cur_p) else "."))
else:
print(f" Post-purchase: more than one kind of popup has counts in this row "
f"({', '.join(kinds[k] for k in active)}). Each kind is read as a placement of its own, against "
"its own band (Post Event popups with none), so a kind that started or stopped showing is a mix "
"change. Each campaign's counts stay with its own kind, late clicks and sales included.")
else:
if checkout[0] is None and any(cur_p.get("Post-purchase", {}).get(t, 0) for t, _ in STAGES):
print(" Post-purchase: no band for the current period (see the note above); the rest of the read runs.")
if any(parts and any(parts.get("post_event", {}).get(t, 0) for t, _ in STAGES) for parts in split):
print(" Post-purchase is read as one row, with the Post Event popups named above in it.")
if unsplit: # the row is read and the note says what it may hide (her rule: a note, not a withheld verdict)
print(f" Post-purchase is not split by kind in the {' and the '.join(unsplit)} period (its popup campaigns "
"do not add up to the row, or could not be read: see the note above), so it is read as one placement. "
"If a kind inside it started or stopped showing (the classic prompt, the extension or a Post Event "
"popup), part of what reads below as a change inside Post-purchase, and in the mix check as "
"behaviour, is a change between kinds: read its campaigns by id.")
for p in no_band:
key[p] = base_key[p] = None
if p in cur_p or p in base_p:
print(f" {p}: no band: it may hold Shopify checkout-extension traffic (see the note above); the counts, "
"the placement read and the mix check are unchanged.")
adv, shifted, from_zero, inside = {}, [], [], []
for p in sorted(set(cur_p) | set(base_p), key=lambda x: order.index(x) if x in order else 99):
c = cur_p.get(p, {t: 0 for t, _ in STAGES + MONEY})
b = base_p.get(p, {t: 0 for t, _ in STAGES + MONEY})
if not any(c.values()) and not any(b.values()):
continue
label = f" {p}" + (" (Shopify checkout extension)" if p == "Post-purchase"
and key[p] == EXTENSION else "")
ct, base_ct = key.get(p), base_key.get(p)
if p in kinds.values(): # a kind is read against its band only in a period in which it showed impressions
ct, base_ct = ct if c["Impressions"] else None, base_ct if b["Impressions"] else None
rc, rb = compare(label, c, b, ct, base_ct)
if c["Impressions"] >= MIN_IMPRESSIONS and b["Impressions"] >= MIN_IMPRESSIONS:
imp = rel(c["Impressions"], b["Impressions"])
hits = [f"impressions {fmt(imp, 'rel')}"] if imp is not None and abs(imp) >= IMPRESSIONS_MATERIAL else []
for name, _, _, _ in RATES: # the five rates, as in step 2
v = rel(rc[name], rb[name])
if v is not None and abs(v) >= RATE_MATERIAL:
hits.append(f"{name.lower()} {fmt(v, 'rel')}")
elif rb[name] == 0 and rc[name] is not None and rc[name] > 0:
hits.append(f"{name.lower()} rose from zero")
if hits:
inside.append(f"{p} {', '.join(hits)}")
adv[p] = rel(rc["Advocacy rate"], rb["Advocacy rate"])
if rb["Advocacy rate"] == 0 and rc["Advocacy rate"] > 0:
from_zero.append(p)
else: # started or stopped showing: a mix change, not a rate change inside the placement
shifted.append((p, b["Impressions"], c["Impressions"],
not any(r[t] for r in (b, c) for t, _ in STAGES)))
known = {p: 100 * v for p, v in adv.items() if v is not None}
if len(adv) == 1: # one placement measured in both periods: name its change, no comparison across placements
(p, v), = adv.items()
if p in from_zero:
what = "rose from zero (relative change undefined), a change"
else:
what = fmt(v, "rel") + (", changed by 10% or more" if v is not None and abs(v) >= RATE_MATERIAL
else ", less than 10%" if v is not None else "")
print(f"\n Advocacy change on the only placement with at least {MIN_IMPRESSIONS} impressions in both periods: "
f"{p} {what}; no other placement to compare it with.")
if len(adv) >= 2:
spread = max(known.values()) - min(known.values()) if known else 0
ends = (f", between {min(known, key=known.get)} and {max(known, key=known.get)}" # all placements read, changed or not
if len(known) > 1 and spread else "")
changed = [p for p, v in known.items() if abs(v) >= 100 * RATE_MATERIAL] + from_zero
rose = [p for p in changed if p in from_zero or known[p] > 0]
shared = len(changed) > 1 and len(rose) in (0, len(changed)) # all moved the same way
kind = ("no placement changed by 10% or more" if not changed else
"the change is in that placement" if len(changed) == 1 else
"opposite directions: the offer if it changed, otherwise each placement on its own" if not shared else
"a shared change (all placements)" if len(changed) == len(adv) else
"a shared change (several placements)")
magnitude = "very different sizes, still one shared change" if spread > PLACEMENT_SPREAD and shared \
else "very different sizes" if spread > PLACEMENT_SPREAD else "similar sizes"
print(f"\n Advocacy change across placements with at least {MIN_IMPRESSIONS} impressions in both periods: "
+ ", ".join([f"{p} {fmt(v / 100, 'rel')}" for p, v in known.items()]
+ [f"{p} rose from zero (relative change undefined)" for p in from_zero])
+ f"; {len(changed)} changed by 10% or more -> {kind}; "
f"{points(spread, known)} points apart{ends} ({magnitude}); a rise from zero counts as a change but not "
"in the points.")
if len(changed) == 1:
print(" One placement changed: compare its campaign's advocate and friend rewards with the others. "
"Same offer, unchanged between the periods (the Incentive Combinations split shows the reward pair "
"of each): the offer is not the cause, since the other placements with that offer did not move. "
"Offer changed between the periods: start with the offer, a new reward can move placements by "
"different amounts. Its own offer (an offer test or an offer for one customer segment): start with "
"that offer.")
elif shared:
print(" A shared change: check what the placements share, in practice the offer "
"(both the advocate and the friend reward, because the advocate reads both on the share page).")
elif changed:
print(" Opposite directions: check whether the offer changed between the two periods (each campaign's "
"advocate and friend rewards in both). If it did, start with the offer: each placement reaches "
"different customers, and a new reward is not worth the same to all of them ($15 off -> 20% off "
"is worth less on a $50 order and more on a $100 order), so one change can raise one placement "
"and lower another. If it did not, read each changed placement on its own: what changed on its "
"page, its traffic or its campaign.")
for p, before, now, revenue_only in shifted:
if revenue_only: # e.g. an advocate's coupon used after the prompt stopped: revenue, no funnel count
print(f" {p}: referral revenue only, no funnel counts in either period (for example an advocate's coupon "
"used after it stopped showing): in the revenue total; the mix check uses the funnel counts.")
elif not before and not now: # a kind's late clicks or sales after it stopped showing
print(f" {p}: no impressions in either period, only clicks or sales after it stopped showing: "
"not counted above; they are in the totals and the mix check.")
elif bool(before) != bool(now): # no impressions in exactly one period: it started or stopped showing
state = "started showing" if now else "stopped showing"
print(f" {p} {state} ({before:,} -> {now:,} impressions): a mix change, see the mix check; "
"not counted above.")
elif before < MIN_IMPRESSIONS and now < MIN_IMPRESSIONS:
print(f" {p}: under {MIN_IMPRESSIONS} impressions in both periods ({before:,} -> {now:,}): "
"too few to read on its own; not counted above.")
else:
low = "base" if before < MIN_IMPRESSIONS else "current"
print(f" {p}: below the {MIN_IMPRESSIONS}-impression comparison floor in the {low} period "
f"({before:,} -> {now:,} impressions): too few to read on its own, not counted above; "
"its share of impressions is in the mix check.")
if held: # step 2: the totals held; only the placements can rule out a change inside the program
inside += [f"{p} {'started' if now else 'stopped'} showing" for p, before, now, revenue_only in shifted
if not revenue_only and bool(before) != bool(now)]
if inside:
print("\n The whole program held, but placements moved: " + "; ".join(inside) + ". Changes inside "
"placements can offset each other in the totals, so this is not \"no material change\": read each "
"moved rate's step (steps 4-8).")
else:
print(f"\n No material change: the whole program held, and no placement with at least {MIN_IMPRESSIONS} "
f"impressions in both periods moved (impressions {float(IMPRESSIONS_MATERIAL):.0%} or more, a rate "
f"{float(RATE_MATERIAL):.0%} or more) or started or stopped showing.")
# Mix check: weight each rate by its own base denominator, not by activity at unrelated stages.
# Skip this rate's mix check for any nonzero numerator with zero denominator.
# Otherwise keep the base rate when this rate's denominator is absent in either period, or when the placement
# started or stopped showing (impressions in one period only): its late clicks and sales are not behaviour.
print("\nMix check: current rates at the base period's placement mix")
rows = []
for name, n, d, u in RATES:
base_den = sum(b[d] for b in base_p.values())
cur_den = sum(c[d] for c in cur_p.values())
blended_cur = rate(sum(c[n] for c in cur_p.values()), cur_den, u)
blended_base = rate(sum(b[n] for b in base_p.values()), base_den, u)
unsupported = any(r[n] != 0 and r[d] == 0
for placements in (base_p, cur_p) for r in placements.values())
if unsupported or not base_den or not cur_den:
rows.append((name, d.lower(), fmt(blended_base, u), fmt(blended_cur, u), "n/a", "skipped"))
if unsupported:
print(f" {name}: mix check skipped: a placement has {n.lower()} but no {d.lower()} in one of the "
"periods (late activity after it stopped showing).")
continue
reweighted = 0.0
for p, b in base_p.items():
c = cur_p.get(p)
showing = c and bool(c["Impressions"]) == bool(b["Impressions"])
r = rate(c[n], c[d], u) if showing and c[d] > 0 and b[d] > 0 else rate(b[n], b[d], u)
reweighted += (r or 0) * b[d] / base_den
change = rel(blended_cur, blended_base)
if blended_cur == blended_base or (change is not None and abs(change) < RATE_MATERIAL):
share = "rate stable"
else: # the part of the change that is not behaviour inside the placements
share = f"{round(float(100 * (blended_cur - reweighted) / (blended_cur - blended_base)))}%"
rows.append((name, d.lower(), fmt(blended_base, u), fmt(blended_cur, u), fmt(reweighted, u), share))
print_table(("rate", "weighted by", "base", "current", "current at base mix", "mix share of change"), rows)
print(" Read: the mix share is the part of a rate's change that comes from where its denominator sat, placement "
"by placement (the weighted-by column). For advocacy rate that is reach: more or fewer impressions in each "
"placement (step 4). For a later rate it is sharers, shares, clicks or visits moving between placements, "
"which follows the earlier rates: find the placement that gained or lost that count. The rest is behaviour "
"inside the placements (steps 5-8). Where the mix check was skipped, the base and current rates are shown "
"without that split. Mix share = (current - current at base mix) / (current - base).")
imp_b = sum(b["Impressions"] for b in base_p.values())
imp_c = sum(c["Impressions"] for c in cur_p.values())
if imp_b and imp_c:
print(" Impression share base -> current: " + ", ".join(
f"{p} {100 * base_p.get(p, {}).get('Impressions', 0) / imp_b:.1f}% -> "
f"{100 * cur_p.get(p, {}).get('Impressions', 0) / imp_c:.1f}%"
for p in sorted(set(cur_p) | set(base_p), key=lambda x: order.index(x) if x in order else 99)))
def history_check(cur_start, rc):
print("\nThe program's own range: the twelve months before the current period")
hist = month_history(cur_start)
rows, series = [], {name: [] for name, _, _, _ in RATES}
for label, c in hist:
r = rates(c)
for name, _, _, u in RATES:
if r[name] is not None:
series[name].append(r[name])
rows.append((label, fmt(c["Impressions"]), fmt(c["Friend referral sales"]))
+ tuple(fmt(r[name], u) for name, _, _, u in RATES))
print_table(("month", "impressions", "friend sales") + tuple(name for name, _, _, _ in RATES), rows)
for name, _, _, u in RATES:
s = series[name]
if s and rc[name] is not None:
lo, hi = min(s), max(s)
where = "inside" if lo <= rc[name] <= hi else "outside"
print(f" {name}: monthly range {fmt(lo, u)} - {fmt(hi, u)} over {len(s)} months; "
f"current period {fmt(rc[name], u)} is {where} it.")
if __name__ == "__main__":
if len(sys.argv) != 5:
sys.exit("usage: python3 referral_change.py CUR_START CUR_END BASE_START BASE_END (dates YYYY-MM-DD)")
KEY = os.environ["TALKABLE_API_KEY"]
SITE = os.environ["TALKABLE_SITE_SLUG"]
cs, ce, bs, be = sys.argv[1:5]
cur, base = counts(cs, ce), counts(bs, be)
print(f"Referral program change {SITE}: current {cs} -> {ce} vs base {bs} -> {be} "
f"(money in the site's reporting currency, {cur['currency']})")
rc, rb = compare("Whole program, read against the all-placements band", cur, base, "all", "all")
held = verdict(cur, base, rc, rb)
cur_p, cur_ok = by_placement(cs, ce, cur)
base_p, base_ok = by_placement(bs, be, base)
reconciled = cur_ok and base_ok
campaigns, listed = [], False
if reconciled:
try:
campaigns, listed = get("campaigns")["campaigns"], True
except (Narrow, RuntimeError, requests.RequestException) as e:
print(f" Campaign list unavailable: {e}; post-purchase reach and band skipped. A Shopify checkout "
"extension in its older setup, shown through the floating widget, cannot be found either: if one ran "
"in either period, the Floating widget comparison and the mix check include it.")
reach = checkout_reach(cs, ce, bs, be, campaigns) if reconciled else None
store_check(cur, base, cur_p, base_p, reconciled, reach)
checkout, split = [], []
periods = ((cs, ce, cur_p), (bs, be, base_p))
reads = [widget_extension(start, end, placements, campaigns if listed else None) if reconciled else ([], None)
for start, end, placements in periods]
failed = next(((start, end) for (start, end, _), (_, problem) in zip(periods, reads) if problem), None)
for (start, end, placements), (moved, problem) in zip(periods, reads):
if failed: # moved in one period only, the same campaign would read as a mix change: keep it out of both
moved_note = (f"{problem}: in both periods any counts it has stay in the Floating widget row, which may "
"therefore hold extension traffic; the Post-purchase band, the Post-purchase and Floating "
"widget rows and the mix check read it as part of the floating widget, and the Floating widget "
"row has no band; read it by id"
if problem else
f"campaign {', '.join(str(i) for i, _ in moved)}, the Shopify checkout extension shown "
f"through the floating widget, stays in the Floating widget row here too, as in {failed[0]} "
f"-> {failed[1]} (see that note), so both periods read it in the same row"
if moved else None)
moved = []
else:
moved_note = move_widget_extension(placements, moved)
kind, notes, parts = post_purchase_band(start, end, placements["Post-purchase"], campaigns if listed else None,
moved) \
if reconciled and "Post-purchase" in placements else (None, [], None)
notes = ([moved_note] if moved_note else []) + notes
checkout.append(kind)
split.append(parts)
for note in notes:
print(f" Post-purchase {start} -> {end}: {note}")
placement_check(cur_p, base_p, reconciled, checkout, split, held, ("Floating widget",) if failed else ())
history_check(cs, rc)
print("\nCalls: 9 + 9 for the two periods' totals (funnel, revenue, store), 7 + 7 by placement, 6 for the "
"twelve-month range, plus one campaign-list call, two impression calls per campaign that may "
"start on an order (reach), 7 per possible post-purchase campaign per period to tell which kind ran, 7 per "
"extension campaign shown through the floating widget per period, and "
"one by day per order-started campaign and per 1,000 days when both kinds showed in a period, to date the switch "
"(plus one for each half when the API asks to narrow a range); on HTTP 503 or 429 "
"it waits 5, 10, 20 and 40 seconds between attempts.")
Reconcile with the admin report
- Open the report. In the Talkable admin: your site → All reports → Metrics Aggregation. The Summary report on the same menu shows two date ranges side by side: the base period next to the current one.
- Set the same filters. The current period's start and end dates; the same campaigns, if you filtered by
campaign_ids[]; the same test-traffic, refund and currency filters. - Compare column by column, for both periods. The admin's name for each figure is in the metrics table above, column “Metrics Aggregation”. The placement rows tie to the report's campaign-type segmentation.
If a figure differs, check:
- first, checklist rows 1–5;
- then, whether you compared $ Dashboard sales or # / $ Talkable Sales instead of the ideal-sales columns.
If both sides are lower than you expect, verify that purchases reach Talkable.
Troubleshooting
- “No metric found.” (HTTP 400)
Why: the identifier is not one the API knows.
Fix: impressions areadvocate_impressions, visits arevisits, referral revenue isideal_sales_sum. There is noimpressionsorfriend_visits.
Through MCP: an unknown identifier comes back empty rather than as an error, so an empty result is a wrong name, not "no data". - “`start_date` is not a valid Date” (HTTP 400)
Why: the date is not YYYY-MM-DD or M/D/YYYY. Day-first dates such as30/9/2026are read as invalid.
Fix: send2026-09-30. - HTTP 503 or HTTP 429
Why: a 503 from the metrics endpoints means the request budget is spent for now; a 429 is the API-wide throttle (request throttling).
Fix: wait and retry. The script makes 38 calls: 9 + 9 for the two periods' totals, 7 + 7 for the placement splits, 6 for the twelve-month range. Telling which post-purchase campaigns ran adds one campaign-list call, two calls per campaign that may start on an order, seven per possible post-purchase campaign for each period, and seven per Shopify checkout-extension campaign shown through the floating widget for each period with a Floating widget row, plus one by day per order-started campaign, for each piece of up to 1,000 days, when both kinds showed in a period. On a 503 or 429 it waits 5, 10, 20 and 40 seconds between attempts. If one of these extra checks still fails, the script skips only the post-purchase reach or band, or keeps the extension in the Floating widget row, and says so; if the campaign list itself fails, it also says that the Floating widget comparison and the mix check may include an extension in its older setup; if a main call fails, it stops with the error. - HTTP 503, “Metric is temporarily unavailable, please try again. Narrow the segmentation…”
Why: a month split over a long window is too large to serve at once.
Fix: split the date range in half and call each half. The script halves a range until each part answers. - “This segmentation produces … rows, over the synchronous limit of 1000” (HTTP 422)
Why: a split, such as a daily split over several years, returns more than 1,000 rows.
Fix: narrow the period or the split. Or schedule it withPOST /api/v2/metrics/{metric}/segmentize(up to 5,000 rows), then pollGET …/segmentize/{job_id}. - The base period returns zeros
Why: the program was not running then. The script prints "n/a" for every change and asks for another base period.
Fix: use the previous period. - “Unsupported parameters: X. Supported parameters: …” (HTTP 400)
Why: the metrics API names any parameter it does not know, for examplecampaign_id[]instead ofcampaign_ids[], and lists the valid ones.
Fix: correct the name. To read one placement, filter withcampaign_types[]=standalone, or split withsegment_by[campaign_types]=true. - Placement rows sum to less than the total
Why: Leaderboard, Tiered Rewards and full-bleed Invite campaigns that run on a page of their own carry no campaign type. They count in the total and in no row. Set up as a Post-purchase or Floating widget campaign, they take that placement's type and sit in its row.
Fix: nothing to fix. The script prints the difference as “Other campaigns (no type)”, so the table ties. - A placement with almost no impressions but clicks and sales (checklist row 2)
Why: its rates on a handful of impressions are not comparable with a band.
Check: the campaign'sstatusand live period fromGET /api/v2/campaigns. - Talkable MCP server: no access (MCP troubleshooting)
- “MCP is disabled for this site…”: the Talkable MCP server (
https://www.talkable.com/mcp) is enabled per site by your CSM. - “Site not found or not accessible”: the
site_slugis not one your credential can reach.list_sitesshows the valid ones. - Roles: reading metrics needs the Read role or higher. Scheduling a CSV export needs the Write role and a key with
mcp:write(permissions).
- “MCP is disabled for this site…”: the Talkable MCP server (
Go further
- Rows per advocate. Two steps of the audit above look for an outlier advocate: step 7 (one link opened by many people moves the click and visit rates) and step 8 (a few advocates carry the period's friend referral sales). The per-advocate rows come from the exportable reports (reports and exports):
- Top Referrers and Offer Shares, for clicks per advocate;
- Purchases filtered to ideal friend sales, for sales per advocate;
- Referrals, with its status and tracking-method columns, for the tracking-method mix and for referrals blocked or voided after a period closed;
- Settings Changes, for the audit log.
list_grid_reports,schedule_grid_exportandget_grid_exportschedule and fetch the same files. - One campaign or a group.
campaign_ids[]orcampaign_tags[]on any metric, the same on both sides. - An A/B test. Through the Talkable MCP server,
segment_by: ["split_test"]with the test'ssplit_test_keysplits a metric by variant. - Net revenue. Through the Talkable MCP server,
exclude_refunded: trueleaves refunded orders out of the money metrics.
Methodology
- Figures
- Cross-program figures are Talkable benchmark data with their period and program count beside them; bands as published; cells under five programs are not published; no program is named.
- Code
- Every request and the script were run on a live Talkable site and reconciled with its Metrics Aggregation report for both periods.
FAQ
How do I know if my referral program is working?
Friend referral sales and impressions hold or grow against the previous period and the same period last year, and each placement's five rates sit inside its band (for example Post-purchase advocacy 2.12–7.27%, Talkable benchmark data 2025, 64 programs).
What counts as a real decline in a referral program?
A change that survives reconciliation (same closed months, campaigns, filters) and lands outside the program's own twelve-month range. Talkable's working rule reads a rate as changed at 10% relative change, impressions at 15%.
Which funnel stage caused the drop?
The Talkable funnel rate with the largest relative change, (current − base) ÷ base, read top down. All rates under 10%: compare sales with base sales × current ÷ base impressions. Within 10% or one sale, sales are consistent with a change in reach; still report the small rate changes, and with impressions under 15%, check the placements. Otherwise small rate changes added up.
Why did my referral click rate go up while visits went down?
One share link opened many times (a normal share brings two or three clicks, a public post hundreds), or a channel shift: copied link 3.09 clicks per share, email 0.61 (Talkable benchmark data, 2025 – mid-2026, 199 and 149 programs).
Why do last quarter's referral numbers keep changing?
Late shares add to a closed month (sharers are dated by offer creation); later blocks and voids leave friend referral sales. Pull both sides the same day; half of referral purchases land within 2 days (185 Talkable programs, 2023–2025).
How do I compare two periods of my referral program from the Talkable API?
Call GET https://www.talkable.com/api/v2/metrics/{metric} (Talkable metrics API) once per period for advocate_impressions, sharers, shares, clicks, visits and ideal_friend_sales_count; add segment_by[campaign_types]=true for the placement split; compute each rate and its relative change (current − base) ÷ base.
Learn more
In the Talkable documentation:
| Referrals approval | Pending, approved, voided and blocked referrals: the status filters behind friend referral sales, and why a closed month's sales can still change |
| Referral tracking methods | How a friend's purchase is matched to an advocate, in priority order: the tracking-method mix behind conversion |
| Verify the integration | Check that purchases and events reach Talkable when both sides of a comparison look low |
| Reporting with Talkable AI | Period comparisons, segments, settings changes in a window and exports from the AI Assistant or your own agent |
| Talkable MCP server | Connect Claude Code, ChatGPT, Cursor or any MCP client |
| Talkable API | Authentication, response format, errors and throttling |
