Skip to main content

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​

ParameterTypeDescription
accountIduuid!Account identifier (required)
startDatetimestampStart of the range (format: yyyy-mm-dd or yyyy-mm-ddThh:mm:ss)
endDatetimestampEnd of the range, not included (same format as startDate)

Response fields​

FieldTypeDescription
hourtimestampStart of the hour
sessionsbigintNumber of sessions that first became meaningful in that hour

Common use cases​

Try it​

Loading GraphQL Playground...

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"
}

Example response​

{
"data": {
"rows": [
{
"hour": "2024-01-08T09:00:00",
"sessions": 142
},
{
"hour": "2024-01-08T10:00:00",
"sessions": 187
}
]
}
}