
Segmenting the Post-Purchase Referral Offer by Order Value
In short
Friends referred by a store's highest-spending quarter of advocates place orders a median 1.46 times the size of those referred by its lowest quarter (Talkable benchmark data, 21 programs, analyses 2021–2026). Set the richer reward at a percentile of your own advocates' orders, and test it in an A/B test among those high spenders, never against the regular campaign.
Why it matters
A Talkable post-purchase offer is created by the customer's own order, so Talkable knows what each customer has just spent. A single reward for every buyer is priced against the store's average order.
Behind one average sit very different customers: a store with a $90 average order has customers spending $30 and customers spending $300. If the big spenders also bring big-spending friends, their reward can be priced on their own orders.
First action: check whether your own high spenders bring higher-spending friends (the quartile check).
What is measured
Talkable calls the customer who shares the program the advocate and the person they refer the friend.
- An offer is the referral record Talkable creates when a customer sees the program: one per origin (a purchase, an event or a visit) and per campaign.
- A reward is what a person receives: the friend reward, and the advocate reward once the friend's purchase qualifies.
- An order-value segment is the group of customers whose order is above a cutoff, given a different advocate reward.
Three order values come up in this question. They are not interchangeable.
- Advocate order value: what the advocate spends. A Talkable segment is set on the order that created the offer; the quartile check below uses the average of each advocate's purchases. Talkable records order subtotals after the discount.
- Friend referral AOV: the average order of the referred friends, friend referral revenue ÷ friend referral sales. It is the outcome to predict.
- Store average order value: the average over every order. It mixes every customer together, so it is the wrong input for a threshold.
A friend referral sale is a friend's purchase that Talkable matched to an advocate inside the attribution window of its tracking method, or tracked by a coupon, and that is not blocked or voided. Friend referral revenue is the total of those orders.
Talkable counts the referral funnel stage by stage: impressions → sharers → shares → clicks → visits → friend referral sales.
- Impressions: share page views + sign-up page views − sign-ups. An offer created through an API origin or at Shopify checkout also records one, with no page shown.
- Sharers: offers shared at least once, dated by the offer's creation.
- Shares: recorded shares of an offer; an email to three new recipients is three shares.
- Clicks: openings of a shared link.
- Visits: a friend going on from the claim page to the store.
This page reads the first rate most: the advocacy rate = sharers ÷ impressions, a percent.
The quartile check is how Talkable's analysts test the question. They sort the advocates by their own average order and cut the list into four equal groups (quartiles). Then they take each group's median friend order and divide it by the lowest group's:
friend order index = median friend order of a quartile ÷ median friend order of the lowest quartile
The index puts stores with different prices on one scale: 1.50 means the group's friends spend 50% more than the lowest group's friends.
How an order-value segment is set up
Talkable offers three ways to set up the segment. One is enough, and the choice decides where the segment shows in reporting.
- A second post-purchase campaign. The high-spend campaign carries the richer advocate reward. Its Campaign Join Criteria, the campaign's rule for which purchases join it, admit only orders above the cutoff. The Talkable docs page Segments shows the same kind of rule written on product SKU. The regular campaign takes everyone else, and each campaign has its own funnel.
- One campaign, a condition on the reward. In Talkable an incentive is the reward rule. Each advocate incentive can carry a condition on the advocate's order (incentive criteria), and incentives also have built-in minimum and maximum order subtotal settings. Reporting keeps one funnel for everyone; the segment shows only in which reward each referral earned.
- A band sent with the purchase. The store sends an order-value band, such as “under-100” or “200-plus”, in one of three custom segments with each purchase. Impressions, sharers and advocacy then split by band without a second campaign, from the day the store starts sending it, and Campaign Join Criteria can read the band too.
On a store running the Shopify checkout extension, the extension is the post-purchase offer (Post Purchase placement on Shopify). Build both campaigns of a segment on the same kind of post-purchase offer: Talkable benchmarks the extension separately from the classic Post-purchase popup.
A worked example
Round numbers chosen to show the arithmetic. They are not benchmarks and match no program.
A store's post-purchase offer gets 7,500 impressions in three months from orders under $150 and 2,500 from orders of $150 and above.
Months 1–3: one campaign for every order. The store reads it separately for two groups of advocates: those whose order was under $150 and those whose order was $150 or more.
Talkable's funnel metrics do not split a campaign by order value on their own. So the store labels each purchase “under-150” or “150-plus” in a custom segment (the third set-up above), and impressions, sharers and advocacy split by that label. The friends' orders come from the exports, which carry every order's subtotal.
Months 4–6: a second campaign. The store adds a high-spend campaign with a richer advocate reward for orders of $150 and above.
| Advocates, by months and order | Advocacy rate sharers ÷ impressions | Their friends' average order (friend referral AOV) |
|---|---|---|
| Months 1–3, orders under $150 | 4.0% (300 ÷ 7,500) | $60 |
| Months 1–3, orders of $150 and above | 5.0% (125 ÷ 2,500) | $90 |
| Months 4–6, regular campaign | 4.0% (300 ÷ 7,500) | $60 |
| Months 4–6, high-spend campaign | 6.0% (150 ÷ 2,500) | $92 |
The same four rows give three different reads:
| Comparison, and what it measures | Advocacy rate | Friends' average order (friend referral AOV) |
|---|---|---|
| Months 4–6, high-spend campaign against regular: two groups of customers and two rewards at once | 6.0% vs 4.0% = +50% | $92 vs $60 = +53% |
| Months 1–3, high band against the rest: the people, on the old reward | 5.0% vs 4.0% = +25% | $90 vs $60 = +50% |
| High band, months 4–6 against months 1–3: the reward | 6.0% vs 5.0% = +20% | $92 vs $90 = +2% |
The trap. The campaign-against-campaign read shows +50% advocacy and +53% friend referral AOV. Half of the advocacy gap and almost all of the order-value gap were there before the reward changed.
The real change. Inside the band, advocacy rose 20% and the friend order barely moved. The friends' larger orders belong to the segment, not to the reward.
The third read compares two periods, so the seasons differ. An A/B test of two rewards inside the band settles it (how to measure the lift).
Do high spenders refer higher-spending friends?
Yes, at every program in Talkable's quartile benchmark. The chart shows the quartile check at the median program across 21 programs (Talkable benchmark data, analyses 2021–2026).
| Advocates, in quarters by their own average order | Their friends' median order, as an index of the lowest quarter's (typical range), 21 programs | Their friends' average order, as an index of the lowest quarter's (typical range), 22 programs |
|---|---|---|
| Lowest quarter | 1.00 | 1.00 |
| 2nd quarter | 1.13 (1.08–1.52) | 1.16 (1.10–1.29) |
| 3rd quarter | 1.28 (1.17–1.80) | 1.31 (1.21–1.39) |
| Top quarter | 1.46 (1.34–2.10) | 1.55 (1.41–1.89) |
Friends' order as an index of the lowest quarter's, median program per cell: the two columns index each quarter's median and average friend order. Talkable benchmark data, analyses 2021–2026.
The direction holds at every program in the set. The top quarter's friends outspend the lowest quarter's at 21 of 21 programs on the median and 22 of 22 on the average (Talkable benchmark data, analyses 2021–2026).
The climb is gradual. At 19 of 21 programs (Talkable benchmark data, analyses 2021–2026) the index never falls from one quarter to the next, and at 17 it rises at every step. At the median program, each quarter's friends spend more than the quarter below's.
The size varies by store (Talkable benchmark data, 21 programs, analyses 2021–2026):
- half of the programs land between 1.34 and 2.10 times;
- eight in ten land between 1.28 and 3.86 times.
Your own ratio is the one to price on.
As a working practice, not a statistical threshold, Talkable's analysts split advocates into spend quartiles once at least 100 advocates have referrals.
Where to set the threshold
Use a percentile of your own advocates' orders, not a cash figure. Talkable starts at the top half: the richer reward goes to orders above the 50th percentile, with a further step for the top quarter where volumes allow. A cut at the 75th percentile keeps it to the top quarter.
Here the median advocate order is the middle of your advocates' own average orders, one value per advocate, as in the quartile check. Across programs, the cut points sit at a stable position in that spread:
| Cut point in your advocates' average orders | Cut point as a multiple of the median advocate order, median program | Typical range across programs |
|---|---|---|
| 75th percentile, the top-quarter cutoff | 1.46× | 1.38–1.53× |
| 25th percentile, the bottom-quarter cutoff | 0.69× | 0.67–0.75× |
| 75th ÷ 25th percentile | 2.02× | 1.83–2.39× |
Multiples of the median advocate order, taken over the advocates' own average orders: median program per row. Talkable benchmark data, 25 programs, analyses 2021–2026. The friend index above happens to share the number 1.46.
A quick sanity check. A store whose advocates' median order is $100 should find its 75th percentile near $146 (illustrative). A multiple far outside the typical range means an unusually wide or narrow spread of advocate orders: check that the percentile was taken over the advocates' own average orders, not the store's orders.
A cash cutoff does not carry over between stores. The same 75th-percentile rule put the cutoff between about $75 and $530 at eight programs in ten, each in its own currency (Talkable benchmark data, 25 programs, analyses 2021–2026). Read that spread as a warning, not as a target for your own cutoff.
Friends' orders climb less steeply than their advocates'. Advocates at the top-quarter cutoff spend a median 2.02 times those at the bottom-quarter cutoff (Talkable benchmark data, 25 programs). The top quarter's friends spend 1.46 times the lowest quarter's friends (21 programs). Both: analyses 2021–2026.
Who gets the richer reward. A 75th-percentile cut puts about a quarter of your advocates on the richer reward. The campaign applies the cut to each order, so its share of impressions can differ; the script below prints the share it actually receives.
The other three quarters keep the standard reward, so the richer reward adds to the program's reward cost. Re-check the cutoff when your prices change.
Deep dive: the segment's funnel
Once a store runs the segment, two cuts show what it does: the high-spend campaign against the regular one, and the cost of the richer reward.
The same post-purchase funnel can also be cut by the advocate's purchase count or by new versus existing customer. Each is its own topic and reads the same way.
Campaign against campaign: what the high-spend campaign shows
Twelve Talkable programs ran a high-spend post-purchase campaign, a richer advocate reward above a spend threshold, beside their regular post-purchase campaign over the same period (Talkable benchmark data, 2018–2026).
The high-spend campaign goes to the program's best customers by definition. The table compares two groups of customers on two rewards at once, so it mixes the segment with the reward, like the campaign-against-campaign read in the worked example.
| Rate | Median difference, high-spend vs regular | Programs where the high-spend campaign is higher |
|---|---|---|
| Advocacy rate sharers ÷ impressions | +30.5% | 10 of 12 |
| Sharing rate shares ÷ sharers | +1.5% | 5 of 8 |
| Click rate clicks ÷ shares | +3.5% | 4 of 8 |
| Visit rate visits ÷ clicks | −7.6% | 3 of 8 |
| Conversion rate friend referral sales ÷ visits | +19.3% | 5 of 8 |
| Friend referral AOV friend referral revenue ÷ friend referral sales | +23.6% | 7 of 8 |
Difference in each rate, high-spend campaign against regular, at the median program; relative differences, not percentage points: 4.0% against 5.2% is +30%. Talkable benchmark data, 2018–2026: advocacy across the 12 programs running both campaigns; the other rows across the 8 of them with at least 10 friend referral sales in both campaigns.
Why friend referral AOV is higher. The gap belongs to the segment: the quartile check shows it before any reward changes. In one Talkable program the high-spend campaign shared at about the regular campaign's rate, while its friends still placed larger orders (2025–2026).
Why advocacy is higher: two reasons at once. The high-spend campaign has a richer reward, and it shows it to different people, the store's biggest spenders. The +30.5% gap at the median program is both reasons added together, and the table does not show how much comes from each.
So the reward alone adds less. In Talkable A/B tests of a higher advocate reward, with the same kind of customers on both sides, advocacy rose a median 8.6% (Talkable benchmark data, 15 programs, tests created 2014 – August 2026). Read your own gap as the most the richer reward can have added.
Why the middle of the funnel has no direction. Sharing, click and visit rates differ by 8% or less at the median, with programs on both sides (higher at 5, 4 and 3 of 8). Conversion is higher at 5 of 8.
For example, ask the Talkable AI Assistant: “Compare my post-purchase campaigns for July 1 – September 30, 2026: impressions, sharers, shares, clicks, visits, friend referral sales and friend referral revenue for each campaign, with the advocacy, sharing, click, visit and conversion rates and friend referral AOV.”
Reward cost: a percentage reward on large orders
A percentage advocate reward is a coupon. A purchase made with it is an advocate referral sale, and the reward costs a share of that order. Talkable records the order after the discount, so value the reward on the order before it:
cost of one reward = p ÷ (100 − p) × advocate referral AOV, where p is the percentage off
| Advocate's order before the discount | What a 20%-off reward costs | What a flat $25 reward costs |
|---|---|---|
| $250 | $50 | $25 |
| $400 | $80 | $25 |
Cost of one advocate reward at two order sizes. Illustrative round numbers.
Talkable records these two orders after the 20% discount, as $200 and $320. The formula gives back the same two costs:
20 ÷ 80 × $200 = $50
20 ÷ 80 × $320 = $80
Why the segment's own orders matter. A percentage reward pays most on the largest orders. Price it on the advocate referral AOV of the high-spend campaign, never on the store average.
Why a minimum order needs the same check. If the richer reward requires a minimum friend order, set it against the friend referral AOV that segment produces. A minimum the segment's friends rarely reach blocks most of the rewards.
For example, ask the Talkable AI Assistant: “What were advocate referral sales, advocate referral revenue and advocate referral AOV for each of my post-purchase campaigns from July 1 to September 30, 2026?”
How to measure a segment's lift correctly
Talkable's analysts take four steps before they credit an order-value segment:
- Check that your high spenders bring higher-spending friends. Run the quartile check. Look for the top quarter's friends to outspend the lowest quarter's, as at 21 of 21 programs in Talkable benchmark data (analyses 2021–2026), and for a climb at each step, as at 17 of 21. A flat ladder leaves the segment nothing to work with.
- Set the threshold from your own numbers. Start at the 50th percentile of your advocates' orders, or at the 75th for the top quarter (where to set the threshold). Another store's cash figure says nothing about yours.
- Know what to expect campaign against campaign. Friend referral AOV is higher in the high-spend campaign at the median program (+23.6%, Talkable benchmark data, 8 programs, 2018–2026): the segment's own. Advocacy is about 30% higher at the median program (+30.5%, Talkable benchmark data, 12 programs, 2018–2026). Your own gap is the most the richer reward can have added.
- Measure the reward's own effect inside the segment. Show the same high-spend customers two rewards in an A/B test and read advocacy, the stage with the most volume. The regular campaign is not the control.
How big the test must be. Start from the median advocacy of the Post-purchase placement, 4.5% (Talkable benchmark data, 2025, 64 programs). Detecting a move to 6.0% takes about 3,500 offers per variant: the standard two-proportion arithmetic, two-sided, at 5% significance and 80% power. A lower starting rate or a smaller lift needs more offers.
Without a test, compare the same people. Read the high band's advocacy before and after the change, which needs the band in reporting before launch (a band sent with the purchase). The two periods differ in season, so name it.
For example, if your store sends the band in custom segment 1, ask the Talkable AI Assistant: “Split my post-purchase impressions, sharers and advocacy rate for September 1 – 30, 2026 by segment1.”
Calculate it for your own program
Every count and rate the comparison needs comes from Talkable, one call per metric and campaign. The result matches the Metrics Aggregation Report in the Talkable admin when you set 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 |
|---|---|---|---|
| Impressions | advocate_ | Advocate Impressions | number |
| Sharers | sharers | Sharers | number |
| Shares | shares | Shares | number |
| Clicks | clicks | Offer Clicks | number |
| Visits | visits | Site Visits | number |
| Friend referral sales | ideal_ | # Ideal FR sales | number |
| Friend referral revenue | ideal_ | $ Ideal FR sales | money, after the discount |
| Advocate referral sales | ideal_ | # Ideal AD sales | number |
| Advocate referral revenue | ideal_ | $ Ideal AD sales | money, after the discount |
| Advocacy rate | advocacy_ | Advocacy percentage | percent |
| Sharing rate | sharing_ | Sharing rate | ratio, not a percent |
| Click rate | click_ | Click Rate | ratio, not a percent |
| Visit rate | visit_ | Visit Percentage | percent |
| Conversion rate | conversion_ | Friend Conversion Percentage | percent |
| Friend referral AOV | computed: friend referral revenue ÷ friend referral sales | $ Ideal FR sales ÷ # Ideal FR sales | money |
| Advocate referral AOV | computed: advocate referral revenue ÷ advocate referral sales | $ Ideal AD sales ÷ # Ideal AD sales | money |
| Referral AOV, both sides | average_ | Average order value | money: both sides' revenue ÷ both sides' sales, not friend referral AOV |
How a call works
- One metric:
GET https://www.talkable.com/api/v2/metrics/{metric}withsite_slug,start_dateandend_date. - One campaign: add
campaign_ids[]=ID; repeat it for a group of campaigns. - A split (by campaign, by month): 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 (campaign,period). - Precision: percents come back with two decimals and ratios with up to four.
- 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, and the split by order-value band as"segment_by": ["segment1"]. - Campaign ids:
GET /api/v2/campaignsreturns the site's referral campaigns withid,name,appearance,status,tag_names,joinable_category_namesandlive_period. Two-arm interpretation requires distinct IDs. The script requiresjoinable_category_names ["purchase"]for both interpreted arms. Unlisted IDs and missing or non-purchase origins keep their per-ID metrics without interpretation. Post-purchase campaigns haveappearancepopup, and so do Post Event campaigns. The MCP toollist_campaignsnames each campaign's placement (placement_category“Post Purchase” or “Post Event”); thepost_purchasecampaign type counts both.
API reference: Talkable API documentation.
Filters and segmentations for this question
| Parameter | Values | Use it to |
|---|---|---|
campaign_ids[] (MCP: campaign_ids) | Campaign ids from the campaign list or the campaign's admin URL | Read the high-spend and the regular campaign one at a time |
segment_ (MCP: ["campaigns"]) | One row per campaign, labelled with its name. HTTP lists every campaign of the site; MCP lists those with activity in the period | See every campaign in one call; filter by id when two campaigns share a name |
MCP "segment_ (also segment2, segment3) | One row per band the store sends, such as segment1=, plus segment1= for purchases without a band | Read impressions, sharers and advocacy by order-value band, before or without a second campaign |
MCP "segment_ with split_ | One row per variant; keys from list_ | Read an A/B test of two rewards inside the segment |
segment_ | day, week, month, quarter, year; up to 1,000 rows per request | Follow the segment month by month after launch |
start_, end_ (MCP: period_, period_) | YYYY-MM-DD, for example 2026-07-01. REST also reads M/D/YYYY, month first, so 1/7/2026 is January 7: send YYYY-MM-DD. Both days included; days run in the account time zone | Set the period; MCP presets such as last quarter are rolling windows, so send custom dates |
exclude_ (MCP: exclude_qa) | Default true | Test traffic is already out of the activity metrics; sales metrics always leave it out |
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)
The Assistant already knows the Talkable metrics and your campaigns, so one sentence is enough:
Compare my post-purchase campaigns for July 1 – September 30, 2026: impressions, sharers, shares, clicks, visits, friend referral sales and friend referral revenue for each campaign, with the advocacy, sharing, click, visit and conversion rates and friend referral AOV.
Your own agent (OpenClaw, Claude Code or any other agent)
Your agent does not know how Talkable builds an order-value segment or reads it. Send it the same sentence and use the method in this report:
Compare my post-purchase campaigns for July 1 – September 30, 2026: impressions, sharers, shares, clicks, visits, friend referral sales and friend referral revenue for each campaign, with the advocacy, sharing, click, visit and conversion rates and friend referral AOV. Use the method in this report: https://get.talkable.com/analytics/segmentation-by-order-value
The agent also needs your API key or a connection to the Talkable MCP server.
Talkable MCP server, tool calculate_metric
To connect your agent (endpoint, credentials, client set-up), see the Talkable MCP server documentation. Nine metrics for one campaign, in one call. Replace 101 with your campaign's id: through MCP an id that is not a campaign of your site returns zeros, not an error.
{
"site_slug": "your-site",
"metrics": ["advocate_impressions", "sharers", "shares", "clicks", "visits",
"ideal_friend_sales_count", "ideal_friend_sales_sum",
"ideal_advocate_sales_count", "ideal_advocate_sales_sum"],
"period_type": "custom",
"period_start": "2026-07-01",
"period_end": "2026-09-30",
"campaign_ids": [101]
}
The answer, shaped as the server returns it, on the worked example's high-spend campaign (illustrative):
{"metrics": {"advocate_impressions": 2500, "sharers": 150, "shares": 180, "clicks": 300,
"visits": 120, "ideal_friend_sales_count": 20, "ideal_friend_sales_sum": 1840.0,
"ideal_advocate_sales_count": 6, "ideal_advocate_sales_sum": 1920.0},
"filters": {"period": {"from": "2026-07-01", "to": "2026-09-30"},
"exclude_qa_generated": true, "exclude_refunded": false},
"segmentations": [],
"metrics_aggregation_url": "/sites/your-site/reports/metrics_aggregation?…"}
- Every campaign at once: replace
"campaign_ids"with"segment_by": ["campaigns"]. Each metric then returns one entry per campaign with activity, keyed"campaigns=<campaign name>"plus"total"; a missing entry means 0. Same-named campaigns get their id in brackets only when both have activity in that metric, so filter bycampaign_idsto tell them apart. - By order-value band:
"segment_by": ["segment1"]returns one entry per band, for example"segment1=200-plus", and"segment1=(none)"for purchases that carry no band. Read the advocate-side metrics by band: impressions, sharers and advocacy. - Friend referral AOV is not a metric to request: divide
ideal_friend_sales_sumbyideal_friend_sales_countper entry. metrics_aggregation_urlopens the same numbers in the Metrics Aggregation Report in the Talkable admin.
HTTP (curl): the raw request any language can send
The responses below are the shapes the Python script parses, on the worked example's numbers (illustrative). Authentication and errors: Talkable API introduction.
# 1. the campaigns: id, appearance (popup alone is not a purchase trigger), origin category, status, tags
curl -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/campaigns?site_slug=$TALKABLE_SITE_SLUG"
# -> {"ok":true,"result":{"campaigns":[
# {"id":101,"name":"Post-purchase, orders of $150 and above","appearance":"popup","status":"Live",
# "is_active":true,"joinable_category_names":["purchase"],"tag_names":["high-spend"],"live_period":{"starts_at":"2026-04-01T00:00:00-07:00","ends_at":null}}, ...]}}
# 2. one metric for one campaign: replace 101 with your campaign's id from request 1
# (repeat for each metric and each campaign)
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/ideal_friend_sales_sum?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30&campaign_ids[]=101"
# -> {"ok":true,"result":{"plain":1840.0,"formatted":"$1,840.00","result_type":"money"}}
# 3. the same metric for the whole site (no campaign filter)
curl -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/ideal_friend_sales_sum?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30"
# -> {"ok":true,"result":{"plain":9200.0,"formatted":"$9,200.00","result_type":"money"}}
# 4. every campaign in one call, one row per campaign, labelled with its name
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/sharers/segmentize?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30&segment_by[campaigns]=true"
# -> {"ok":true,"result":{"segmented":[
# {"plain":150,"formatted":"150","result_type":"number","campaign":"Post-purchase, orders of $150 and above"},
# {"plain":300,"formatted":"300","result_type":"number","campaign":"Post-purchase, regular"},
# {"plain":0,"formatted":"0","result_type":"number","campaign":"Spring invite page"}]}}
- Repeat request 2 for each of the nine identifiers in the script's
METRICSlist and each campaign, then request 3 for the site total. - The
-gflag stops curl from interpreting the square brackets incampaign_ids[]andsegment_by[…]. - The campaign split lists every campaign of the site, those with no activity in the period included.
- An error comes back as
{"ok":false,"error_message":"…"}, for exampleNo metric found.for an unknown identifier.
Python: the full script
Prints the nine counts, each campaign's share of the site's impressions and seven rates for every live popup campaign, or for the campaign ids you pass, and the site total. For two distinct ids it interprets the segment against the regular campaign only when both have joinable_category_names ["purchase"] and the same recognized checkout kind. A purchase-origin popup without extension markers is classic; an extension needs the name/tag marker and popup or legacy widget appearance. Unknown IDs and unsupported or missing identity evidence still get per-ID metrics. Verify current setup and past settings in admin/MCP; names and tags are not versioned history. Needs Python 3 and requests (pip install requests); reads the key from TALKABLE_API_KEY and TALKABLE_SITE_SLUG.
"""Post-purchase funnel by campaign for one Talkable site: a segment campaign read against the regular one.
The segment campaign is, for example, a richer advocate reward for orders above an order-value cutoff. For each
campaign and for the site total the script pulls nine metrics from the Talkable metrics API, computes the five
funnel rates, friend referral AOV and advocate referral AOV, and, given two distinct campaign ids, prints the relative
difference of every rate only when both IDs have purchase origins and matching checkout kinds in the listing.
Without that evidence, every selected ID still gets counts and rates, but no two-arm interpretation.
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 order_value_segments.py START END # every live popup campaign
python3 order_value_segments.py START END ID # one campaign, any placement or status
python3 order_value_segments.py START END SEGMENT_ID REGULAR_ID # the segment campaign against the regular one
Post-purchase campaigns have appearance "popup" in the campaign list (GET /api/v2/campaigns). Post Event campaigns, such as a review-email popup, are popups too: check the
placement in MCP list_campaigns or the Talkable admin, and pass the post-purchase ids. Campaigns with status Test are
rejected. The script requires joinable_category_names ["purchase"], not popup appearance alone, for each arm.
It then recognizes a Shopify checkout extension by name "Shopify Extension(s)" or tag shopify-new-checkout and
appearance popup or widget (legacy extensions). A purchase-origin popup without those markers is classic.
Standalone, Post Event, missing origin metadata and unlisted IDs keep their metrics but no interpretation.
Both IDs must be distinct and recognized checkout kinds must match; verify the setup in admin/MCP before reading the pair. Current
metadata and naming conventions cannot prove past settings. Each row shows its own share of the site's
impressions. Send dates as YYYY-MM-DD: M/D/YYYY is also read, month first, so 1/7/2026 is January 7. Both days are
included, in the account time zone. Money is in the site's reporting currency. Percents and money to 2 decimals,
ratios to 4, "n/a" when the denominator is 0.
"""
import os
import re
import sys
import time
import requests
API = "https://www.talkable.com/api/v2"
METRICS = [ # article term -> API metric identifier
("Impressions", "advocate_impressions"),
("Sharers", "sharers"),
("Shares", "shares"),
("Clicks", "clicks"),
("Visits", "visits"),
("Friend referral sales", "ideal_friend_sales_count"),
("Friend referral revenue", "ideal_friend_sales_sum"),
("Advocate referral sales", "ideal_advocate_sales_count"),
("Advocate referral revenue", "ideal_advocate_sales_sum"),
]
RATES = [ # name, numerator, denominator, unit
("Advocacy rate", "Sharers", "Impressions", "pct"),
("Sharing rate", "Shares", "Sharers", "ratio"),
("Click rate", "Clicks", "Shares", "ratio"),
("Visit rate", "Visits", "Clicks", "pct"),
("Conversion rate", "Friend referral sales", "Visits", "pct"),
("Friend referral AOV", "Friend referral revenue", "Friend referral sales", "money"),
("Advocate referral AOV", "Advocate referral revenue", "Advocate referral sales", "money"),
]
MIN_SALES = 10 # Talkable's comparison of these campaigns read every rate but advocacy only at 10+ friend referral sales per arm
SAME = 0.10 # working rule of Talkable's analysts: rates less than 10% apart (relative) read as the same
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=180)
if r.status_code in (429, 503) and attempt < 4: # 429 API throttle, 503 metrics request budget
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.", 400 "No site found by `site_slug`."
raise RuntimeError(f"{path}: HTTP {r.status_code}: {body.get('error_message')}")
r.raise_for_status()
return body["result"]
def iso(day):
"""YYYY-MM-DD, or M/D/YYYY (month first, as the API reads it) turned into YYYY-MM-DD."""
m = re.fullmatch(r"(\d{1,2})/(\d{1,2})/(\d{4})", day)
if m and int(m.group(1)) <= 12:
out = f"{m.group(3)}-{int(m.group(1)):02d}-{int(m.group(2)):02d}"
print(f" note: {day} is read month first, as {out}; send YYYY-MM-DD to avoid a day-first mix-up.")
return out
if not re.fullmatch(r"\d{4}-\d\d-\d\d", day):
sys.exit(f"cannot read the date {day}: write YYYY-MM-DD, e.g. 2026-07-01")
return day
def kind_of(c):
"""Require a serialized purchase origin before classifying the checkout from current metadata."""
if not c or c.get("joinable_category_names") != ["purchase"]:
return "unverified purchase trigger/checkout kind"
appearance = c.get("appearance")
ext = re.search(r"shopify extensions?", c.get("name", ""), re.I) or "shopify-new-checkout" in (c.get("tag_names") or [])
if ext and appearance in ("popup", "widget"):
return "Shopify checkout extension"
if not ext and appearance == "popup":
return "classic post-purchase"
return "unverified purchase trigger/checkout kind"
def funnel(start, end, campaign_id=None):
"""The nine metrics for the whole site, or for one campaign (filter campaign_ids[])."""
extra = {"campaign_ids[]": campaign_id} if campaign_id else {}
raw = {term: get(f"metrics/{m}", start_date=start, end_date=end, **extra) for term, m in METRICS}
out = {term: r["plain"] for term, r in raw.items()}
out["currency"] = re.sub(r"[\d.,\s-]", "", raw["Friend referral revenue"]["formatted"]) # e.g. "$"
return out
def rate(num, den, unit):
if not den:
return None
return round(100 * num / den, 2) if unit == "pct" else round(num / den, 4 if unit == "ratio" else 2)
def show(x, unit=""):
if x is None:
return "n/a"
if unit == "pct":
return f"{x:.2f}%"
if unit == "ratio":
return f"{x:.4f}"
if unit == "rel":
return f"{100 * x:+.1f}%"
return f"{x:,.2f}" if isinstance(x, float) or unit == "money" else f"{x:,}"
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(seg, reg, kinds):
"""Relative difference of each rate, segment against regular, and how to read it."""
print("\nSegment campaign against the regular campaign")
if "unverified purchase trigger/checkout kind" in kinds:
print(" Interpretation withheld: both IDs need verified purchase origins and matching checkout kinds;\n"
" popup appearance alone is not proof. Check admin/MCP; per-ID counts and rates remain available.")
return
if kinds[0] != kinds[1]: # an extension is never read against a classic popup
print(f" note: the two campaigns are different post-purchase kinds ({kinds[0]} vs {kinds[1]});\n"
f" this is not a segment read, so no comparison is printed.")
return
rows = []
for name, n, d, u in RATES:
rs, rr = rate(seg[n], seg[d], u), rate(reg[n], reg[d], u)
diff = (seg[n] / seg[d]) / (reg[n] / reg[d]) - 1 if seg[d] and reg[d] and reg[n] else None # from the counts
if name not in ("Advocacy rate", "Advocate referral AOV") and \
min(seg["Friend referral sales"], reg["Friend referral sales"]) < MIN_SALES:
note = f"fewer than {MIN_SALES} friend referral sales in an arm: not read"
elif diff is not None and abs(diff) < SAME:
note = "less than 10% apart: the same"
else:
note = ""
rows.append((name, show(rs, u), show(rr, u), show(diff, "rel"), note))
print_table(("rate", "segment", "regular", "relative difference", ""), rows)
share = rate(seg["Impressions"], seg["Impressions"] + reg["Impressions"], "pct")
print(f" The segment campaign received {show(share, 'pct')} of the two campaigns' impressions. A cut at the 75th\n"
f" percentile of advocates' average orders puts about a quarter of your advocates above it; the campaign\n"
f" applies the cut to each order, so its share of impressions can differ.")
print(" Read: the two campaigns are two groups of customers, not two rewards. A higher friend referral AOV in the\n"
" segment is the segment's own; a higher advocacy rate holds the customers and the reward together: read it\n"
" as the most the richer reward can have added. To measure the reward itself, show the same segment\n"
" two rewards in an A/B test and read advocacy.")
def main(args):
start, end = iso(args[0]), iso(args[1])
if not all(x.isdigit() for x in args[2:]):
sys.exit("campaign ids are numbers: take them from the campaign list or the campaign's admin URL")
chosen = [int(x) for x in args[2:]]
listed = {c["id"]: c for c in get("campaigns")["campaigns"]} # keyed by ID; unlisted IDs remain unverified
if chosen:
tests = [i for i in chosen if listed.get(i, {}).get("status") == "Test"]
if tests:
sys.exit(f"campaigns {tests} have status Test: pick live or past campaigns")
ids = chosen
else:
ids = [i for i, c in listed.items() if c["appearance"] == "popup" and c["status"] == "Live"]
if not ids:
sys.exit("No live popup campaign in the campaign list: pass campaign ids.")
label, kinds, legend = {}, {}, []
for i in ids:
c = listed.get(i)
kinds[i] = kind_of(c)
if c:
label[i] = f"{c['name'][:32]} (id {i})"
legend.append(f" id {i}: {kinds[i]}, appearance {c['appearance']}, {c['status']}")
else:
label[i] = f"campaign (id {i})"
legend.append(f" id {i}: {kinds[i]}; absent from campaign list, status not checked")
site = funnel(start, end)
arms = {} # keyed by campaign id, so same-named campaigns stay on separate rows
for i in ids:
arms[i] = funnel(start, end, i)
if all(arms[i][t] == site[t] for t, _ in METRICS) and any(site[t] for t, _ in METRICS):
print(f" note: campaign {i} returned the site totals; if the site runs other campaigns, check the id.")
calls = 1 + len(METRICS) * (len(ids) + 1)
what = "the campaigns you named" if chosen else "every live popup campaign"
print(f"Funnel of {what}, {SITE}, {start} -> {end} "
f"({calls} calls; money in the site's reporting currency, {site['currency']})")
share = lambda a: show(rate(a["Impressions"], site["Impressions"], "pct"), "pct")
counts = [(label[i], *[show(a[t]) for t, _ in METRICS], share(a)) for i, a in arms.items()]
counts.append(("Site total, all placements", *[show(site[t]) for t, _ in METRICS], share(site)))
print_table(("campaign", *[t for t, _ in METRICS], "Share of site impressions"), counts)
print("\n".join(legend))
if not chosen:
print(" Post Event campaigns (a review-email popup, for example) are popups too: check each campaign's placement\n"
" in MCP list_campaigns or the Talkable admin, and read only the post-purchase rows.")
print()
rates = [(label[i], *[show(rate(a[n], a[d], u), u) for _, n, d, u in RATES]) for i, a in arms.items()]
rates.append(("Site total, all placements", *[show(rate(site[n], site[d], u), u) for _, n, d, u in RATES]))
print_table(("campaign", *[name for name, *_ in RATES]), rates)
if len(chosen) == 2:
if chosen[0] == chosen[1]:
print("\n Interpretation withheld: segment and regular campaign IDs must be distinct; per-ID metrics remain available.")
else:
compare(arms[chosen[0]], arms[chosen[1]], [kinds[i] for i in chosen])
elif len(chosen) > 2:
print("\n A segment comparison needs exactly two ids: the segment campaign, then the regular one.")
if __name__ == "__main__":
ARGS = sys.argv[1:]
if len(ARGS) < 2:
sys.exit("usage: python3 order_value_segments.py START END [ID ...] (dates YYYY-MM-DD; two ids = segment, regular)")
KEY, SITE = os.environ.get("TALKABLE_API_KEY"), os.environ.get("TALKABLE_SITE_SLUG")
if not KEY or not SITE:
sys.exit("set TALKABLE_API_KEY and TALKABLE_SITE_SLUG first (see the docstring)")
try:
main(ARGS)
except (RuntimeError, requests.RequestException) as error: # after the retries: report and stop
sys.exit(f"stopped: {error}")
Reconcile with the admin report
- Open the report. In the Talkable admin: your site → All reports → Metrics Aggregation. The MCP response's
metrics_aggregation_urlopens it with the same filter. - Set the same filters. The same start and end dates; the same campaign, if you filtered by
campaign_ids[]; the same test-traffic, refund and currency filters. - Compare column by column. The admin's name for each figure is in the metrics table above, column “Metrics Aggregation”.
If a figure differs, check six things:
- the period boundaries: both days are inclusive, in the account time zone;
- whether the report is filtered to the same campaign, and not to the whole site;
- whether you read both campaigns the same way: each with its campaign filter, or both from one campaign split;
- whether its other filters match;
- whether you compared the ideal-sales columns and not $ Dashboard sales, which is set per site;
- a gap of about 1–2% on every count: compare with the report's precision mode.
For a recent period, pull both on the same day: sharers can still grow, and a refund can still void a pending referral. If both your number and the report 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_impressionsand friend referral revenue isideal_friend_sales_sum. Friend referral AOV is computed, not requested. - “No site found by `site_slug`.” (HTTP 400)
Why: thesite_slugis not the Site ID of the key's site.
Fix: copy the Site ID from All site settings → General → Integrations → API integration. - “`start_date` is not a valid Date” (HTTP 400)
Why: REST reads M/D/YYYY month first, so a day-first date with a day above 12, such as 30/9/2026, is invalid. One with a day of 12 or less, such as 1/7/2026, is read as January 7, with no error.
Fix: send YYYY-MM-DD, such as2026-09-30. - “This segmentation produces … rows, over the synchronous limit of 1000” (HTTP 422)
Why: a split, such as a daily split by campaign over a long period, returns more than 1,000 rows.
Fix: narrow the period or the split. Or schedule it, as the message says:POST /api/v2/metrics/{metric}/segmentize(a key withapi:write), then pollGET …/segmentize/{job_id}. - “Metric is temporarily unavailable, please try again” (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; for a long period, run three months at a time.
Check: for two campaigns the script makes 28 calls: the campaign list and nine metrics for each campaign and for the site total. It waits 5, 10, 20 and 40 seconds between attempts, then stops with the error. - “Unsupported segmentation parameter :segment1” (HTTP 400)
Why: the REST metrics API does not split by custom segment; that split runs through the Talkable MCP server.
Fix: callcalculate_metricwith"segment_by": ["segment1"]. - “Unsupported parameters: … Supported parameters: …” (HTTP 400)
Why: the request carries a parameter name the Talkable metrics API does not know, for examplecampaign_id[]without its s.
Fix: use a name from the list in the message; sendcampaign_ids[]with its brackets (andcurl -g). - “`campaign_ids` contains non-existent ID.” (HTTP 400)
Why: the id is not a campaign of this site.
Fix: take the numeric id from the campaign list or the campaign's admin URL. - Only
segment1=(none)comes back
Why: the store sends no band with its purchases.
Fix: send the band as a custom segment; it splits reporting from that day on. - “note: the two campaigns are different post-purchase kinds”
Why: one campaign is the Shopify checkout extension and the other a classic post-purchase campaign. Talkable reads each against its own band, so they are not a segment pair.
Fix: compare two campaigns of the same kind. Older copies of the extension were set up as Floating widget: check the name and the tagshopify-new-checkout. - A review-email or other event popup in the list of post-purchase campaigns
Why: Post Event campaigns also haveappearancepopup, and thepost_purchasecampaign type counts them. Their offers come from an event, not an order.
Fix: check each campaign's placement (MCPlist_campaignsor the Talkable admin) and leave Post Event campaigns out of a segment pair. - Two rows with the same name in the campaign split
Why: the split labels rows with campaign names. HTTP repeats the name; MCP adds the id in brackets only when both campaigns have activity in that metric.
Fix: key every campaign by its id: filter withcampaign_ids[](MCP:campaign_ids). The script reads each campaign by its id, so same-named campaigns stay on separate rows. - 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, not totals: the quartile check. It needs each advocate's own orders, from the exportable reports: Purchases (every order with its customer's email and subtotal) and Referrals (each friend referral sale with its advocate). Average each advocate's orders, cut quartiles, and index each quartile's median friend order to the lowest one.
- Joining the two exports. In the Referrals export, keep the rows whose Ideal column is true, Qa generated is false, Status is not Blocked or Voided and FR Event Category is purchase. Its Purchase subtotal column is the friend's order, and its Advocate email column matches the customer's email on the advocate's own orders in the Purchases export.
- Exports from an agent. In the Talkable admin the reports download as CSV. The MCP tools
list_grid_reports,schedule_grid_exportandget_grid_exportschedule and fetch the same files (reports and exports). Scheduling needs the Write role and a key withmcp:write; only an export sent by email holds every row. - The segment over time. Add
segment_by[period]=monthto the campaign-filtered calls to follow the segment after launch. - The reward's own effect. Run an A/B test of two advocate rewards inside the high-spend campaign and split by variant through the Talkable MCP server (
"segment_by": ["split_test"]); read advocacy first. - The segment next to the other placements.
segment_by[campaign_types]=trueputs the post-purchase row beside Standalone, Floating widget and the rest. Campaigns with no type count in the total only, so add a row “Other campaigns (no type)” = total − sum of the rows. - Revenue net of refunds. MCP
exclude_refunded: trueleaves refunded orders out of the money metrics per campaign.
Methodology
- Figures
- Talkable benchmark data: the median program and the typical range (25th to 75th percentile); eight in ten = the 10th to 90th percentile. Cells under five programs are not published; no program is named.
- Populations
- Quartile check: 21 programs (22 on the average friend order), each with at least 50 advocates per quarter or thousands of referral rows; cut points: 25 programs; both analyses 2021–2026. Campaign comparison: 12 programs (8 with 10+ friend referral sales in both campaigns), 2018–2026. Reward tests: 15 programs, 2014 – August 2026.
- Code
- The requests and the script were run on a live Talkable site; REST and MCP agree.
FAQ
Do high-spending customers refer higher-spending friends in a referral program?
Yes, at all 21 programs in Talkable benchmark data (analyses 2021–2026). Friends referred by the top-spending quarter of advocates place orders a median 1.46 times those referred by the lowest quarter.
Where should I set the spend threshold for a richer referral reward?
At a percentile of your own advocates' orders, not a cash figure. Talkable starts at the 50th percentile; the 75th, the top quarter, sits a median 1.46× the median advocate order (Talkable benchmark data, 25 programs, analyses 2021–2026).
Does a bigger referral reward for high spenders increase sharing?
Campaign against campaign, advocacy runs a median 30.5% higher in the high-spend campaign (Talkable benchmark data, 12 programs, 2018–2026). Part of that gap is the customers, not the reward. An A/B test inside the segment measures the reward.
How is friend referral AOV calculated?
Friend referral AOV = friend referral revenue ÷ friend referral sales, recorded after the discount. The Talkable metric average_order_value divides both sides' revenue by both sides' sales, so it is referral AOV, not the friend-side figure.
How many advocates does a referral quartile check need?
As a working practice, Talkable's analysts split advocates into spend quartiles once at least 100 advocates have referrals. The benchmark programs each have at least 50 advocates per quarter or thousands of referral rows.
How do I compare a high-spend referral campaign with the regular one from the Talkable API?
GET https://www.talkable.com/api/v2/metrics/{metric} with site_slug, start_date, end_date and campaign_ids[] for each campaign, for the six funnel counts and ideal_friend_sales_sum; divide each count by the one above it, and revenue by friend referral sales.
Learn more
In the Talkable documentation:
| Segments | Campaign Join Criteria on the advocate's order, traffic sources, and the three custom segments sent with a purchase |
| Incentive criteria | The trigger condition on an advocate or friend reward |
| Post Purchase placement | How the post-purchase campaign shows after checkout on Shopify, Magento and custom platforms |
| Pass custom user data | Custom properties sent with a purchase or a customer |
| Talkable MCP server | Connect Claude Code, ChatGPT, Cursor or any MCP client |
| Talkable API | Authentication, response format, errors and throttling |
