
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 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), with the previous period as 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 |
| Change spread across placements | Count rate changes ≥ 10%: one = isolated among compared placements; several or all = not isolated. Spread ≤ 20 points = similar magnitudes; > 20 = divergent magnitudes | 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, and read it against the Shopify checkout-extension band. - 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, compare actual sales with base sales × current impressions ÷ base impressions. Only report "no material change" when they agree within max(1 sale, 10% of expected sales), using unrounded rates. Otherwise small rate changes compound; keep the rate breakdown and check the placement mix.
Step 3 · Name the pattern, and the stage that changed most
- Counts fell together, every rate held: call it a volume-compatible endpoint only when actual sales match base sales × current impressions ÷ base impressions within max(1 sale, 10% of expected sales), using unrounded rates. Separately disclose intermediate rate movements and counts departing from volume-only expectations, even when they offset at sales. Then go to step 4. Otherwise small rate changes compound; keep the rate breakdown and check the placement mix.
- One blended rate moved: report the movement and check the placement mix before attributing it to behaviour inside placements. Then go to its step.
- Several blended rates moved: report each movement; do not assume separate causes before the mix check. If mix attribution is withheld, keep the changed rates in the diagnosis without assigning a within-placement behaviour cause.
- 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:
- Purchase-origin checkout follows the store's orders. Resolve campaigns by ID and
joinable_category_names=["purchase"], not the broadpost_purchaselabel, which also includes custom-event popups. Divide comparable checkout impressions by store orders. Include legacy extension widgets and replacement extension popups in the same logical extension population in both periods; withhold reach for mixed, absent or unverified populations.- 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 placements whose advocacy rate changed by at least 10% relative to base or rose from measured zero (relative change undefined). Exactly one is isolated among compared placements; several or all changing is not isolated. If all changed, check what they share, including both the advocate reward and the friend reward, because the advocate reads both on the share page. Spread describes magnitude only: within 20 points means similar changes; more than 20 points means divergent changes, not proof of isolation.
- 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).
- For each materially changed placement, compare the advocate and friend rewards of its campaign with the others. A shared offer is a lead, not proof of cause. 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:
- the mix part is a change in reach, fewer people reached the placement that converts best, and it routes to step 4 (why that placement lost impressions);
- the rest is the share page or claim page converting differently within a placement, steps 5–8.
The script applies its base-rate substitution separately to each rate, using that rate's own denominator. If the denominator is zero in either period, it keeps that placement's base rate in the weighted sum rather than inventing a within-placement rate change. Zero visits do not replace the current advocacy rate when impressions are positive. If any placement has a nonzero numerator with a zero denominator in either period (for example, late sales with no visits), the script withholds the base-mix rate and mix attribution for that rate only. It still shows both blended rates where their total denominators are positive, and keeps the other rate comparisons.
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://get.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, which is a change in reach); and the program's
own monthly range over the twelve months before the current period.
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.
A zero denominator prints "n/a"; measured gains from zero remain changes, with no relative percentage.
Post-purchase bands require reconciled six-stage campaign contributions in each requested period,
not today's Live status. Require joinable_category_names == ["purchase"] for all contributors.
Shopify Extension names or shopify-new-checkout tags identify extensions. Band lookups query only popup or
unknown-appearance campaigns, then reconcile all six stages; reach skips known non-purchase origins.
Optional checkout lookup failures withhold only their own result; mandatory report failures still stop.
Mixed or incomplete evidence leaves the band unassigned and skips placement-cause attribution.
All-zero checkout rows do not gate other placements. Reach uses campaign-ID purchase-origin impressions,
including legacy extension widgets, for the same logical checkout type in both periods; otherwise withheld.
Names, tags, appearance and live_period are current metadata, not a version history; verify
historical changes against campaign records. Expired campaigns can still contribute.
"""
import os
import re
import sys
import time
from datetime import date, timedelta
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"
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 = 0.10 # a rate that moved less than 10% is read as stable
IMPRESSIONS_MATERIAL = 0.15 # impressions that moved less than 15% are read as stable
PLACEMENT_SPREAD = 20.0 # magnitude differences, not the number of changed placements
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 rate(num, den, unit):
if not den:
return None
return 100 * num / den if unit == "%" else num / 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 (cur - base) / base
def fmt(x, unit=""):
if x is None:
return "n/a"
if unit == "%":
return f"{x:.2f}%"
if unit == "ratio":
return f"{x:.4f}"
if unit == "rel":
return f"{100 * x:+.1f}%"
if unit == "money":
return f"{x:,.2f}"
return f"{x:,}"
def band(value, ct, name):
lo_hi = BANDS.get(READ_AS.get(ct, ct), {}).get(name)
if value is None or lo_hi is None:
return ""
lo, hi = lo_hi
return "below band" if value < lo else "above band" if value > hi else "in band"
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} residual for {start} -> {end}: {residual:+,.2f} (site total minus placement rows; "
"currency rounding or unsplit revenue, not a funnel-count reconciliation gate).")
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" Unreconciled placement split for {start} -> {end}; site total minus rows: "
+ ", ".join(f"{t}: {v:,}" for t, v in other.items())
+ ". Residuals are not reliable Other campaign counts; placement diagnosis withheld.")
if any(other[t] for t, _ in STAGES):
rows[OTHER] = other
return rows, reconciled
def post_purchase_band(start, end, expected, campaigns):
"""Resolve contributing campaign IDs and purchase origins, not the broad post_purchase label."""
expected = {t: expected.get(t, 0) for t, _ in STAGES}
covered = {t: 0 for t, _ in STAGES}
kinds = set()
uncertain = False
for c in campaigns:
# Provider maps popup appearance to post_purchase; missing appearance stays a candidate.
if c.get("appearance") and c["appearance"] != "popup":
continue
counts = {}
for term, metric in STAGES:
try:
rows = get(f"metrics/{metric}/segmentize", start_date=start, end_date=end,
**{"campaign_ids[]": [c["id"]], "segment_by[campaign_types]": "true"})["segmented"]
except (Narrow, RuntimeError, requests.RequestException) as e:
return None, f"unknown checkout type: {metric}, campaign {c['id']}, {start} -> {end}: {e}"
counts[term] = sum(r["plain"] for r in rows if r.get("campaign_type") == "post_purchase")
if not any(counts.values()):
continue
for term in covered:
covered[term] += counts[term]
period = c.get("live_period") or {}
# ends_at may be null (open-ended) or before this interval (late clicks/sales).
# Missing or contradictory start evidence cannot establish a historical checkout type.
began = period.get("starts_at")
ended = period.get("ends_at")
if not began or began[:10] > end or (ended and ended < began):
uncertain = True
if not c.get("name") or c.get("joinable_category_names") != ["purchase"]:
uncertain = True
extension = ("shopify extension" in c.get("name", "").lower()
or "shopify-new-checkout" in c.get("tag_names", []))
kinds.add(EXTENSION if extension else "post_purchase")
if uncertain or covered != expected or not kinds:
return None, "unknown checkout type: incomplete purchase-origin/campaign/date/activity evidence"
if len(kinds) > 1:
return None, "mixed classic and Shopify checkout-extension activity"
return kinds.pop(), ""
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):
"""Counts, rates, relative changes and the band read for one row set (the site, or one placement)."""
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"), band(rc[name], ct, name))
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."""
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:
worst = max(known, key=lambda k: abs(known[k])) # ties: the first in funnel order wins
print(f" Rate with the largest relative change: {worst} ({fmt(known[worst], 'rel')}).")
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:
wc = max(kc, key=lambda k: abs(kc[k]))
print(f" Count with the largest relative change: {wc} ({fmt(kc[wc], 'rel')}, "
f"{fmt(cur[wc] - base[wc])} in absolute terms).")
moved = [name for name, _, _, _ in RATES
if name in from_zero or abs(known.get(name, 0)) >= RATE_MATERIAL]
if not moved:
projected_sales = base["Friend referral sales"] * cur["Impressions"] / 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(cur["Friend referral sales"] - projected_sales) <= tolerance
if base["Impressions"]:
scale = cur["Impressions"] / base["Impressions"]
departures = [t for t, _ in STAGES[1:-1]
if abs(cur[t] - base[t] * scale) > max(1, abs(base[t] * scale) * RATE_MATERIAL)]
if departures:
print(" Intermediate counts depart from volume-only expectations by more than "
"max(1 count, 10% of expected): " + ", ".join(departures) + ".")
print(" Separate rate movements (including offsetting changes): "
+ ", ".join(f"{name} {fmt(value, 'rel')}" for name, value in known.items() if value != 0)
+ ".")
if missing:
print(" Incomplete rate comparison: " + ", ".join(missing) + "; do not infer a stable funnel.")
elif not volume_agrees:
print(" Pattern: small rate changes compound, or the volume-only projection is unavailable. "
"Do not attribute sales to impressions alone; read the rate breakdown and placement mix.")
if projected_sales is not None:
print(f" Sales at base rates and current impressions: {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: volume cascade. Every rate moved less than {RATE_MATERIAL:.0%}; "
"actual sales match the volume-only projection within max(1 sale, 10% of expected sales). "
"This endpoint comparison does not mean intermediate stages were unchanged. "
f"Impressions {fmt(imp, 'rel')}; read impressions by placement (step 4).")
else:
print(f" Pattern: no material change. Every rate moved less than {RATE_MATERIAL:.0%} and impressions "
f"less than {IMPRESSIONS_MATERIAL:.0%}.")
return
print(f" Pattern: blended rate movement at {', '.join(moved)}."
" Check the placement mix before attributing movement to behaviour within placements;"
" changed rates still apply when mix attribution is withheld.")
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):
"""Compare one logical purchase-origin population, including legacy widgets."""
totals = [{"post_purchase": 0, EXTENSION: 0} for _ in range(2)]
kinds = [set(), set()]
for c in campaigns:
origin = c.get("joinable_category_names")
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:
impressions = get("metrics/advocate_impressions", start_date=start, end_date=end,
**{"campaign_ids[]": [c["id"]]})["plain"]
except (Narrow, RuntimeError, requests.RequestException):
return None # Only reach is withheld; placement diagnosis and history still run.
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
extension = ("shopify extension" in c["name"].lower()
or "shopify-new-checkout" in c.get("tag_names", []))
kind = EXTENSION if extension 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, verified checkout 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")))
pp_c, pp_b, kind = reach if reconciled and reach is not None else (None, None, None)
label = "Shopify checkout extension" if kind == EXTENSION else "Purchase-origin checkout"
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 pp_c is None:
print(" Checkout reach withheld: need reconciled splits and comparable purchase-origin campaign-ID "
"activity in both periods. Verify historical origin, names and tags.")
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 placement_check(cur_p, base_p, reconciled, checkout=(None, None)):
"""Per-placement comparison with band read, changed-placement count, spread, and mix check."""
if not reconciled:
print("\nPlacement bands, cause attribution and mix check skipped: reconcile splits with site totals first.")
return
print("\nBy placement (current vs base), each rate read against its placement's 2025 band")
order = list(PLACEMENT.values()) + [OTHER]
key = {v: k for k, v in PLACEMENT.items()} | {OTHER: "other"}
checkout_known = checkout[0] is not None and checkout[0] == checkout[1]
checkout_active = any(placements.get("Post-purchase", {}).get(t, 0)
for placements in (cur_p, base_p) for t, _ in STAGES)
if checkout_active:
key["Post-purchase"] = checkout[0] if checkout_known else None
if not checkout_known:
print(" Post-purchase band unassigned: mixed, unknown or different checkout identities across periods.")
adv, inactive, from_zero = {}, [], []
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 "")
rc, rb = compare(label, c, b, key.get(p))
if c["Impressions"] > 0 and b["Impressions"] > 0:
adv[p] = rel(rc["Advocacy rate"], rb["Advocacy rate"])
if rb["Advocacy rate"] == 0 and rc["Advocacy rate"] > 0:
from_zero.append(p)
else:
inactive.append(p)
if checkout_active and not checkout_known:
print(" Placement-cause attribution and mix check skipped: reconcile checkout identity in both periods first.")
return
known = {p: 100 * v for p, v in adv.items() if v is not None}
if len(adv) >= 2:
spread = max(known.values()) - min(known.values()) if known else 0
changed = [p for p, v in known.items() if abs(v) >= 100 * RATE_MATERIAL] + from_zero
kind = ("no material placement rate change" if not changed else
"isolated to one compared placement" if len(changed) == 1 else
"all compared placements changed" if len(changed) == len(adv) else
"several compared placements changed")
magnitude = "divergent" if spread > PLACEMENT_SPREAD else "similar"
print("\n Advocacy change across placements with impressions in both periods: "
+ ", ".join([f"{p} {v:+.1f}%" for p, v in known.items()]
+ [f"{p} rose from zero (relative change undefined)" for p in from_zero])
+ f"; {len(changed)} materially changed -> {kind}; "
f"spread among defined relative changes {spread:.1f} points ({magnitude} magnitudes); "
"rises from zero are counted separately, not included in that spread.")
if inactive:
print(" No impressions in one or both periods (read as a change in reach, step 4): " + ", ".join(inactive) + ".")
# Mix check: weight each rate by its own base denominator, not by activity at unrelated stages.
# Withhold this rate's mix attribution for any nonzero numerator with zero denominator.
# Otherwise keep the base rate when this rate's denominator is absent in either period:
# appearance or disappearance at this stage is not a measurable within-placement rate change.
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, fmt(blended_base, u), fmt(blended_cur, u), "n/a", "withheld"))
if unsupported:
print(f" {name}: base-mix rate and mix attribution withheld; "
"a placement has a nonzero numerator with zero denominator in one or both periods.")
continue
reweighted = 0.0
for p, b in base_p.items():
c = cur_p.get(p)
r = rate(c[n], c[d], u) if c 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"{100 * (blended_cur - reweighted) / (blended_cur - blended_base):.0f}%"
rows.append((name, fmt(blended_base, u), fmt(blended_cur, u), fmt(reweighted, u), share))
print_table(("rate", "base", "current", "current at base mix", "mix share of change"), rows)
print(" Read for rates with supported mix attribution: the mix share is a change in reach "
"(a shift in placement weights); check placement reach (step 4). The rest is behaviour inside "
"the placements (steps 5-8). A withheld attribution does not erase the blended rate change. "
"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")
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 = []
if reconciled:
try:
campaigns = get("campaigns")["campaigns"]
except (Narrow, RuntimeError, requests.RequestException) as e:
print(f" Checkout evidence unavailable: {e}; reach and checkout bands withheld.")
reach = checkout_reach(cs, ce, bs, be, campaigns) if reconciled else None
store_check(cur, base, cur_p, base_p, reconciled, reach)
checkout = []
for start, end, placements in ((cs, ce, cur_p), (bs, be, base_p)):
kind, note = post_purchase_band(start, end, placements["Post-purchase"], campaigns) \
if reconciled and "Post-purchase" in placements else (None, "no reconciled post-purchase row")
checkout.append(kind)
if note:
print(f" {start} -> {end}: {note}")
placement_check(cur_p, base_p, reconciled, checkout)
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 purchase/unknown-origin campaign for reach, "
"and 6 per popup/unknown-appearance campaign per post-purchase period "
"for checkout identity (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. Before checkout-identity queries, the script makes 38 calls: 9 + 9 for the two periods' totals, 7 + 7 for the placement splits, 6 for the twelve-month range. Checkout reach adds two impression calls per purchase or unknown-origin campaign, including legacy widgets. Checkout identity adds one campaign-list call and six calls per popup or unknown-appearance campaign for each period with a Post-purchase row, then reconciles all six stages. On a 503 or 429 it waits 5, 10, 20 and 40 seconds between attempts. An exhausted optional lookup withholds only its own reach or band result; a failed campaign list withholds both. Mandatory report failures still stop 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 from the top down. If every rate moved less than 10% and impressions 15% or more, call it reach alone only when actual sales match base sales × current impressions ÷ base impressions within one sale for count rounding. Small rate changes can compound; otherwise keep the rate breakdown and check the placement mix.
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 |
