Browse developer documentation
Read-only tool
get_time_to_purchase
Group purchases by time since a preceding recorded entry visit.
Access: OAuth analytics:read or a privately configured workspace key.
Arguments
| Field | Type | Description |
|---|---|---|
compare | string | Comparison range. Values: previous_period, mom, qoq, yoy, none. Default: |
filters | array | JSON array of up to twenty visitor filters, for example [{"dim":"country","op":"is","value":"US"}]. Dimensions: source, channel, campaign, entry_page, page, hostname, country, device, browser, os, goal. Operators: is, is_not. Values are exact strings up to 500 characters. All filters must match the visitor across available history; report dates then select activity for that cohort. Unmatched payments are excluded. Crawler counts remain website-wide; spend requires every filter to be source/channel/campaign. Preserve filters when paging. |
from | string | Inclusive start date. Supply to as well. |
model | string | How recorded sources share revenue credit. Values: first_touch, last_touch, linear, time_decay. Default: |
period | string | UTC date selection. from and to override period. Values: realtime, today, yesterday, 7d, 30d, 90d, 12m, wtd, mtd, qtd, ytd, all. Default: |
site | string | Website ID or domain. Required when the workspace has more than one website. |
to | string | Inclusive end date. Supply from as well. |
filters[] fields
| Field | Type | Description |
|---|---|---|
dim | string | Values: source, channel, campaign, entry_page, page, hostname, country, device, browser, os, goal. |
op | string | Values: is, is_not. |
value | string |
Read time to purchase
Use this JSON-RPC call through an initialized MCP client. Replace example values with your actual website, dates or confirmed setup details.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_time_to_purchase",
"arguments": {
"site": "site_example",
"from": "2026-10-01",
"to": "2026-10-07",
"compare": "none"
}
}
}Decoded result
Illustrative JSON parsed from the result’s text block.
{
"site": {
"id": "site_example",
"domain": "shop.example.com",
"currency": "USD"
},
"period": {
"from": "2026-10-01T00:00:00.000Z",
"to": "2026-10-08T00:00:00.000Z",
"label": "Custom",
"compare": "none",
"attribution_model": "first_touch"
},
"buckets": [
{
"label": "Same day",
"orders": 4,
"revenue": 20000,
"share_pct": 100,
"avg_touches": 2
}
]
}Result fields
| Field | Type | Description |
|---|---|---|
site | object | Website ID, domain and currency. |
period | object | Resolved UTC boundaries; to is the exclusive timestamp after the selected end date. |
buckets | array | Report records. See the fields below. |
coverage | object | When provided, describes completeness, snapshot time and row coverage. Row limits apply to this page, not to headline totals. |
site fields
| Field | Type | Description |
|---|---|---|
id | string | Website ID. |
domain | string | Website domain. |
currency | string | Three-letter currency. |
period fields
| Field | Type | Description |
|---|---|---|
from | string | Inclusive UTC start. |
to | string | Exclusive UTC end. |
label | string | Human-readable date selection. |
compare | string | Comparison selection. |
attribution_model | string | Revenue-credit model. |
buckets[] fields
| Field | Type | Description |
|---|---|---|
label | string | Same day, 1–3, 4–7, 8–30 or 30+ days. |
orders | integer | Order count. |
revenue | integer | Revenue in cents. |
share_pct | number | Percentage of included orders. |
avg_touches | number | Average observed touches. |
The decoded data follows the time to purchase response contract, without the REST envelope.
Full MCP result wrapper
{
"content": [
{
"type": "text",
"text": "{\n \"site\": {\n \"id\": \"site_example\",\n \"domain\": \"shop.example.com\",\n \"currency\": \"USD\"\n },\n \"period\": {\n \"from\": \"2026-10-01T00:00:00.000Z\",\n \"to\": \"2026-10-08T00:00:00.000Z\",\n \"label\": \"Custom\",\n \"compare\": \"none\",\n \"attribution_model\": \"first_touch\"\n },\n \"buckets\": [\n {\n \"label\": \"Same day\",\n \"orders\": 4,\n \"revenue\": 20000,\n \"share_pct\": 100,\n \"avg_touches\": 2\n }\n ]\n}"
}
]
}Behavior and limits
Money is integer cents in site.currency. Percentages use a 0–100 scale.
Examples show one bucket for brevity. Refunds and payments without a preceding recorded entry visit are excluded.
Report tools return the report data directly inside MCP text content. They do not add the REST status/data envelope.
With multiple websites and no site argument, this report tool returns needs_site: true and the available websites. Choose a real website and call it again.