tanqoryExtMarketingPathToPurchase
- Query
- Orders and payments
The paths buyers took to the orders of [from, to] (shop days): an order's journey is its visitor's storefront visits in the 30 days up to the order (the visit its cart came from names the visitor). traffic (default MARKETING) keeps the orders whose journey has a visit of that kind.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
from | Date! | Required | |
to | Date! | Required | |
traffic | TanqoryExtMarketingTraffic | Optional |
Returns
TanqoryExtMarketingPathToPurchase!
| Field | Type | Description |
|---|---|---|
currencyCode | CurrencyCode! | |
medianSecondsBetweenTouchpoints | Int | Median seconds between two marketing visits of one journey. |
medianSecondsToPurchase | Int | Median seconds from the first visit to the order. |
medianTouchpoints | Float | Median number of marketing (not direct) visits before an order; null without visits. |
orders | Int! | Orders counted (after the traffic filter). |
ordersWithVisits | Int! | Orders with at least one recorded visit (the medians are over these). |
paths | [TanqoryExtMarketingPath!]! | Total sales by channel path, most sales first. |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
-H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"query TanqoryExtMarketingPathToPurchase($from: Date!, $to: Date!) {\n tanqoryExtMarketingPathToPurchase(from: $from, to: $to) {\n currencyCode\n medianSecondsBetweenTouchpoints\n medianSecondsToPurchase\n medianTouchpoints\n orders\n ordersWithVisits\n }\n}","variables":{"from":"","to":""}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtMarketingPathToPurchase(\$from: Date!, \$to: Date!) {
tanqoryExtMarketingPathToPurchase(from: \$from, to: \$to) {
currencyCode
medianSecondsBetweenTouchpoints
medianSecondsToPurchase
medianTouchpoints
orders
ordersWithVisits
}
}`;
const variables = {
"from": "",
"to": ""
};
const res = await fetch(`https://api.tanqory.com/admin/2026-10/stores/${process.env.STORE_ID}/graphql`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.TANQORY_ACCESS_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, variables }),
});
console.log(res.status, JSON.stringify(await res.json(), null, 2));# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """query TanqoryExtMarketingPathToPurchase($from: Date!, $to: Date!) {
tanqoryExtMarketingPathToPurchase(from: $from, to: $to) {
currencyCode
medianSecondsBetweenTouchpoints
medianSecondsToPurchase
medianTouchpoints
orders
ordersWithVisits
}
}"""
variables = json.loads("""{
"from": "",
"to": ""
}""")
req = urllib.request.Request(
"https://api.tanqory.com/admin/2026-10/stores/" + os.environ["STORE_ID"] + "/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"Authorization": "Bearer " + os.environ["TANQORY_ACCESS_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))