Meaningful sessions by hour range
Overview
The get_meaningful_sessions_count_by_hour_range function provides meaningful session counts per hour within a time range. Each session is counted in the hour when it first became meaningful. Use this endpoint to:
- Analyze sessions during business hours vs off-hours
- Compare morning vs afternoon engagement
- Track sessions during specific operational windows
Quick start
query GetMeaningfulSessionsCountByHourRange(
$accountId: uuid!
$startDate: timestamp
$endDate: timestamp
) {
rows: get_meaningful_sessions_count_by_hour_range(
args: {
account_id: $accountId
start_time: $startDate
end_time: $endDate
}
) {
hour
sessions
}
}
Variables:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08T09:00:00",
"endDate": "2024-01-08T17:00:00"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | uuid! | Account identifier (required) |
startDate | timestamp | Start of the range (format: yyyy-mm-dd or yyyy-mm-ddThh:mm:ss) |
endDate | timestamp | End of the range, not included (same format as startDate) |
Response fields
| Field | Type | Description |
|---|---|---|
hour | timestamp | Start of the hour |
sessions | bigint | Number of sessions that first became meaningful in that hour |
Common use cases
Try it
Loading GraphQL Playground...
- Business hours
- Off-hours
- Morning hours
Get sessions during business hours (9 AM - 5 PM):
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08T09:00:00",
"endDate": "2024-01-08T17:00:00"
}
Get sessions during off-hours (6 PM - 8 AM):
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08T18:00:00",
"endDate": "2024-01-09T08:00:00"
}
Get sessions during morning hours (6 AM - 12 PM):
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08T06:00:00",
"endDate": "2024-01-08T12:00:00"
}
Example response
{
"data": {
"rows": [
{
"hour": "2024-01-08T09:00:00",
"sessions": 142
},
{
"hour": "2024-01-08T10:00:00",
"sessions": 187
}
]
}
}