
Referral Friend Reward: Dollar Amount, Percentage or Free Product
In short
In Talkable's same-site A/B tests, at the values each program chose, neither shape won: a fixed amount beat a percentage in 4 of 7 friend-reward tests (Talkable benchmark data, 7 programs, 2014 – August 2026). Compare the two at equal value: 20% off a $100 order before the discount is the same reward as $20 off.
Why it matters
In Talkable, the friend reward is usually shown twice: on the share page, where the advocate decides whether to share, and on the claim page, where the friend decides whether to buy.
Its shape also sets what each referred order costs. On a $400 order, 20% off is $80 and $20 off is $20. On a $50 order, $20 off is the bigger reward.
So the shape another store chose tells you little about yours. Start with your own friend referral AOV and your funnel under each reward you have run (how to calculate it).
The shape of a friend reward
Talkable separates the rule from what people receive. An incentive is the rule a campaign sets. A reward is what a person receives under it.
- The friend reward is what the referred friend gets. It is usually issued on the claim page, before the friend buys.
- The advocate reward is what the advocate, the customer who shared, gets once the friend's purchase qualifies.
The shape of a reward is how its value is expressed, apart from its size. Talkable programs use three shapes for the friend:
- A fixed amount, such as $20 off: the same value on every order.
- A percentage, such as 20% off: the value grows with the order.
- A free product or trial: an item, or a free period of a subscription. Its cost is what the item costs the store, whatever the order.
In Talkable, the friend's reward is usually a discount coupon, set on the campaign's incentive as a fixed amount or a percentage. It goes out as one multi-use code or as single-use codes, one per friend (Coupons).
A gift card or store credit is a fixed amount paid another way; Talkable programs use them mostly for the advocate. The campaign's incentive criteria decide when a reward is issued, whatever its shape.
Size is a different question: whether $10 or $50 buys more referrals. This page compares the shapes at the same value, so the first step is to find that value.
Comparing a percentage with a fixed amount
A friend referral sale is a friend's purchase that Talkable matched to an advocate inside the attribution window, or tracked by a coupon, and that is not blocked or voided. Friend referral revenue is the total of those orders.
The other counts follow the Talkable metric standard:
- Impressions: share page views plus sign-up page views, minus sign-ups.
- Sharers: offers shared at least once. An offer is one advocate's referral record per campaign and per origin (a purchase, an event or a visit). Talkable dates sharers by the day the offer was created; every other stage counts in the period its own event happened.
- Shares: each recorded share of an offer; an email to three new recipients is three shares. Clicks: openings of a share link. Visits: friends who go on from the claim page to the store.
Friend referral AOV is the average order a referred friend places: friend referral revenue ÷ friend referral sales. Talkable records it after the discount.
A percentage applies to the order before the discount, so rebuild that order first:
order before the discount = friend referral AOV + amount (a fixed amount)
order before the discount = friend referral AOV ÷ (1 − percentage) (a percentage)
reward share of the order = reward value ÷ order before the discount
For a percentage, the reward share is the percentage itself. For a fixed amount it is amount ÷ (friend referral AOV + amount). At a $100 friend referral AOV:
- with 20% off, the friend paid $100 on a $125 order: a $25 discount, a 20% share;
- with $20 off, the order was $120: a 16.7% share;
- with $25 off, the order was $125: a 20% share, the same reward as 20% off.
The formulas treat the average referred order as discounted. Some friend referral sales are placed without the friend's code, so read the share as the reward's value at the typical referred order, and the discount per order as the cost of an order that used the code.
Before launch, with no referred orders yet, use the store's average order value as the order before the discount.
Compare the share, not the face value. $20 off a $100 order and $20 off a $1,000 order are different rewards: 20% of the order against 2%.
| Friend's order before the discount | 20% off: the friend's discount (share of the order) | $20 off: the friend's discount (share of the order) |
|---|---|---|
| $50 | $10 (20%) | $20 (40%) |
| $100 | $20 (20%) | $20 (20%) |
| $400 | $80 (20%) | $20 (5%) |
A fixed amount caps the cost of one order; a percentage pays most on the largest order (minimum order and cost).
A worked example
Round numbers chosen to show the arithmetic and the one trap every reward comparison meets. They match no program.
A store runs 20% off for friends in the first quarter, on the same placements all year. On the first day of the second quarter it switches to $20 off, then splits its funnel by friend reward for both quarters. Each column counts only the events of its quarter.
| Figure for the quarter | Q1, friend reward 20% off | Q2, friend reward $20 off | Q2, friend reward 20% off |
|---|---|---|---|
| Impressions | 10,000 | 10,000 | 0 |
| Sharers | 500 | 560 | 0 |
| Visits | 480 | 500 | 30 |
| Friend referral sales | 72 | 75 | 9 |
| Advocacy rate | 5.0% | 5.6% | n/a |
| Conversion rate | 15.0% | 15.0% | 30.0% |
| Friend referral sales per 1,000 impressions | 7.2 | 7.5 | n/a |
| Friend referral AOV, after the discount | $100 | $110 | $80 |
| Order before the discount | $125 | $130 | $100 |
| Discount per order | $25 | $20 | $20 |
| Reward share of the order | 20% | 15.4% | 20% |
The trap. The third column looks like 20% off converting at twice the rate of $20 off: 30.0% against 15.0%. It is the old reward's tail: visits and sales with no impressions and no sharers.
Its sales come from links and codes issued in the first quarter, so its conversion says nothing about the shape (the old reward's tail). Compare the first two columns only.
The real change is at the top. Advocacy rose from 5.0% to 5.6%, 12% higher: above the 10% Talkable's analysts treat as material (reading rule 5). Conversion stayed at 15.0%.
Volume held and the cost fell. Friend referral sales per 1,000 impressions went from 7.2 to 7.5, less than 10% apart: the same. The discount per order fell from $25 to $20. At this store's order size, $20 off is the smaller reward: 15.4% of a $130 order against 20%.
By reading rule 4 (decide on friend referral sales per 1,000 impressions, with the discount beside it), $20 off reads better here: the same sales for a smaller discount. The two quarters are a before-and-after in different seasons, so say so, and settle it with an A/B test.
What the data says
Every cross-program figure below is Talkable benchmark data: each program's figure first, then the median across programs, with the program count and period beside it.
What programs run
Across 174 Talkable programs with at least 1,000 impressions and 100 visits between January 2025 and June 2026, the friend side splits almost evenly between the two shapes. On the advocate side, 138 of the 174 pay a fixed amount.
| Programs by reward shape, and the median reward | Friend reward | Advocate reward |
|---|---|---|
| Programs paying a fixed amount | 84 | 138 |
| Programs paying a percentage | 77 | 36 |
| Programs with no reward or a non-monetary one | 10 none · 3 non-monetary | 0 |
| Median fixed amount, programs paying one (typical range) | $20–$25 ($10–$40) | $20–$25 ($13–$40) |
| Median percentage, programs paying one (typical range) | 20% (15–25%) | 20% (19–25%) |
Number of programs paying each reward shape, and the median reward of each shape; each median covers only the programs that pay that shape; typical range = 25th to 75th percentile of programs; fixed amounts in US dollars. Talkable benchmark data, 174 programs, January 2025 – June 2026.
How programs pair the two sides. 47 of the 174 programs mix shapes: a fixed amount on one side, a percentage on the other. Where both sides use the same shape, the two values are equal in 93 of 114 programs (Talkable benchmark data, January 2025 – June 2026).
Head-to-head tests
The closest evidence is a same-site A/B test: a fixed amount and a percentage shown to the same traffic at the same time. Talkable decided the published tests on one rate per side: conversion for a friend-reward test, advocacy for an advocate-reward test.
In your own test, read advocacy first and decide on friend referral sales per 1,000 impressions (reading rules 2 and 4): the friend reward is also printed on the share page.
| Reward tested, and the rate that decided the winner | Tests (programs) | Tests the fixed amount won |
|---|---|---|
| Friend reward, on conversion rate | 7 (7) | 4 of 7 |
| Advocate reward, on advocacy rate | 9 (8) | 4 of 9 |
Same-site A/B tests of a fixed amount against a percentage; the winner is the variant that measured higher. Talkable benchmark data: tests created 2014 – August 2026, each variant with at least 700 impressions (advocate-reward tests) or 100 visits (friend-reward tests).
Neither shape wins, on either side. The tests ran at the values each program chose, often the same face number, such as $20 against 20%. That is the same value only on a $100 order, so the tests read size and shape together.
Where a change to the friend reward shows first. The same register holds tests of the reward's amount. A higher friend reward lifted advocacy in 17 of 18 programs, median +18.6%. It won on friend conversion in 7 of 12, median +1.3%.
A higher advocate reward lifted advocacy in 11 of 15 programs, median +8.6% (Talkable benchmark data, 2014 – August 2026).
The friend reward is printed on the share page, so a change to it shows in advocacy, while friend conversion barely moves. These are amount results: they say which rate to read first, not which shape wins.
Three single programs leaned the same way at the top of the funnel, toward the fixed amount:
- a rotation of two campaigns, a fixed amount against a percentage (2026): clearly higher advocacy and more friend visits on the fixed amount, with sales a tie. At that program's order size, the percentage was the larger reward;
- a rotation of a fixed amount against a percentage of the same face number (2018–2019): more visits per impression on the fixed amount on every placement. The two were close in value;
- fixed amounts and percentages run in different seasons at one program (2024–2026): higher advocacy, and higher friend conversion, on the fixed amount at the same face number. At that order size the same face number was not the same value, and the seasons differed.
Only the second is close to a matched value. Each is one program's reading, so it shows a direction, not the size of an effect.
A free product or trial
Talkable compared a free gift with a credit discount as the friend reward in one industry: beauty programs whose store average order was above $80, 29 programs screened, each program's history to 2022. In that comparison:
- the gift came with more friend clicks and visits;
- a smaller share of those visits converted than under the credit discount.
Single programs have seen the opposite: one skincare program's conversion rose while a gift was the friend reward (2022).
Read a free product on friend referral sales per 1,000 impressions, with the item's cost beside it. In that read the middle of the funnel was higher and the bottom lower under a gift, so conversion alone shows only one of the two.
Before offering advocates a free product, Talkable's analysts check whether customers buy it more than once. An advocate who has just bought a one-off product has little use for a second one, which is why some one-product stores pay advocates in third-party gift cards. This is practice, not a statistical test.
What Talkable's analysts advise
Working rules Talkable's analysts apply when a store asks “a dollar amount or a percentage?”; practice, not a statistical test:
- No universal winner: test it on your own traffic, at a matched value. In the same-site tests above, each shape won about half the time.
- A fixed amount where the order is small or the cost must be capped; a percentage where order sizes vary. A percentage grows with the order; a fixed amount never pays more than its face value. Stores with small orders set smaller fixed amounts (median $13 under $50, by order value).
- The friend reward must beat the store's welcome discount. Convert both to a share of the order first. Illustrative: if newsletter sign-up gives 20% off and the friend reward is $10 on an $80 order, the referral reward is 12.5% of the order, the weaker of the two.
- One program's own comparison. After it launched a sitewide welcome discount for new customers, its daily friend referral revenue from new customers was about 40% lower and its daily purchases on the referral coupon about 80% lower (2024).
- Pay both sides the same value unless you have a reason not to. Equal values are the norm (93 of 114, above). If you raise one side for more sharers, raise the friend reward first: it moves advocacy more than the advocate reward (head-to-head tests).
Deep dive: the shape across cuts
Order value, placement and time each change what a shape comparison shows.
By order value: small orders lean to a fixed amount
The same 174 programs, grouped by their friend referral AOV (what their referred friends spend per order on average), show how stores choose the shape:
| Band of programs | Fixed friend reward: median program (programs) | Percentage friend reward: median program (programs) |
|---|---|---|
| Programs whose friends spend under $50 per order on average | $13 (10) | 20% (6) |
| Programs whose friends spend $50–99 per order on average | $18 (26) | 20% (19) |
| Programs whose friends spend $100–199 per order on average | $20 (17) | 20% (21) |
| Programs whose friends spend $200 and above per order on average | $50 (29) | 20% (29) |
Median program's friend reward per band and shape, program count in brackets; money friend rewards only, in US dollars. Talkable benchmark data, January 2025 – June 2026. The bands hold 82 of the 84 fixed-amount programs and 75 of the 77 percentage programs: the other four had no friend referral sales in the period, so no friend referral AOV.
The percentage stays put; the fixed amount moves with the order. The median percentage is 20% in every band. The median fixed amount rises from $13 in the smallest band to $50 in the largest.
Small orders lean to a fixed amount. Under $50, 10 of the 16 programs pay friends a fixed amount. At $100 and above, about half do. That matches the analysts' rule above, and it shows what stores choose, not what works better.
For example, ask the Talkable AI Assistant: “What was my friend referral AOV for April 1 – September 30, 2026, and what share of the order before the discount is my current friend reward?”
By placement: compare the shapes inside one placement
Placement decides who sees the friend reward. The funnel differs by placement before any reward changes:
| Placement | Advocacy rate, median program (programs) | Conversion rate, median program (programs) |
|---|---|---|
| Standalone | 12.1% (128) | 19.5% (108) |
| Floating widget | 8.6% (73) | 19.0% (64) |
| Post-purchase | 4.5% (64) | 10.6% (53) |
Advocacy and conversion rates by placement, median program per cell, program count in brackets. Talkable benchmark data, 2025.
Why a whole-program comparison can hold two changes. A store that switches its friend reward and shifts impressions between placements in the same months has changed two things. Its whole-program advocacy moves with the placement mix even if the reward did nothing.
Compare the two rewards placement by placement. The Talkable MCP server splits the funnel metrics by incentive combination (the pair of rewards a campaign carries, advocate and friend) and placement together (Go further: each reward by placement).
For example, ask the Talkable AI Assistant: “Show my referral funnel for July 1 – September 30, 2026 by placement, and within each placement by incentive combination.”
Over time: the old reward's tail
When a store switches its friend reward, Talkable keeps recording activity on the offers created before the switch. Each such offer still carries the old reward, so in a split by reward the old reward keeps a row:
| Funnel stage | Under the old reward, after the switch | Why |
|---|---|---|
| Impressions, sharers | stop | The old reward is no longer shown, and sharers are dated by the offer's creation |
| Shares, clicks, visits | continue | Advocates can still share offers created earlier, and friends still open earlier links |
| Friend referral sales | continue | Inside each tracking method's attribution window; coupon-tracked purchases are not bound by the window |
Why the tail's conversion is not comparable. Its sales come from links and codes issued earlier, often against visits recorded in an earlier month. It can read above or below the live reward's conversion.
Compare full months of each reward. Read the new reward from its first full month of impressions and the old one up to its last. A full month has one reward live from its opening midnight through the next month’s opening midnight, in the account time zone. A switch exactly at that boundary does not mix either month. A switch inside a month, or a partially live month, does not qualify.
Date the tail by the expiry instant. Keep the full campaign timestamps and the account time zone. Months outside the live intervals are tail, even if an impression or two still appears. In the expiry month, daily rows starting at or after expiry are tail too: an April 1 midnight expiry includes all of April 1. A daily split cannot separate the live and tail events of a midday expiry.
An A/B test avoids both problems: both rewards show at the same time.
For example, ask the Talkable AI Assistant: “Split impressions, visits and friend referral sales by incentive combination and by month for January 1 – September 30, 2026, and list the months in which a reward had visits or sales but no impressions.”
Minimum order and cost
Minimum order. A minimum order is the guard for a fixed amount: it keeps a large discount off small orders, such as $40 off a $50 order. A percentage shrinks with the order on its own, so it needs no minimum to cap the cost.
A minimum also has a price on the advocate side. At one program, the advocate earned a reward only when the friend's order passed a minimum. When the minimum went up, friend conversion did not change, while the share of advocates who brought a sale but got no reward nearly doubled (2024–2025).
Gift cards and coupons are costed differently. Talkable's analysts count a gift card in full when it is issued and a coupon only when it is used. A comparison of a coupon with a gift card changes how the reward is paid as well as its shape.
For example, ask the Talkable AI Assistant: “List the friend reward and the advocate reward on each of my live campaigns, with the minimum order each reward requires.”
Reading a shape comparison
- Convert before you compare. Put both rewards on the order before the discount. If their values differ there, you are comparing a size as well as a shape.
- One program tested a small fixed amount against a percentage on both sides (2018). The percentage won on advocacy, with a markedly higher referral AOV: at that store's order size it was the bigger reward.
- Read advocacy first, conversion last. The friend reward is printed on the share page, so a change shows in advocacy first (head-to-head tests). Sales are the smallest count in the funnel, so they settle a test last.
- Put three readings side by side: advocacy, conversion, and friend referral AOV with the reward share. A reward that wins advocacy and loses order value has changed what each order brings in, as well as how many orders come.
- Decide on friend referral sales per 1,000 impressions (friend referral sales ÷ impressions × 1,000), a composite Talkable's analysts use, with the discount per order beside it. That one number carries the whole path from advocate to purchase.
- Treat rates less than 10% apart as the same (relative: 5.0% to 5.6% is 12% apart). That is the working rule Talkable's analysts apply; practice, not a statistical test.
- Compare full months with impressions, never a tail (the old reward's tail). A before-and-after on adjacent full months can be read with the seasons named; an A/B test settles it.
Calculate it for your own program
Every count and rate your own comparison needs comes from Talkable, split by the friend reward each campaign carries. 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_metricwith the split by incentive combination. - Talkable metrics API: an HTTP request or the Python script below, with your API key. The split is by group of campaigns.
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 |
| Advocacy rate | advocacy_ | Advocacy 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 |
| Reward share of the order | computed: the formulas above | computed | percent |
| Friend referral sales per 1,000 impressions | computed: friend referral sales ÷ impressions × 1,000 | computed | ratio, not a 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, by campaign): 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. - Precision: percents come back with two decimals and ratios with 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 reward as"segment_by": ["incentive_combinations"]. - Through HTTP the split by reward is a filter:
campaign_ids[]with the campaigns that carry one reward, one call per metric and group. - The rewards on a campaign: the MCP tool
list_incentivesreturns each incentive with itstype(ClickIncentive= friend reward,ReferrerIncentive= advocate reward),percentage_discountandcoupon_lists. The coupon list'samountis the value on the coupon; whenpercentage_discountis true, it is the percentage (15.0 = 15% off). - Where a reward's value comes from: the campaign's incentive, read in the Talkable admin campaign settings or with
list_incentives. The campaign list and the metrics give ids, names, tags and dates. - Tags and names are labels the store chose: a tag like
20-offcan mean 20% or $20. Confirm each reward's shape and value before you compute the share of the order.
API reference: Talkable API documentation.
Filters and segmentations for this question
| Parameter | Values | Use it to |
|---|---|---|
MCP "segment_ | One row per pair of rewards, labelled AD: <advocate reward>, FR: <friend reward>, for example AD: $15, FR: 20%, plus total, the sum of the rows | Split every metric by reward in one call. A row groups every campaign that carries the pair |
MCP "date_ or "campaign_ as a second dimension | Keys such as incentive_; the two parts can come in either order | See each reward by month (with "aggregate_) or by placement |
GET /api/ | id, name, status, appearance, tag_, live_; the site's referral campaigns | Build the groups for HTTP; leave out campaigns with status Test; date each reward's end. The reward itself comes from the campaign settings, not from a tag |
campaign_ids[] (MCP: campaign_ids) | Ids of the campaigns that carry one reward | Filter any metric to one reward group |
segment_ | day, week, month, quarter, year; up to 1,000 rows per request | Split one group by month to find the old reward's tail |
start_, end_ (MCP: period_, period_) | YYYY-MM-DD, for example 2026-07-01 (REST also takes M/D/YYYY); both days included; days run in the account time zone | Set the period: a quarter at a time, with full months for each reward |
exclude_ (MCP: exclude_qa) | Default true | Test traffic is already out of the activity metrics; sales metrics always leave it out. Campaigns with status Test are a different thing: they still count |
MCP exclude_, currency | true / false; a currency code | Revenue net of refunds per reward; one currency for a multi-currency store |
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 friend rewards for January 1 – September 30, 2026: split impressions, sharers, visits and friend referral sales by incentive combination and by month, and give the advocacy rate, conversion rate and friend referral AOV of each friend reward.
Your own agent (OpenClaw, Claude Code or any other agent)
Your agent does not know how Talkable records rewards and order values. Send it the same sentence and use the method in this report:
Compare my friend rewards for January 1 – September 30, 2026: split impressions, sharers, visits and friend referral sales by incentive combination and by month, and give the advocacy rate, conversion rate and friend referral AOV of each friend reward. Use the method in this report: https://get.talkable.com/analytics/dollar-vs-percent-friend-reward
The agent also needs your API key or a connection to the Talkable MCP server.
Talkable MCP server, tools calculate_metric and list_incentives
To connect your agent (endpoint, credentials, client set-up), see the Talkable MCP server documentation. Seven metrics per reward pair, in one call:
{
"site_slug": "your-site",
"metrics": ["advocate_impressions", "sharers", "shares", "clicks", "visits",
"ideal_friend_sales_count", "ideal_friend_sales_sum"],
"period_type": "custom",
"period_start": "2026-01-01",
"period_end": "2026-06-30",
"segment_by": ["incentive_combinations"]
}
The answer, shaped as the server returns it, on the worked example's numbers (illustrative):
{"metrics": {
"advocate_impressions": {"incentive_combinations=AD: $15, FR: 20%": 10000,
"incentive_combinations=AD: $15, FR: $20": 10000, "total": 20000},
"visits": {"incentive_combinations=AD: $15, FR: 20%": 510,
"incentive_combinations=AD: $15, FR: $20": 500, "total": 1010},
"ideal_friend_sales_count": {"incentive_combinations=AD: $15, FR: 20%": 81,
"incentive_combinations=AD: $15, FR: $20": 75, "total": 156},
"ideal_friend_sales_sum": {"incentive_combinations=AD: $15, FR: 20%": 7920.0,
"incentive_combinations=AD: $15, FR: $20": 8250.0, "total": 16170.0}},
"filters": {"period": {"from": "2026-01-01", "to": "2026-06-30"},
"exclude_qa_generated": true, "exclude_refunded": false},
"segmentations": ["incentive_combinations"],
"metrics_aggregation_url": "/sites/your-site/reports/metrics_aggregation?…"}
Sharers, shares and clicks come back in the same shape.
- A row that would be zero is left out: a missing row means 0. The response's
totalis the sum of the rows; for the site total, make a second call withoutsegment_by. - Rows can overlap: for sharers, the rows can add up to more than the site total, because one offer can be counted under more than one reward pair. A negative “Other campaigns” then means overlap, not missing campaigns: report it as overlap and read each pair on its own row.
- By month:
"segment_by": ["incentive_combinations", "date_range"]with"aggregate_period": "month". By placement:["incentive_combinations", "campaign_types"]. Read each part of a two-part key by its name. - Custom dates: presets such as
last quarterare rolling windows, not calendar quarters. metrics_aggregation_urlopens the same numbers in the Metrics Aggregation Report in the Talkable admin.- Which reward a row is:
list_incentiveswith acampaign_id(ids fromlist_campaigns) shows each campaign's friend and advocate rewards; read the value fromcoupon_lists.
// list_incentives
{"site_slug": "your-site", "campaign_id": 101}
HTTP (curl): the raw request any language can send
The responses below are the shapes the Python script parses, on round illustrative numbers. Authentication and errors: Talkable API introduction.
# 1. the campaigns, to build one group per friend reward
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":"Standalone page","appearance":"inline","status":"Live","is_active":true,
# "tag_names":["invite","20-off"],"live_period":{"starts_at":"2026-04-01T00:00:00-07:00","ends_at":null}}, ...]}}
# 2. one metric for one group (the campaigns that carry $20 off): replace 101 and 102
# with your campaign ids from request 1, one campaign_ids[] per id
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/ideal_friend_sales_count?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-04-01&end_date=2026-06-30&campaign_ids[]=101&campaign_ids[]=102"
# -> {"ok":true,"result":{"plain":75,"formatted":"75","result_type":"number"}}
# 3. the same group by month: a month with visits or sales and no impressions is a tail
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-04-01&end_date=2026-06-30&segment_by[period]=month&campaign_ids[]=101&campaign_ids[]=102"
# -> {"ok":true,"result":{"segmented":[
# {"plain":180,"formatted":"180","result_type":"number","period":"4/1/26 - 4/30/26"},
# {"plain":160,"formatted":"160","result_type":"number","period":"5/1/26 - 5/31/26"},
# {"plain":160,"formatted":"160","result_type":"number","period":"6/1/26 - 6/30/26"}]}}
- Repeat request 2 for each identifier in the metrics table and each group, then once without
campaign_ids[]for the site total. - The
-gflag stops curl from interpreting the square brackets incampaign_ids[]andsegment_by[…]. - An error comes back as
{"ok":false,"error_message":"…"}, for exampleNo metric found.for an unknown identifier.
Python: the full script
Prints the counts, rates, friend referral AOV and the reward on the order before the discount for each reward group and the site total. The first table keeps all-period reported totals and rates, including tails. The month table preserves gaps between campaigns. Rankings use complete months when only that reward was live, with impressions and every selected campaign ID covering the full timestamp window, including the entire last day. Date labels are for display, not proof of whole-day coverage. A same-reward replacement can hide an expired campaign's tail in grouped totals, so months without this ID-level coverage are not ranked; the script does not fetch separate eligible-ID counts. Verify past reward settings: campaign metadata is not versioned history. Needs Python 3.9+, IANA time-zone data and requests (pip install requests). If the system has no IANA database (common on Windows), run pip install tzdata in the Python environment used for this example. This is a reader setup step, not a website app dependency. A missing TALKABLE_ACCOUNT_TIME_ZONE needs the verified account zone; an invalid or unresolvable value needs a valid IANA name and available time-zone data. Set TALKABLE_API_KEY, TALKABLE_SITE_SLUG and TALKABLE_ACCOUNT_TIME_ZONE to the account's verified IANA time-zone identifier, for example America/Los_Angeles only if that matches the account setting. Serialized offsets are not a substitute for that zone, which can change offset with daylight saving. Missing zone or unknown timestamps withhold comparison, not totals. Conservatively, finite ends must reach next local midnight after the last reporting day; an expiry date alone does not prove full-day coverage.
"""Compare the friend rewards of one Talkable site: the referral funnel, friend referral AOV and reward share per reward.
A reward group is the set of campaigns that carry the same friend reward. For each group and for the site total the
script pulls seven metrics from the Talkable metrics API, computes the rates and the reward on the order before the
discount, splits impressions, visits and friend referral sales by month (and the end month by day), marks the old
reward's tails (outside its known live intervals) and the switch months. Reported totals and rates keep all events.
Comparisons use complete, exclusive live months with impressions, only when every selected campaign ID was live
throughout the month, including the full last day. Full offset-bearing timestamps, not date prefixes, gate coverage.
Live intervals and calendar windows are half-open: expiry at a month's opening midnight leaves that month
exclusively to its replacement. Clean-date hints include only whole exclusive days. Daily tails include a full
day starting exactly at expiry; daily rows cannot separate a partial expiry day.
Set TALKABLE_ACCOUNT_TIME_ZONE to the account's verified IANA zone (for example America/Los_Angeles only if that
is the account setting); do not infer the zone from a serialized offset. Missing zone or unknown timestamps withhold
comparison, not totals. Conservatively require finite ends at or after next local midnight following the last day.
This excludes partial expiry days and replacement months whose grouped counts could include an expired
campaign's tail. Conversion and sales per 1,000 use those monthly counts; unavailable eligible rates are not ranked.
Campaign metadata is not versioned history.
Usage:
pip install requests
# If the system IANA database is absent (common on Windows): pip install tzdata
export TALKABLE_API_KEY=... # All site settings -> General -> Integrations -> API integration: "API key"
export TALKABLE_SITE_SLUG=... # same page, "Site ID"
export TALKABLE_ACCOUNT_TIME_ZONE=... # verified account IANA zone, not a timestamp offset
python3 reward_shapes.py --campaigns
python3 reward_shapes.py 2026-04-01 2026-06-30 "20% off:20%=101,102,103" '$20 off:20=104,105'
--campaigns lists the returned campaigns (id, status, placement, live dates, tags, name), to build
the groups. A group is "label:reward=campaign ids"; labels must be distinct and nonblank. Duplicate campaign IDs
across groups are rejected too. The reward is "20%" for a percentage or "20" for a fixed amount
in the site's currency, as on the campaign's coupon list: read it in the Talkable admin campaign settings or with
the MCP tool list_incentives, never from a tag or a campaign name. Campaigns with status Test are left out of the
groups and shown as their own row: they still count in the site total.
Requires Python 3.9+ (standard-library zoneinfo) and IANA time-zone data. If the system database is absent,
install tzdata with pip install tzdata in this example's Python environment (not an app dependency).
Dates are YYYY-MM-DD (M/D/YYYY also accepted), both days included, in the account time zone; a quarter at a time
keeps each request light. 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 calendar
import os
import re
import sys
import time
from datetime import date, datetime, timedelta, timezone
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
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"),
]
MONTHLY = ["Impressions", "Visits", "Friend referral sales"] # the month split that shows an old reward's tail
MONEY = ("Friend referral revenue", "Friend referral AOV", "Order before the discount", "Discount per order")
RATES = ("Advocacy rate %", "Visit rate %", "Conversion rate %", "Friend referral sales per 1,000 impressions")
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=120)
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.", 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 pull(start, end, ids=None, status=None):
"""Period totals of the seven metrics: one group of campaigns, all campaigns with one status, or the whole site."""
extra = {"campaign_ids[]": ids} if ids else {"campaign_status": status} if status else {}
raw = {term: get(f"metrics/{m}", start_date=start, end_date=end, **extra) for term, m in METRICS}
v = {term: r["plain"] for term, r in raw.items()}
v["currency"] = re.sub(r"[\d.,\s-]", "", raw["Friend referral revenue"]["formatted"]) # e.g. "$"
return v
def by_period(start, end, ids, period="month"):
"""{term: {period label: value}} for impressions, visits and friend referral sales; every period is listed."""
ident = dict(METRICS)
out = {}
for term in MONTHLY:
rows = get(f"metrics/{ident[term]}/segmentize", start_date=start, end_date=end,
**{"segment_by[period]": period, "campaign_ids[]": ids})["segmented"]
out[term] = {row["period"]: row["plain"] for row in rows}
return out
def pct(a, b):
return round(100 * a / b, 2) if b else None
def ratio(a, b):
return round(a / b, 4) if b else None
def show(x, key=""):
if x is None:
return "n/a"
if key in MONEY or key.endswith("%"):
return f"{x:,.2f}"
if "ratio" in key or "per 1,000" in key:
return f"{x:,.4f}"
return f"{x:,}"
def iso(day):
"""YYYY-MM-DD, or M/D/YYYY 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:
return f"{m.group(3)}-{int(m.group(1)):02d}-{int(m.group(2)):02d}"
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-04-01")
return day
def parse_group(arg):
"""'label:reward=id,id' -> (label, reward, [ids]); reward '20%' = a percentage, '20' = a fixed amount."""
head, _, ids = arg.partition("=")
label, _, reward = head.partition(":")
if not re.fullmatch(r"\s*\d+(,\s*\d+)*\s*", ids) or not re.fullmatch(r"(\d+(\.\d+)?%?)?", reward.strip()):
sys.exit(f'cannot read the group "{arg}": write it as "label:reward=id,id", e.g. "20% off:20%=101,102"')
return label.strip(), reward.strip() or None, [int(i) for i in ids.split(",")]
def rates(v, reward=None):
sales, visits = v["Friend referral sales"], v["Visits"]
aov = v["Friend referral revenue"] / sales if sales else None # friend referral AOV, recorded after the discount
order = discount = share = None
if reward and aov is not None:
if reward.endswith("%"):
p = float(reward[:-1])
if p < 100:
order = aov * 100 / (100 - p) # the order before the discount
discount, share = order - aov, p # discount = AOV x p / (100 - p); a percentage is its own share
else:
discount = float(reward)
order = aov + discount
share = 100 * discount / order
r2 = lambda x: None if x is None else round(x, 2)
return {
"Advocacy rate %": pct(v["Sharers"], v["Impressions"]),
"Sharing rate (ratio)": ratio(v["Shares"], v["Sharers"]),
"Click rate (ratio)": ratio(v["Clicks"], v["Shares"]),
"Visit rate %": pct(visits, v["Clicks"]),
"Conversion rate %": pct(sales, visits),
"Friend referral sales per 1,000 impressions": ratio(1000 * sales, v["Impressions"]),
"Friend referral AOV": r2(aov),
"Order before the discount": r2(order),
"Discount per order": r2(discount),
"Reward share of the order %": r2(share),
}
def account_zone():
"""Set the account's verified IANA time zone; never infer it from one timestamp's offset."""
name = os.environ.get("TALKABLE_ACCOUNT_TIME_ZONE")
try:
return ZoneInfo(name) if name else None
except (ZoneInfoNotFoundError, ValueError):
return None
def timestamp(value):
"""Keep the complete serialized instant; date-only or offset-free values are unknown."""
if not isinstance(value, str) or "T" not in value:
return None
try:
instant = datetime.fromisoformat(value.replace("Z", "+00:00"))
return instant.astimezone(timezone.utc) if instant.utcoffset() is not None else None
except ValueError:
return None
def calendar_window(first_day, last_day):
"""Half-open UTC instants enclosing inclusive account-zone calendar dates."""
zone = account_zone()
lo = datetime.combine(date.fromisoformat(first_day), datetime.min.time(), zone)
hi = datetime.combine(date.fromisoformat(last_day) + timedelta(days=1), datetime.min.time(), zone)
return lo.astimezone(timezone.utc), hi.astimezone(timezone.utc)
def covers(period, first_day, last_day):
"""Every instant of the window must be covered, including the full last day."""
first = timestamp(period.get("starts_at"))
end_value = period.get("ends_at")
last = timestamp(end_value)
if account_zone() is None or first is None or "ends_at" not in period or (end_value is not None and last is None):
return False
lo, hi = calendar_window(first_day, last_day)
return first <= lo and (end_value is None or last >= hi)
def live_dates(camps, ids):
"""Union of exact half-open live intervals; null ends remain unbounded."""
if account_zone() is None:
return []
spans = []
for i in ids:
period = camps.get(i, {}).get("live_period") or {}
first, last = timestamp(period.get("starts_at")), timestamp(period.get("ends_at"))
if first is not None and "ends_at" in period and (period["ends_at"] is None or last is not None):
if last is None or first < last:
spans.append((first, last))
spans.sort(key=lambda span: span[0])
merged = []
for first, last in spans:
if merged and (merged[-1][1] is None or first <= merged[-1][1]):
old_first, old_last = merged[-1]
merged[-1] = (old_first, None if old_last is None or last is None else max(old_last, last))
else:
merged.append((first, last))
return merged
def print_table(cols):
"""cols: list of (label, values); the counts, then the rates, one column per group."""
print("\nBy reward group: all-period reported totals and rates (including tails; not the ranked comparison)")
print(" " + "".ljust(44) + "".join(label[:16].rjust(18) for label, _ in cols))
for term, _ in METRICS:
print(" " + term.ljust(44) + "".join(show(v[term], term).rjust(18) for _, v in cols))
for key in cols[0][1]["rates"]:
print(" " + key.ljust(44) + "".join(show(v["rates"][key], key).rjust(18) for _, v in cols))
def month_bounds(label):
"""'10/1/25 - 10/31/25' -> ('2025-10-01', '2025-10-31'); a day row '12/1/25 - 12/1/25' works too."""
days = []
for part in label.split(" - "):
m, d, y = (int(x) for x in part.strip().split("/"))
days.append(f"{2000 + y if y < 100 else y}-{m:02d}-{d:02d}")
return days[0], days[-1]
def live_in(windows, lo, hi):
"""Does any exact live interval intersect this half-open calendar window?"""
if account_zone() is None:
return False
lo, hi = calendar_window(lo, hi)
return any(first < hi and (last is None or last > lo) for first, last in windows)
def mark_months(label, g, groups, start, end):
"""Mark tails, partial live months and months shared with another reward."""
m, marks = g["months"], {}
for p in m["Impressions"]:
ms, me = month_bounds(p)
if (g["dates_known"] and not live_in(g["live"], ms, me)) or (
not m["Impressions"].get(p) and (m["Visits"].get(p) or m["Friend referral sales"].get(p))):
marks[p] = ["tail"]
continue
tags = []
if account_zone() is not None:
lo, hi = calendar_window(ms, me)
for first, last in g["live"]:
if lo < first < hi:
tags.append("starts")
if last is not None and lo < last < hi:
tags.append("ends")
if live_in(g["live"], ms, me) and any(live_in(o["live"], ms, me) for ol, o in groups if ol != label):
tags.append("mixed")
if tags:
marks[p] = sorted(set(tags))
return marks
def full_months(label, g, groups):
"""Complete, exclusive calendar months when every selected ID was live: no expired-ID tail."""
out = []
if not g["dates_known"] or not all(o["dates_known"] for _, o in groups):
return out
start, end = g["period"]
for p, n in g["months"]["Impressions"].items():
ms, me = month_bounds(p)
# Monthly API labels are clipped to requested dates, not necessarily complete calendar months.
first = date.fromisoformat(ms)
last = first.replace(day=calendar.monthrange(first.year, first.month)[1]).isoformat()
if first.day != 1 or me != last:
continue
alone = not any(live_in(o["live"], ms, me) for ol, o in groups if ol != label)
# A group's interval union can hide an expired ID's tail behind a same-reward replacement.
# Counts still include every selected ID: require each ID, not just their union, to cover the month.
whole = all(covers(period, ms, me) for period in g["campaign_live"])
if n and p not in g["marks"] and alone and whole and start <= ms and me <= end:
out.append(p)
return out
def clean_dates(label, g, groups):
"""Full account-zone days with only this reward live; never bridge gaps."""
if not all(o["dates_known"] for _, o in groups):
return []
spans = list(g["live"])
for ol, o in groups:
if ol == label:
continue
for of, oe in o["live"]:
cut = []
for f, e in spans:
if (oe is not None and oe <= f) or (e is not None and of >= e):
cut.append((f, e))
continue
if f < of:
cut.append((f, of))
if oe is not None and (e is None or oe < e):
cut.append((oe, e))
spans = cut
out, zone = [], account_zone()
for first, last in spans:
local_first = first.astimezone(zone)
f = local_first.date()
if local_first.time() != datetime.min.time():
f += timedelta(days=1) # exclude a partially live first day
e = last.astimezone(zone).date() - timedelta(days=1) if last is not None else None
if e is None or f <= e:
out.append((f.isoformat(), e.isoformat() if e is not None else None))
return out
def print_months(groups):
print("\nBy month and group: impressions / visits / friend referral sales")
periods = list(groups[0][1]["months"]["Impressions"])
print(" " + "month".ljust(22) + "".join(label[:26].rjust(36) for label, _ in groups))
for p in periods:
cells = []
for _, g in groups:
i, vi, s = (g["months"][t].get(p, 0) for t in MONTHLY)
cells.append(f"{i:,} / {vi:,} / {s:,}" + (f" ({', '.join(g['marks'][p])})" if p in g["marks"] else ""))
print(" " + p.ljust(22) + "".join(c.rjust(36) for c in cells))
for label, g in groups:
after = g["after_end"]
if after and after["month"] == p:
print(" " + "".ljust(22) + f"{label}, whole days after expiry {g['live'][-1][1].isoformat()}: "
f"{after['Impressions']:,} / {after['Visits']:,} / {after['Friend referral sales']:,} (tail)")
print(" (tail) = outside known live intervals, or visits or sales with no impressions: earlier links and codes"
"\n still land, so a tail month's conversion is not comparable. (starts) / (ends) = the reward's campaigns"
"\n started or ended that month. (mixed) = another reward was live that month too. A month with any mark is"
"\n not a full month for that reward.")
def compare(groups, start, end):
"""Say which group reads higher on each rate, or why the groups should not be ranked."""
print("\nReading. Talkable's published tests were decided on conversion (friend-reward tests) and advocacy"
"\n (advocate-reward tests). In your own comparison read advocacy first and decide on friend referral sales"
"\n per 1,000 impressions, with the discount per order beside it. Rates less than 10% apart (relative) read as"
"\n the same: a working rule of Talkable's analysts, not a statistical test.")
live = []
print(" Comparison uses complete, exclusive months with impressions and every selected ID live throughout.")
if account_zone() is None:
problem = ("TALKABLE_ACCOUNT_TIME_ZONE is missing; set the verified account IANA zone."
if not os.environ.get("TALKABLE_ACCOUNT_TIME_ZONE") else
"TALKABLE_ACCOUNT_TIME_ZONE is invalid or unresolvable; verify the IANA name and install tzdata "
"in this example's Python environment if the system IANA database is absent.")
print(f" Comparison unavailable: {problem} "
"Serialized offsets alone do not establish calendar-day coverage.")
print(" Full timestamps must cover through next local midnight after the last day; partial expiry days do not qualify.")
print(" Replacement groups without such months are not ranked: grouped counts cannot separate expired-ID tails.")
print(" Reported totals above keep all events, including tails.")
print(" Campaign dates and reward settings are current metadata, not a versioned history; verify past settings.")
print(" Different months are a before-and-after with different seasons, not evidence that reward shape caused a change.")
for label, g in groups:
for first, last in g["live"]:
print(f" {label}: live instants [{first.isoformat()}, {last.isoformat() if last else 'unbounded'})")
eligible = full_months(label, g, groups)
g["eligible"] = eligible
g["comparison"] = dict.fromkeys(RATES)
if not g["active"]:
print(f" {label}: no non-tail impressions established from known dates; counts only, not compared")
continue
if eligible:
v = {t: sum(g["months"][t].get(p, 0) for p in eligible) for t in MONTHLY}
g["comparison"]["Conversion rate %"] = pct(v["Friend referral sales"], v["Visits"])
g["comparison"]["Friend referral sales per 1,000 impressions"] = ratio(
1000 * v["Friend referral sales"], v["Impressions"])
# Sharers and clicks have no monthly split here. Never mix their period totals with adjusted counts.
g["all_eligible"] = (bool(eligible) and set(eligible) == set(g["months"]["Impressions"])
and all(sum(g["months"][t].values()) == g[t] for t in MONTHLY))
if g["all_eligible"]:
for key in ("Advocacy rate %", "Visit rate %"):
g["comparison"][key] = g["rates"][key]
else:
print(f" {label}: advocacy, visit rate and reward-value comparisons unavailable on eligible dates;"
" monthly sharers, clicks and revenue were not fetched.")
print(f" {label}: eligible full months: {', '.join(eligible) or 'none; ranking unavailable'}")
live.append((label, g))
if len(live) == 1:
label, g = live[0]
full = full_months(label, g, groups)
print(f" Only {label} has impressions not marked as tail; eligible full months: {', '.join(full) or 'none'}.")
return
if not live:
return
dated = [(label, span) for label, g in live for span in g["live"]]
for i, (la, (fa, ea)) in enumerate(dated):
for lb, (fb, eb) in dated[i + 1:]:
if la == lb:
continue
window_lo, window_hi = calendar_window(start, end)
lo, hi = max(fa, fb, window_lo), min(ea or window_hi, eb or window_hi, window_hi)
if lo < hi:
print(f" {la} and {lb}: live instants overlap [{lo.isoformat()}, {hi.isoformat()}); both ran then")
kinds = {g["reward"].endswith("%") for _, g in live if g["reward"]}
shares = [g["rates"]["Reward share of the order %"] for _, g in live if g["rates"]["Reward share of the order %"]]
if len(kinds) == 1 and all(g["reward"] for _, g in live):
print(" Every group has the same shape (all fixed amounts or all percentages): this compares size, not shape.")
if all(g["all_eligible"] for _, g in live) and len(shares) > 1 and (max(shares) - min(shares)) / min(shares) >= SAME:
listed = ", ".join(f"{l} {show(g['rates']['Reward share of the order %'], '%')}%" for l, g in live)
print(f" The rewards differ in value on the order before the discount ({listed}).")
mixed = sorted({p for _, g in live for p, tags in g["marks"].items() if "mixed" in tags}, key=lambda p: month_bounds(p))
partial = sorted({p for _, g in live for p, tags in g["marks"].items() if {"starts", "ends"} & set(tags)}
- set(mixed), key=lambda p: month_bounds(p))
ranked = not mixed and not partial and all(g["eligible"] for _, g in live)
if mixed:
print(f" Switch months (two rewards live in the same month, mixed for both): {', '.join(mixed)}")
if partial:
print(f" Part months (a reward started or ended, no other reward live): {', '.join(partial)}")
if not ranked:
print(" So the rates below are listed, not ranked. Compare each reward on its own clean dates:")
for label, g in live:
spans = "; ".join(f"{f} -> {e or 'still live'}" for f, e in clean_dates(label, g, groups)) or "unknown dates"
full = full_months(label, g, groups)
print(f" {label}: only this reward live {spans}; full months in this period: {', '.join(full) or 'none'}")
print(" Two clean stretches in different months are a before-and-after: say that the seasons differ.")
for key in RATES:
have = [(label, g["comparison"][key]) for label, g in live if g["comparison"][key] is not None]
if len(have) != len(live):
print(f" {key}: ranking unavailable; eligible values missing")
continue
hi, lo = max(have, key=lambda x: x[1]), min(have, key=lambda x: x[1])
listed = ", ".join(f"{l} {show(x, key)}" for l, x in have)
if not ranked:
print(f" {key}: {listed}")
elif lo[1] == 0:
unit = "percentage points" if key.endswith("%") else "sales per 1,000 impressions"
print(f" {key}: {listed}; gap {hi[1] - lo[1]:.2f} {unit}; relative change undefined at zero")
elif (hi[1] - lo[1]) / lo[1] < SAME:
print(f" {key}: the same across groups ({listed})")
else:
print(f" {key}: highest in {hi[0]} ({show(hi[1], key)}), lowest in {lo[0]} ({show(lo[1], key)})")
def main(args):
# Keep IDs as keys; requested IDs absent from the response remain explicitly unverified.
camps = {c["id"]: c for c in get("campaigns")["campaigns"]}
if args == ["--campaigns"]:
print(f"Campaigns on {SITE}: id, status, placement (appearance), live dates, tags, name")
for c in camps.values():
p = c.get("live_period") or {}
dates = f"{p.get('starts_at') or '?'}..{p.get('ends_at') or 'unbounded/unknown'}"
print(f" {c['id']:>10} {c['status']:<9} {c['appearance']:<7} {dates:<22} "
f"{','.join(c['tag_names'])[:36]:<37} {c['name']}")
return
start, end = iso(args[0]), iso(args[1])
parsed = [parse_group(arg) for arg in args[2:]]
labels = [label for label, _, _ in parsed]
if any(not label for label in labels) or len(set(labels)) != len(labels):
sys.exit("reward groups need distinct nonblank labels; duplicate labels would hide overlapping rewards")
groups, seen = [], set()
for label, reward, ids in parsed:
if seen & set(ids):
sys.exit(f"{label}: campaigns {sorted(seen & set(ids))} are already in another group")
seen |= set(ids)
tests = [i for i in ids if camps.get(i, {}).get("status") == "Test"]
ids = [i for i in ids if i not in tests]
if tests:
print(f"{label}: campaigns with status Test moved to the Test row: {', '.join(map(str, tests))}")
unknown = [i for i in ids if i not in camps]
if unknown:
print(f"{label}: status not checked (absent from the campaign list), make sure none is a Test campaign: "
f"{', '.join(map(str, unknown))}")
if not ids:
sys.exit(f"{label}: no campaigns left to read")
g = pull(start, end, ids)
g["ids"], g["reward"], g["live"] = ids, reward, live_dates(camps, ids)
g["campaign_live"] = [camps.get(i, {}).get("live_period") or {} for i in ids]
g["dates_known"] = account_zone() is not None and all(
timestamp(p.get("starts_at")) is not None and
"ends_at" in p and (p["ends_at"] is None or timestamp(p["ends_at"]) is not None)
for p in g["campaign_live"])
g["period"] = (start, end)
g["rates"], g["months"] = rates(g, reward), by_period(start, end, ids)
groups.append((label, g))
for label, g in groups:
g["marks"] = mark_months(label, g, groups, start, end)
g["active"] = any(n for p, n in g["months"]["Impressions"].items() if "tail" not in g["marks"].get(p, []))
g["after_end"] = None
last = g["live"][-1][1] if g["live"] else None
end_day = last.astimezone(account_zone()).date().isoformat() if last and account_zone() else None
if g["dates_known"] and g["active"] and end_day and start <= end_day <= end:
p = next((p for p in g["months"]["Impressions"]
if month_bounds(p)[0] <= end_day <= month_bounds(p)[1]), None)
if p is not None:
ms, me = month_bounds(p)
days = by_period(max(ms, start), min(me, end), g["ids"], "day")
# A midnight expiry includes that day's entire tail. A partial expiry day is not separable.
g["after_end"] = {t: sum(v for d, v in days[t].items()
if calendar_window(*month_bounds(d))[0] >= last) for t in MONTHLY}
g["after_end"]["month"] = p
if not g["active"]: # tail only: counts, no rates or values of a live reward
for key in g["rates"]:
g["rates"][key] = None
total, test = pull(start, end), pull(start, end, status="Test")
total["rates"], test["rates"] = rates(total), rates(test)
other = {term: round(total[term] - test[term] - sum(g[term] for _, g in groups), 2) for term, _ in METRICS}
other["rates"] = rates(other)
print(f"Friend rewards on {SITE}, {start} -> {end} (money in the site's reporting currency, {total['currency']})")
cols = groups + ([("Test campaigns", test)] if any(test[t] for t, _ in METRICS) else [])
cols += ([("Other campaigns", other)] if any(other[t] for t, _ in METRICS) else []) + [("Total", total)]
print_table(cols)
print_months(groups)
compare(groups, start, end)
if __name__ == "__main__":
ARGS = sys.argv[1:]
if ARGS != ["--campaigns"] and len(ARGS) < 3:
sys.exit('usage: python3 reward_shapes.py --campaigns\n'
' python3 reward_shapes.py START END "label:reward=id,id" ["label:reward=id,id" ...]')
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 columns and the segmentation Incentive combinations. - Set the same filters. The same start and end dates; the same campaigns as one HTTP group, 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 covers the same campaigns: a campaign that carries the reward but sits outside your group is in the incentive-combination row and not in the group;
- whether its other filters match;
- whether you compared the ideal-sales columns (# Ideal FR sales, $ Ideal FR sales) and not $ Dashboard sales, which is set per site;
- whether both were pulled the same day: a referral's status can change after the fact (a refund voids a pending referral), and sharers can grow;
- a gap of about 1–2% on every count: compare with the report's precision mode.
Troubleshooting
- “No metric found.” (HTTP 400)
Why: the identifier is not one the API knows.
Fix: impressions areadvocate_impressions, friend referral revenue isideal_friend_sales_sum;impressionsandfriend_revenueare not identifiers. - “`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 as 30/9/2026 are invalid.
Fix: send2026-09-30. - “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, 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; if it repeats on a long period, run one quarter at a time.
Check: for two groups the script makes 35 calls: the campaign list, seven metrics for each group, for the site total and for the campaigns with status Test, and three month splits per group; three more for a reward whose campaigns end inside the period. It waits 5, 10, 20 and 40 seconds between attempts, then stops with the error. - “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). - A reward row with visits and sales but no impressions
Why: the old reward's tail: earlier links and codes still land after the reward stopped showing.
Fix: mark months outside the old reward's live intervals, even one with a stray impression, and whole daily rows starting at or after expiry in its month; a midday expiry's partial day cannot be separated. Compare full months with impressions (the old reward's tail). - The reward groups do not add up to the site total
Why: a campaign that carries a reward sits in no group, for example a hidden email campaign or a copy on another placement.
Fix: the script prints the difference as “Other campaigns”; add each such campaign to its group.
Through MCP: thetotalof an incentive-combination split is the sum of its rows: take the site total from a call withoutsegment_byand show the difference as its own row. A negative difference (seen on sharers) means one offer was counted under more than one pair: report it as overlap. - Which reward does a campaign carry?
Why: the campaign list and the metrics give ids, names, tags and dates; the reward lives on the campaign's incentive.
Fix: read it in the Talkable admin campaign settings or with the MCP toollist_incentives(the coupon list's amount, andpercentage_discountfor the shape), or ask the store. Do not infer it from a tag or a name. - A “Test campaigns” row
Why: campaigns with status Test still count in the site total. They are not the test traffic that the metrics leave out by default.
Fix: nothing to fix. The script leaves them out of the reward groups and shows them as their own row, so the table ties to the total. - “status not checked (absent from the campaign list)”
Why: the requested ID was absent from the campaign response, so its status and live dates are unverified. This does not establish a response cap or explain why it was absent.
Fix: verify the IDs, status and live dates in the Talkable admin and leave out any with status Test. Save verified settings when a reward changes; current metadata cannot prove past settings. - 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.
Fix: add a row “Other campaigns (no type)” = total − sum of the rows. - “`campaign_ids` contains non-existent ID.” (HTTP 400)
Why: an id is not a campaign of this site, for example the 101 and 102 of the examples above.
Fix: take the numeric ids from request 1 (GET /api/v2/campaigns) or the campaign's admin URL. - 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 and rewards needs the Read role or higher (permissions).
- “MCP is disabled for this site…”: the Talkable MCP server (
Go further
- Each reward by placement. MCP
"segment_by": ["incentive_combinations", "campaign_types"]; through HTTP,segment_by[campaign_types]=truewith thecampaign_ids[]of one group. - A running A/B test of two rewards. Through the Talkable MCP server,
"segment_by": ["split_test"]with the test'ssplit_test_key(keys fromlist_split_tests) returns one row per variant; end the period on the day the winner was selected. In the Talkable admin, the Metrics Aggregation Report segments by A/B test. - Revenue net of refunds. MCP
exclude_refunded: trueleaves refunded orders out of the money metrics per reward. - Rows, not totals. Which friends used a code, and the order behind each referred purchase, come from the exportable reports (reports and exports): Purchases, Referrals and Incentive Outcomes. In the Talkable admin they download as CSV. From an agent, the MCP tools
list_grid_reports,schedule_grid_exportandget_grid_exportschedule and fetch the same files.
Methodology
- Figures
- Talkable benchmark data: each program's figure first, then the median and the typical range (25th to 75th percentile). Cells under five programs are not published; no program is named.
- Populations
- Cross-section: 174 programs with at least 1,000 impressions and 100 visits, January 2025 – June 2026. Tests: created 2014 – August 2026, each variant with at least 700 impressions (advocate-reward tests) or 100 visits (friend-reward tests).
- Cases and practice
- Single-program cases give a direction and a period. Practice is what Talkable's analysts advise.
- Code
- The requests and the script were run on a live Talkable site; REST and MCP agree.
FAQ
Should a referral friend reward be a dollar amount or a percentage?
Neither wins: in Talkable's same-site A/B tests, at the values each program chose, a fixed amount beat a percentage in 4 of 7 friend-reward tests (Talkable benchmark data, 7 programs, 2014 – August 2026). Compare them at equal value.
How do you compare a percentage referral discount with a fixed amount?
On the order before the discount. Talkable records friend referral AOV after it, so that order is AOV + amount, or AOV ÷ (1 − percentage). At a $100 AOV, 20% off was $25 off a $125 order; $20 off is $20.
What is a typical friend referral reward?
Both shapes are common: 84 of 174 Talkable programs pay friends a fixed amount, median $20 to $25 (typical range $10–$40), and 77 a percentage, median 20% (15–25%). Talkable benchmark data, January 2025 – June 2026.
Should the friend referral reward match the advocate reward?
Usually it does: the two values are equal in 93 of 114 same-shape programs (Talkable benchmark data, January 2025 – June 2026). For more sharers, raise the friend reward first: it lifted advocacy in 17 of 18 programs in A/B tests.
Does a free product work as a referral reward?
In Talkable's read of beauty programs (29 screened, history to 2022), a free gift came with more friend clicks and visits than a credit discount but converted less well. Single programs have seen the opposite, so test it.
How do I compare my friend referral rewards from the Talkable API?
Call GET https://www.talkable.com/api/v2/metrics/{metric} with site_slug, start_date, end_date and campaign_ids[] for the campaigns carrying one reward, per metric and group. Through the MCP server, calculate_metric with segment_by ["incentive_combinations"].
Learn more
In the Talkable documentation:
| Coupons | Single-use and multi-use coupons, the codes that carry a fixed amount or a percentage |
| Incentive criteria | The conditions under which a friend or advocate reward is issued |
| Referral tracking methods | How a friend's purchase is matched to an advocate: each tracking method, in priority order |
| Referrals approval | Pending, approved and voided referrals, and when rewards are issued |
| Talkable MCP server | Connect Claude Code, ChatGPT, Cursor or any MCP client |
| Talkable API | Authentication, response format, errors and throttling |
