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": "038b565e6d2af8ec89bd238f",
"from": 1769333561350,
"to": 1734688127762,
"granularity": "hour"
}
Response
{
"articleStatistics": {
"granularity": "hour",
"pageViews": 42,
"series": [
{
"date": 1717684953406,
"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. |