
Referral Share-to-Purchase Time
In short
At the median Talkable program, half of the friend referral sales come within 2 days of the share, and the typical range across programs is 1 to 7 days (Talkable benchmark data, 185 programs, 2023–2025). The median program's average lag is about 20 days: a few very late purchases pull the average up.
Why it matters
In Talkable, three settings depend on how fast referred friends buy: the attribution window, how long the friend offer stays claimable, and when a friend gets a reminder.
Read from an average, that speed looks like weeks. Read from the median, the friend who buys decides within a day or two. The attribution window runs on a different clock from this lag, so the window is never set from it (the two clocks).
Start with your own median on a closed quarter (how to calculate it).
Two clocks: share-to-purchase time and friend timing
Two different numbers are both called “time to purchase”. They start at different moments, and Talkable uses each for a different job.
Talkable measures share-to-purchase time (the lag) as the number of calendar days from the advocate's share to the friend referral sale it produced. It describes how fast friends decide, and it is the subject of this page. The advocate is the customer who shares; the friend is the person they refer.
share-to-purchase time = date of the friend referral sale − date of the share that produced it
Friend timing is the time from the friend's last interaction with the program to the purchase. Talkable takes the latest of three moments: the share being created, the friend opening the share email, and the friend's last click.
The attribution window is the friend timing within which a matched purchase still counts as a friend referral sale. It is set per tracking method, from 1 to 365 days, 30 by default.
Coupon-tracked purchases are exempt from the window. When the friend pays with the single-use coupon from the friend offer, or with the advocate's personal coupon, the code proves the referral whenever it is used.
A friend referral sale is a friend purchase that Talkable matched to an advocate's offer by a tracking method, inside that method's attribution window (coupon-tracked purchases exempt), not blocked and not voided. Talkable calls it an ideal friend sale. The lag is measured on these sales only.
The median and the average answer different questions. The median lag is the lag of the middle purchase when all are sorted: half the friends were faster. The average adds every lag and divides by the count, so a few purchases a year late move it by weeks.
| Day: what happens | Share-to-purchase time, counted from the share | Friend timing, counted from the friend's last interaction |
|---|---|---|
| Day 0: the advocate shares by email | starts | starts |
| Day 20: the friend opens the email, clicks and visits the store | keeps running | starts again: the last interaction is now day 20 |
| Day 23: the friend buys | 23 days | 3 days |
For one order the two clocks can differ by a year. A friend who ignores a referral email, opens it twelve months later and buys within the hour has a share-to-purchase time of 365 days and a friend timing of 0 days. Talkable counts the sale, because the window runs from the friend's last interaction.
That is why a program's average lag reads in weeks while its median reads in days. It is also why the window is never set from share-to-purchase time, median or average: the window runs on the other clock.
A worked example
Round numbers chosen to show the arithmetic; they match no program. One program, 100 friend referral sales a month.
| Month: what happened | Median lag of the month's 100 sales | Average lag of the month's 100 sales |
|---|---|---|
| Month 1: 95 friends buy 1 day after the share; 5 buy 365 days after | 1 day | 19.2 days |
| Month 2: 90 friends buy 1 day after the share; 10 buy 365 days after, from last year's holiday shares | 1 day | 37.4 days |
| Month 3: 95 friends buy 3 days after the share; 5 buy 365 days after | 3 days | 21.1 days |
The average lag, computed as:
- month 1: (95 × 1 + 5 × 365) ÷ 100 = 19.2
- month 2: (90 × 1 + 10 × 365) ÷ 100 = 37.4
- month 3: (95 × 3 + 5 × 365) ÷ 100 = 21.1
Month 2 is the trap. The average nearly doubles, from 19.2 to 37.4 days, while the median stays at 1 day. Nothing changed in how friends decide: a few old shares matured.
Month 3 is a real change. The typical friend now takes 3 days instead of 1, yet the average falls from 37.4 to 21.1 days. The average gets both months wrong: it rose when nothing changed, and it fell when friends slowed down. The median moves only when friends do, which is why Talkable reads the median first.
What the data says: how long referred friends take to buy
Talkable computes each program's median and average lag first, then reads the spread across programs, so the largest programs do not decide the answer. Only friend referral sales are counted.
| Across the 185 programs | Days from share to purchase | Reads as |
|---|---|---|
| Median program's median lag | 2 | At the typical program, half of the friend referral sales come within 2 days of the share |
| Typical range of program medians | 1–7 | The middle half of programs |
| Nine programs in ten have a median lag of at most | 14 | Two weeks covers almost every program's typical friend |
| Median program's average lag | 20 | The same programs, read on the average |
| Typical range of program averages | 9–43 | Averages spread far wider than medians: the size of the tail differs from program to program |
Share-to-purchase time in days, computed for each program first, then read across programs. Talkable benchmark data, 185 programs, friend referral sales 2023–2025; typical range = 25th to 75th percentile of programs.
As a percentage of the 185 programs, the median lag is:
- one day or less: 46%;
- a week or less: 78%;
- 30 days or less: 97%.
Read on the average instead, 63% of the same programs come in at 30 days or less, against 97% on the median.
By industry: the centers agree, the tails do not
The last column is Talkable's published benchmark, the typical range of program averages. The middle column holds the medians of the same programs.
| Industry (number of programs) | Median lag in days: median program (typical range of programs) | Average lag in days: Talkable benchmark, typical range of programs |
|---|---|---|
| Apparel (45) | 3 (1–7) | 12–52 |
| Furniture & Home Goods (29) | 1 (1–4) | 12–50 |
| Health & Wellness (23) | 1 (0–2.5) | 6–21 |
| Beauty & Cosmetics (17) | 1 (1–5) | 9–32 |
| Education (13) | 6 (2–16) | 13–31 |
| Food & Beverage (12) | 1 (0–4) | 11–33 |
| Luxury & Jewelry (11) | 2 (0.5–17) | 31–47 |
| Accessories (10) | 2 (1.2–4.5) | 12–35 |
| Recreation & Hobby (7) | 1 (median only) | 8–25 |
Share-to-purchase time in days, computed for each program first, then read across the programs of each industry (their number in brackets). Talkable benchmark data, friend referral sales 2023–2025; the industries of the published benchmark, the last column as published.
Why the centers agree. The typical friend buys fast in almost every industry: the median column reads 1 to 3 days in eight of the nine. Education is the exception at 6 days.
Why the tails differ. Luxury, apparel and furniture carry buyers who arrive weeks after the share, and the averages pick them up. Luxury & Jewelry's typical range of averages starts at 31 days, while its median program sits at 2.
Compare like with like. Read your median against the median column and your average against the published range of averages. A median read against a range of averages looks much faster than the industry, and it compares two different statistics.
How soon customers share after buying
The post-purchase placement shows the program right after checkout, so many advocates buy first and share second. Talkable measures the gap from the advocate's latest earlier order to the first share; a share stamped at the same moment as the order counts as zero.
The gap splits in two. Across 60 programs that send purchase data, each with at least 30 sharers who had bought before (Talkable benchmark data, shares January 2025 – June 2026):
- at 26 programs, half of these sharers share within 10 minutes of buying;
- at 31 programs (those 26 included), half share within a day;
- at the other 29, half take longer than a day.
With two groups this far apart, no single cross-program median describes the gap: the typical range of program medians runs from under a minute to 16 days.
The table takes each program's sharers who had bought before and shows what percent of them shared within each time after the purchase, at the median program.
| Time after the purchase | Sharers who had bought before and shared within this time (median program) |
|---|---|
| Within 10 minutes | 46% |
| Within 1 day | 55% |
| Within 7 days | 62% |
| Within 30 days | 76% |
| Average time from the purchase to the share | 49 days |
Each program's sharers who had bought before, timed from their latest earlier purchase to their first share; median program. Talkable benchmark data, 60 programs, shares January 2025 – June 2026.
The 49-day average comes from a minority who share much later.
Not every advocate buys first. At the median program, 27% of the advocates who have ever shared did so before any purchase the program has on record (typical range 13–43%; Talkable benchmark data, 66 programs that send purchase data, each program's full history to August 2026).
At the median program, 14.6% of top advocates (three or more approved referrals) who have made a purchase shared before their first purchase (typical range 7.8–22.9%; Talkable benchmark data, 136 programs, referrals January 2024 – June 2026). Advocates who never bought are not in this base, so it does not compare with the 27% above.
Deep dive: how the time to purchase differs between programs
Talkable measures the time the same way for every program; the result differs from program to program. This section has three parts:
- by order value and program size: the same programs, grouped two ways;
- from share to click: the first of the two steps of the time;
- what an attribution window captures: how much referral revenue a window of each length holds.
Every figure is Talkable benchmark data, computed per program, with the program count and period beside it.
By order value and program size: the median edges up with order value, the tail grows with size
The same 185 programs, grouped two separate ways. Each program falls in one band of each:
- by order value: Talkable averages the order value of the program's friend referral sales over 2023–2025, and that average decides the band;
- by program size: the number of friend referral sales the program had over the same period.
| Band (number of programs) | Median lag in days, median program in the band | Average lag in days, median program in the band |
|---|---|---|
| Programs whose friends spend under $50 per order on average (26) | 1 | 19.5 |
| Programs whose friends spend $50 to $100 per order on average (49) | 2 | 14 |
| Programs whose friends spend $100 to $200 per order on average (49) | 2 | 21 |
| Programs whose friends spend $200 or more per order on average (61) | 3 | 23 |
| Programs with under 500 friend referral sales (44) | 1 | 12.5 |
| Programs with 500 to 2,000 friend referral sales (72) | 2 | 18 |
| Programs with 2,000 to 10,000 friend referral sales (40) | 2 | 26.5 |
| Programs with 10,000 or more friend referral sales (29) | 8 | 44 |
Share-to-purchase time in days for the median program in each band. Talkable benchmark data, 185 programs, friend referral sales 2023–2025; order values in US dollars.
Why the order-value effect is small at the center. One day under $50 against three days at $200 or more: a higher price buys the friend a day or two more deliberation.
Why size shows in the tail. The largest programs' median is 8 days and their average 44, the slowest of any band.
Why neither predicts one program. Program by program the link is weak, a rank correlation of about 0.2 for both, so read a band as context; it does not forecast one program.
For example, ask the Talkable AI Assistant: “Show my friend referral sales, friend referral revenue and friend referral AOV for January 1, 2023 – December 31, 2025.”
Where the time goes: from share to click
The lag has two legs: share to click, then click to purchase. Talkable times each click from the latest earlier share of the same offer, up to 180 days later. The table shows what percent of a program's friend clicks come within each time of the share: at the median program, and the typical range across programs.
| Time after the share | Clicks within this time of the share (median program) | Typical range across programs |
|---|---|---|
| Within 1 day | 61% | 46–69% |
| Within 5 days | 72% | 58–80% |
| Within 30 days | 88% | 78–92% |
| Within 60 days | 93% | 86–96% |
| Within 90 days | 96% | 92–98% |
Of each program's friend clicks within 180 days of the share, the percent within each time; median program and typical range (25th to 75th percentile). Talkable benchmark data, 81 programs with at least 100 friend clicks, shares January 2025 – June 2026.
Why the first day matters most. At the median program 61% of clicks arrive within a day of the share (81 programs), and half of the friend referral sales within two days (185 programs, 2023–2025). The friend who buys acts fast on both legs.
For example, ask the Talkable AI Assistant: “Show my shares, clicks and visits by week for July 1 – September 30, 2026.”
What an attribution window captures
This section uses the other clock, friend timing. Take all the revenue a program matched to referrals, at any timing, and see how much of it falls inside an attribution window of each length, counted from the friend's last interaction. The chart and the table show that percent at the median program and across the typical range.
| Window length, counted from the friend's last interaction | Percent of all referral-matched revenue inside the window (median program) | Typical range across programs |
|---|---|---|
| 30 days | 59% | 37–79% |
| 60 days | 67% | 43–85% |
| 90 days | 71% | 47–87% |
| 120 days | 74% | 50–91% |
| 180 days | 81% | 58–94% |
| 365 days | 90% | 73–99% |
Of all the revenue each program matched to referrals, at any timing, the percent inside a window of each length; median program and typical range (25th to 75th percentile). Talkable benchmark data, 192 programs on a 30-day window, history to April 2024.
Why the curve flattens. Thirty days holds a median 59%, and each further month adds a few points. Talkable's analysts read the purchases far beyond the window as repeat buying by customers who were once referred, not purchases a share caused.
Why the base matters. The base is all the revenue a program matched to a referral, inside and outside the window. The percentages above are percentages of that base.
For example, ask the Talkable AI Assistant: “Compare my friend referral sales with my friend purchases of any timing that were not voided, by month for January 1 – September 30, 2026.”
Reading your number
- Lead with the median and the early-purchase percentages. Report the median lag and the percent of friend referral sales made within 0, 1, 7, 30 and 90 days of the share. Give the average only as the size of the tail.
- Compare on the same basis. Your median against the typical range of program medians (1–7 days); your average against your industry's published range of averages.
- Split by tracking method before comparing periods. A coupon is used at checkout, so the purchase and the proof of the referral happen together. If the reward mechanism changed between two periods, the mix of methods changed with it.
- Read a move in the median as the signal. A rising average with a steady median is old shares maturing. A rising median is friends deciding more slowly: look first at what changed on the claim page and in the friend reward.
- Use a closed period and one pull. Counted by purchase date, a closed period already holds all its sales; only statuses can still change (a full refund voids a pending referral). Pull the export and the metrics on the same day.
- Never pool stores. If you run several stores, compute each store's median and compare the medians.
- Re-check the window every six to nine months. Talkable's analysts run this check on friend timing, and your Customer Success Manager can run it for your program. It is a working rule they apply; practice, not a statistical test. Of the referral-matched friend purchases within 180 days of the friend's last interaction:
- 80–90% in the first 30 days: 30 days fits;
- only about 30–70%: a longer window likely makes sense.
- Industry practice for the window. For some industries Talkable's analysts apply a longer window. These are working rules (February 2026); practice, not a statistical test:
- 90 days: jewelry and education;
- 60 days: food and beverage, and apparel with an average order under $150;
- 30 days: everything else.
Calculate it for your own program
The weekly counts this section uses (shares, clicks, visits and the two sales counts) come from Talkable, one call per metric. The result matches the Metrics Aggregation Report in the Talkable admin when you set the same period, campaigns and filters.
The lag itself is a row-level number. The Talkable Referrals report carries both ends of the lag on each row that came from a share: the share time and the referral's date. One export and the Python script below give the distribution. There are three ways to get the counts:
- 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 |
|---|---|---|---|
| Shares | shares | Shares | number |
| Clicks | clicks | Offer Clicks | number |
| Visits | visits | Site Visits | number |
| Friend referral sales | ideal_friend_sales_count | # Ideal FR sales | number |
| Friend purchases of any timing | talkable_sales_count | # Talkable Sales not voided | number: matched friend purchases at any timing, with no attribution window, in every referral status except voided and in progress |
| Share-to-purchase time | Referrals report columns “Shared at” and “Date age” | Referrals report (export), one row per referral | calendar days per friend referral sale |
How a call works
- One metric:
GET https://www.talkable.com/api/v2/metrics/{metric}withsite_slug,start_dateandend_date. - A split (by week or month): add
/segmentizeto the same path. - The answer: one value as
{"plain": …, "formatted": "…", "result_type": …}. A split returns{"segmented": [ … ]}, one value per row with itsperiodlabel. - Precision: the counts here are whole numbers; percents come back with two decimals and ratios with four.
- Money comes back in the site's reporting currency; no money metric is needed for the lag.
- Through the Talkable MCP server the tool is
calculate_metric: the same identifiers, several metrics in one call. - The Referrals report downloads as CSV from the Talkable admin (Referrals → export). It arrives by email, password-protected by default. From an agent, the MCP tools
list_grid_reports,schedule_grid_exportandget_grid_exportschedule and read the same file (gridReferralsGrid).
API reference: Talkable API documentation.
Filters and segmentations for this question
| Parameter | Values | Use it to |
|---|---|---|
start_date, end_date | YYYY-MM-DD, e.g. 2026-07-01 (REST also takes M/D/YYYY); both days included; days run in the account time zone | Set the period |
segment_by[period] | day, week, month, quarter, year; up to 1,000 rows per request. REST weeks run Sunday to Saturday (7/5/26 - 7/11/26) | See shares and sales drift against each other week by week |
campaign_ids[], sharing_channels[] | ids from GET /api/v2/campaigns; channel identifiers | One campaign or one sharing channel |
exclude_qa_generated | default true | Test traffic is already out of the activity metrics; sales metrics always leave it out |
MCP calculate_metric adds | segment_by: date_range with aggregate_period (day, week, month), campaigns, sharing_channels; exclude_refunded. Filters are named exclude_qa, campaign_ids, sharing_channel_ids; dates go in period_start / period_end. MCP weeks start on Monday | Several metrics per call from an agent |
| Referrals report filters | created_at as 2026-07-01..2026-09-30 with created_at_period_type custom; ideal (YES / NO); status; qa_generated; friend_event_category; sharing_channels; track_method | Export the period's referrals; split the export by tracking method or sharing channel |
track_method values | coupon, personal_coupon, cookie, web_cookie, gated_email, phone_number, share_email, ip_address, sticky_advocate, event_chain, invite_code, manually_generated, force_generated | Export coupon-tracked referrals (coupon, personal_coupon) apart from the rest |
Examples in four tabs
The same analysis four ways: ask in plain language, call the Talkable MCP server, send the HTTP request, 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:
Show my shares, clicks, visits and friend referral sales by week for July 1 – September 30, 2026, next to my friend purchases of any timing that were not voided.
The Assistant returns the weekly counts. The lag itself comes from the Referrals export (MCP and Python tabs).
Your own agent (OpenClaw, Claude Code or any other agent)
Your agent does not know how Talkable defines the two clocks. Send it the same sentence and use the method in this report:
Show my shares, clicks, visits and friend referral sales by week for July 1 – September 30, 2026, next to my friend purchases of any timing that were not voided. Use the method in this report: https://get.talkable.com/analytics/share-to-purchase-time
The agent also needs your API key or a connection to the Talkable MCP server.
Talkable MCP server, tools calculate_metric, list_grid_reports, schedule_grid_export, get_grid_export
To connect your agent (endpoint, credentials, client set-up), see the Talkable MCP server documentation. The in-period counts, five metrics by week in one call:
{
"site_slug": "your-site",
"metrics": ["shares", "clicks", "visits", "ideal_friend_sales_count", "talkable_sales_count"],
"period_type": "custom",
"period_start": "2026-07-01",
"period_end": "2026-09-30",
"segment_by": ["date_range"],
"aggregate_period": "week"
}
- Each metric comes back with one
date_range=YYYY-MM-DDkey per week and atotal. The first row starts on the period's first day; later rows start on Mondays. - The response also carries a
metrics_aggregation_url, a Talkable admin path that opens the same numbers in the Metrics Aggregation Report. - Period totals: drop
segment_by.
The lag comes from the Referrals report: confirm the grid and its filters, schedule the export once, then poll it.
// list_grid_reports
{"site_slug": "your-site", "search": "Referrals"}
// schedule_grid_export: call it once; only send_email: true builds the whole file
{
"site_slug": "your-site",
"grid_class": "ReferralsGrid",
"filters": {"created_at": "2026-07-01..2026-09-30", "created_at_period_type": "custom"},
"send_email": true
}
// get_grid_export: poll with the returned id; when the status is "completed", read the rows in chunks
{"site_slug": "your-site", "grid_export_id": 123456, "preview_rows": 100, "offset": 0}
- Use custom dates as above: the preset
last quarteris a rolling window (on 2026-10-26 it meant July 26 – October 25), not the calendar quarter. - Pass each reply's
preview.next_offsetback asoffsetuntil it is null. - Every
schedule_grid_exportcall starts another export, so poll instead of calling it again. - Reading metrics and polling an export need the Read role; scheduling an export needs the Write role and a key with
mcp:write(permissions).
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.
# friend referral sales, one period
curl -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-07-01&end_date=2026-09-30"
# -> {"ok":true,"result":{"plain":300,"formatted":"300","result_type":"number"}}
# friend purchases of any timing, the same period
curl -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/talkable_sales_count?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30"
# -> {"ok":true,"result":{"plain":420,"formatted":"420","result_type":"number"}}
# shares by week (repeat for clicks, visits and the two sales counts)
curl -g -H "Authorization: Bearer $TALKABLE_API_KEY" \
"https://www.talkable.com/api/v2/metrics/shares/segmentize?site_slug=$TALKABLE_SITE_SLUG&start_date=2026-07-01&end_date=2026-09-30&segment_by[period]=week"
# -> {"ok":true,"result":{"segmented":[
# {"plain":120,"formatted":"120","result_type":"number","period":"7/1/26 - 7/4/26"},
# {"plain":280,"formatted":"280","result_type":"number","period":"7/5/26 - 7/11/26"},
# {"plain":275,"formatted":"275","result_type":"number","period":"7/12/26 - 7/18/26"}, ...]}}
- The
-gflag stops curl from interpreting the square brackets insegment_by[…]. - An error comes back as
{"ok":false,"error_message":"…"}, for exampleNo metric found.for an unknown identifier. - The lag needs the Referrals export: download it from the Talkable admin or through the MCP tools (see the MCP tab), then run the script with
--referrals.
Python: the full script
Prints the weekly counts, then, given a Referrals export, the lag of every friend referral sale: median, typical range, average and the share within 0, 1, 7, 30 and 90 days, overall and by sharing channel, with the reason each left-out row was left out. Needs Python 3 and requests (pip install requests); reads the key from TALKABLE_API_KEY and TALKABLE_SITE_SLUG.
"""Share-to-purchase time for one Talkable site: in-period counts by week, then the lag distribution.
Part 1 (Talkable metrics API): shares, clicks, visits, friend referral sales and friend purchases of
any timing for the period, in total and by week.
Part 2 (optional): the share-to-purchase lag of every friend referral sale in a Referrals report export,
which carries both ends of the lag on each row ("Shared at" and the referral's date, "Date age").
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 share_to_purchase.py 2026-07-01 2026-09-30
python3 share_to_purchase.py 2026-07-01 2026-09-30 --referrals referrals.csv
Dates are YYYY-MM-DD (M/D/YYYY also accepted), both days included, in the account time zone. The export:
Talkable admin -> Referrals, the same period, default columns (unzip the emailed file), or the MCP tools
schedule_grid_export / get_grid_export with grid ReferralsGrid. Lag = calendar days from "Shared at" to
"Date age", as written in the export; friend referral sales only (Ideal = yes, Status not blocked or
voided, Qa generated = no, purchases). Days and percents to 1 decimal; "n/a" for a group with no rows.
"""
import csv
import os
import statistics
import sys
import time
from datetime import datetime
import requests
API = "https://www.talkable.com/api/v2"
METRICS = [ # short label -> API metric identifier
("Shares", "shares"),
("Clicks", "clicks"),
("Visits", "visits"),
("Friend sales", "ideal_friend_sales_count"), # friend referral sales
("Any timing", "talkable_sales_count"), # matched friend purchases, not voided or in progress, no window
]
WITHIN = [0, 1, 7, 30, 90] # calendar days after the share
YES = {"yes", "true", "1", "y"}
TIME_FORMATS = ["%Y-%m-%d %H:%M:%S %z", "%Y-%m-%d %H:%M:%S", "%Y-%m-%d %H:%M", "%Y-%m-%d",
"%m/%d/%Y %H:%M:%S", "%m/%d/%Y %H:%M", "%m/%d/%Y"]
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 budget spent
time.sleep(5 * 2 ** attempt) # 5, 10, 20, 40 s
continue
try:
body = r.json()
except ValueError:
body = {}
if body.get("ok") is False: # e.g. 400 "No metric found.", 422 over 1,000 segmentation rows
raise RuntimeError(f"{path}: HTTP {r.status_code}: {body.get('error_message')}")
r.raise_for_status()
return body["result"]
def in_period(start, end):
total = {label: get(f"metrics/{m}", start_date=start, end_date=end)["plain"] for label, m in METRICS}
weeks = {}
for label, m in METRICS:
rows = get(f"metrics/{m}/segmentize", start_date=start, end_date=end,
**{"segment_by[period]": "week"})["segmented"]
weeks[label] = {row["period"]: row["plain"] for row in rows}
print("\nIn-period counts by week (each count in the week its own event happened)")
print(" " + "week".ljust(20) + "".join(label.rjust(14) for label, _ in METRICS) + "Outside".rjust(12))
for period in weeks["Shares"]: # every week of the period, empty weeks included
counts = [weeks[label].get(period, 0) for label, _ in METRICS]
print(" " + period.ljust(20) + "".join(f"{x:>14,}" for x in counts) + f"{counts[4] - counts[3]:>12,}")
counts = [total[label] for label, _ in METRICS]
print(" " + "Total".ljust(20) + "".join(f"{x:>14,}" for x in counts) + f"{counts[4] - counts[3]:>12,}")
print(" Friend sales = friend referral sales; Any timing = friend purchases of any timing;\n"
" Outside = Any timing - Friend sales: matched purchases outside the attribution window, or blocked.")
return total["Friend sales"]
def parse_time(text):
text = (text or "").strip()
for fmt in TIME_FORMATS:
try:
return datetime.strptime(text, fmt)
except ValueError:
continue
return None
def pick(header, name):
return next((h for h in header if h.strip().lower() == name.lower()), None)
def quantile(values, q):
values = sorted(values)
k = (len(values) - 1) * q
f = int(k)
c = min(f + 1, len(values) - 1)
return values[f] + (values[c] - values[f]) * (k - f)
def describe(label, lags):
if not lags:
print(f" {label[:30]:<31}{0:>8}" + "n/a".rjust(8) * 4 + "n/a".rjust(9) * len(WITHIN))
return
within = "".join(f"{100 * sum(x <= d for x in lags) / len(lags):>8.1f}%" for d in WITHIN)
print(f" {label[:30]:<31}{len(lags):>8,}{statistics.median(lags):>8.1f}{quantile(lags, .25):>8.1f}"
f"{quantile(lags, .75):>8.1f}{statistics.mean(lags):>8.1f}{within}")
def lag_from_export(path, start, end, api_count):
with open(path, newline="", encoding="utf-8-sig") as f:
rows = list(csv.DictReader(f))
if not rows:
sys.exit(f"{path}: no rows")
header = list(rows[0].keys())
col = {name: pick(header, name) for name in ("Date age", "Shared at", "Ideal", "Status", "Qa generated",
"FR Event Category", "Sharing channel", "Track method")}
if not col["Date age"] or not col["Shared at"]:
sys.exit(f"{path}: need the columns 'Date age' and 'Shared at'; found: {', '.join(header)}")
if not col["Ideal"]:
print(" warning: no 'Ideal' column, so rows outside the attribution window cannot be left out")
first, last = parse_time(start).date(), parse_time(end).date()
sales, kept = 0, []
not_sale = dict.fromkeys(["unreadable purchase date", "outside the period", "blocked", "voided", "QA (test)",
"not a purchase", "not Ideal"], 0)
not_lag = dict.fromkeys(["no share recorded", "unreadable share date", "share not before the purchase"], 0)
def value(r, name):
return (r[col[name]] or "").strip().lower() if col[name] else ""
def reason(r, bought): # why a row is not a friend referral sale of the period (first reason that applies)
if bought is None:
return "unreadable purchase date"
if not first <= bought.date() <= last:
return "outside the period"
if value(r, "Status") in ("blocked", "voided"):
return value(r, "Status")
if value(r, "Qa generated") in YES:
return "QA (test)"
if value(r, "FR Event Category") not in ("", "purchase"):
return "not a purchase"
if col["Ideal"] and value(r, "Ideal") not in YES:
return "not Ideal"
return None
for r in rows:
bought = parse_time(r[col["Date age"]])
why = reason(r, bought)
if why:
not_sale[why] += 1
continue
sales += 1
if not (r[col["Shared at"]] or "").strip():
not_lag["no share recorded"] += 1 # matched without a share link
continue
shared = parse_time(r[col["Shared at"]])
if shared is None:
not_lag["unreadable share date"] += 1
continue
if (bought.tzinfo is None) != (shared.tzinfo is None):
bought, shared = bought.replace(tzinfo=None), shared.replace(tzinfo=None)
if bought <= shared: # same moment or earlier = the advocate's own post-purchase share
not_lag["share not before the purchase"] += 1
continue
kept.append((r, (bought.date() - shared.date()).days)) # calendar days as written in the export
print(f"\nShare-to-purchase lag from {path}, {first} to {last}")
print(" not friend referral sales of the period: " + "; ".join(f"{k} {v:,}" for k, v in not_sale.items()))
print(f" friend referral sales in the export {sales:,}; metrics API, same period {api_count:,}")
print(" left out of the lag: " + "; ".join(f"{k} {v:,}" for k, v in not_lag.items())
+ f"; measured {len(kept):,}")
print(" " + "group".ljust(31) + "sales".rjust(8) + "median".rjust(8) + "p25".rjust(8) + "p75".rjust(8)
+ "mean".rjust(8) + "".join(f"<={d}d".rjust(9) for d in WITHIN) + " (days from the share)")
describe("All friend referral sales", [d for _, d in kept])
for name in ("Track method", "Sharing channel"):
if col[name]:
for group in sorted({r[col[name]] for r, _ in kept}):
describe(f"{name}: {group}", [d for r, d in kept if r[col[name]] == group])
if __name__ == "__main__":
args = sys.argv[1:]
export = None
if "--referrals" in args and args.index("--referrals") + 1 < len(args):
i = args.index("--referrals")
export = args[i + 1]
del args[i:i + 2]
if len(args) != 2 or None in map(parse_time, args):
sys.exit("usage: python3 share_to_purchase.py START END [--referrals referrals.csv] (dates YYYY-MM-DD)")
KEY = os.environ.get("TALKABLE_API_KEY")
SITE = 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)")
start, end = args
print(f"Share-to-purchase time {SITE} {start} -> {end}")
friend_sales = in_period(start, end)
if export:
lag_from_export(export, start, end, friend_sales)
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. - Set the same filters. The same start and end dates; the same campaigns, if you filtered by
campaign_ids[]; the same test-traffic and refund filters; week as the aggregate period for the weekly rows. - Compare column by column. The admin's name for each figure is in the metrics table above, column “Metrics Aggregation”.
- Tie the export to the counts. The script prints the export's friend referral sales for the period next to
ideal_friend_sales_count; pull both on the same day.
If a figure differs, check five things:
- the period boundaries: both days are inclusive, in the account time zone;
- whether the report is filtered to the same campaigns;
- whether its other filters match;
- whether you compared # Ideal FR sales with # Talkable Sales, which also counts voided referrals, instead of # Talkable Sales not voided;
- whether the week rows start on the same day (REST weeks start on Sunday, MCP weeks on Monday); compare totals or months.
Troubleshooting
- “No metric found.” (HTTP 400)
Why: the identifier is not one the API knows.
Fix: friend referral sales areideal_friend_sales_count, friend purchases of any timingtalkable_sales_count. The lag comes from the Referrals export. - “`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 (the message namesend_datewhen that is the one).
Fix: send2026-09-30. - “This segmentation produces … rows, over the synchronous limit of 1000” (HTTP 422)
Why: a daily split over several years returns more than 1,000 rows.
Fix: narrow the period, use weeks, or schedule it as the message says:POST /api/v2/metrics/{metric}/segmentize(a key withapi:write), then pollGET …/segmentize/{job_id}. - HTTP 503 or HTTP 429
Why: a 503 from the metrics endpoints means the request budget is spent for now; a 429 is the API-wide throttle (request throttling).
Fix: wait and retry. The script makes 10 calls, 5 for the totals and 5 for the weekly split. On a 503 or 429 it waits 5, 10, 20 and 40 seconds between attempts, then stops with the HTTP 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 week with more friend referral sales than visits
Why: the visit fell in an earlier week than the sale, or several referrals were matched to one friend's visit.
Fix: nothing to fix; over a quarter the two line up. - The export's friend referral sales differ from the metric
Why: the two were pulled at different times or for different days; statuses can change between pulls.
Fix: export and call the API on the same day, for the same dates. - The export is “preview_ready”, not “completed”
Why: withoutsend_email: trueonly the report's first page is prepared, and no file is built.
Fix: schedule once withsend_email: trueand pollget_grid_export. - Rows with an empty “Shared at”
Why: no share link led to the purchase; the referral was matched another way.
Fix: nothing to fix. The script counts them as “no share recorded” and leaves them out of the lag; they are still friend referral sales. - A “Shared at” equal to, or later than, the purchase
Why: that is the advocate's own post-purchase share stamped with the order, not a friend who bought after it.
Fix: the script leaves these rows out and reports how many. - Direct-link lags look long
Why: a copied link keeps one share record with the time of the first copy, so every friend who opens it later is timed from that first copy.
Fix: read the direct-link row on its own; compare channels on the median, not the average. - 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
- Purchases outside the window. Export the Referrals report with
ideal: NOfor the same period and compute the same lag (“Date age” − “Shared at”) on its rows that are not blocked or voided: it shows the share-to-purchase lag of the purchases that fell outside the window (the window itself runs on friend timing). - By tracking method. Export coupon-tracked referrals (
track_methodcouponandpersonal_coupon) and the rest as two files, and run the script on each. - By channel and by campaign.
segment_by[sharing_channels]=trueon shares, clicks, visits andideal_friend_sales_count;campaign_ids[]on any metric. The script splits the lag by the export's “Sharing channel” column. - The purchase-to-share side. Export the Offer Shares report and the Purchases report for the same period. For each advocate, take the gap from the latest earlier order to the first share, with a same-moment tie counted as zero.
- Rows, not totals. The exportable reports give rows the API sums up (reports and exports): Referrals, Purchases, Offer Shares, Offers. In the Talkable admin they download as CSV; from an agent,
list_grid_reports,schedule_grid_exportandget_grid_exportschedule and read the same files.
Methodology
- Figures
- Talkable benchmark data: each program's figure first, then the median and the typical range (25th to 75th percentile) across programs, with the program count and period beside each figure. Cells under five programs are not published; typical ranges Talkable computes start at eight programs, and published benchmark ranges are printed as published. No program is named.
- Code
- The requests and the script were run on a live Talkable site; REST and MCP agree.
FAQ
How long after a referral share does the friend buy?
At the median Talkable program, half of the friend referral sales come within 2 days of the share; the typical range is 1–7 days (Talkable benchmark data, 185 programs, 2023–2025). The median program's average is about 20 days.
Why is the average referral share-to-purchase time so much higher than the median?
A few very late purchases pull the average up. In the worked example, 95 friends buying on day 1 and 5 on day 365 give a median of 1 day and an average of 19.2 days.
What is the difference between share-to-purchase time and friend timing in a referral program?
Share-to-purchase time runs from the advocate's share. Talkable's friend timing runs from the friend's last interaction: the share, a share-email open or a click. The attribution window, 30 days by default, runs on friend timing.
Does a longer referral attribution window capture more sales?
Yes, with diminishing returns: at the median Talkable program, 30 days holds 59% of all referral-matched revenue and 90 days 71% (Talkable benchmark data, 192 programs, history to April 2024). Talkable's analysts read the long tail as repeat buying.
How soon after buying do customers share a referral program?
It splits: at 26 of 60 programs, half of the sharers who had bought before share within 10 minutes. At the median program, 76% of those sharers share within 30 days (Talkable benchmark data, January 2025 – June 2026).
How do I measure referral share-to-purchase time from the Talkable API?
GET https://www.talkable.com/api/v2/metrics/{metric} with metric ideal_friend_sales_count, site_slug, YYYY-MM-DD dates and a Bearer API key returns friend referral sales. The lag per sale comes from the Referrals export: Date age − Shared at, in calendar days.
Learn more
In the Talkable documentation:
| Referral tracking methods | How a friend's purchase is matched to an advocate, method by method, in priority order |
| Offer expiration | How long the friend offer stays claimable: a deadline date or a duration |
| Referrals approval | Pending, approved and voided referrals, and when rewards are issued |
| Reporting with Talkable AI | Metrics, segments and report exports from the AI Assistant or your own agent |
| Talkable MCP server | Connect Claude Code, ChatGPT, Cursor or any MCP client |
| Talkable API | Authentication, response format, errors and throttling |
