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": "dac1213041de31018efd09cd",
"from": 1758148141474,
"to": 1787408367744,
"granularity": "hour"
}
Response
{
"itemStatistics": {
"granularity": "hour",
"pageViews": 42,
"sold": 42,
"series": [
{
"date": 1733042968360,
"pageViews": 42,
"sold": 42
}
],
"campaignEvents": [
{
"campaignRef": "5eafb2d3e02bdc4df4a8ac33",
"title": "example",
"listTitle": "example",
"date": 1776912952364,
"recipientsCount": 42
}
],
"lastSoldAt": 1752409029781,
"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. |