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": "c173840c7b3b731252e9eccc",
"from": 1749796996198,
"to": 1741334044702,
"granularity": "hour"
}
Response
{
"itemStatistics": {
"granularity": "hour",
"pageViews": 42,
"sold": 42,
"series": [
{
"date": 1758310354463,
"pageViews": 42,
"sold": 42
}
],
"campaignEvents": [
{
"campaignRef": "03f357ebfb90128927862316",
"title": "example",
"listTitle": "example",
"date": 1763735379747,
"recipientsCount": 42
}
],
"lastSoldAt": 1789560551148,
"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. |