articleStatistics Query
Description
Returns aggregated page view statistics for an article.
query articleStatistics(
$articleRef: ID!
$from: Date
$to: Date
$granularity: StatisticsGranularity
) {
articleStatistics(
articleRef: $articleRef
from: $from
to: $to
granularity: $granularity
) {
granularity
pageViews
series {
date
pageViews
sold
}
}
}
Variables
{
"articleRef": "024dcb4e166486784cefd87d",
"from": 1740526283116,
"to": 1733250756054,
"granularity": "hour"
}
Response
{
"articleStatistics": {
"granularity": "hour",
"pageViews": 42,
"series": [
{
"date": 1750383395091,
"pageViews": 42,
"sold": 42
}
]
}
}
Arguments
| Name | Type | Description |
|---|---|---|
articleRef | ID! | Article 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. |