itemStatistics Query
Description
Returns aggregated page view and sales statistics for an item.
query itemStatistics(
$itemRef: ID!
$from: Date
$to: Date
$granularity: StatisticsGranularity
) {
itemStatistics(
itemRef: $itemRef
from: $from
to: $to
granularity: $granularity
) {
granularity
pageViews
sold
series {
date
pageViews
sold
}
campaignEvents {
campaignRef
title
listTitle
date
recipientsCount
}
lastSoldAt
countrySales {
alpha2
count
}
}
}
Variables
{
"itemRef": "d45c5bff34a245dce6ab9eab",
"from": 1760151213918,
"to": 1783322600999,
"granularity": "hour"
}
Response
{
"itemStatistics": {
"granularity": "hour",
"pageViews": 42,
"sold": 42,
"series": [
{
"date": 1744365984691,
"pageViews": 42,
"sold": 42
}
],
"campaignEvents": [
{
"campaignRef": "3d6af4679bb839917a5c0743",
"title": "example",
"listTitle": "example",
"date": 1772214424558,
"recipientsCount": 42
}
],
"lastSoldAt": 1752235411625,
"countrySales": [
{
"alpha2": "example",
"count": 10
}
]
}
}
Arguments
| Name | Type | Description |
|---|---|---|
itemRef | ID! | Item reference (_id). |
from | Date | Start of the date range (inclusive). Omit for all-time statistics. |
to | Date | End of the date range (inclusive). Omit for all-time statistics. |
granularity | StatisticsGranularity | Force a specific bucket granularity. Omit to let the server pick automatically. |