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": "89f2b62b93cf8e1bfede2385",
"from": 1726923199505,
"to": 1735958076478,
"granularity": "hour"
}
Response
{
"articleStatistics": {
"granularity": "hour",
"pageViews": 42,
"series": [
{
"date": 1775757922446,
"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. |