How to find peak hour of most users visiting a website

For querying data from Browser, i need to find daily peak hours during which i find most users visiting website. For ex. between 1pm-3pm or 3pm to 6pm brackets.
I tried,

SELECT count(*) FROM PageView WHERE appName = ‘**’ FACET hourOf(timestamp) SINCE this month

Its not quite what i want. Thanks

If we can have the data from 15 Nov to 15 Dec to have a view of peak and lean times during the day for the browser application that’ll really be helpful. Thanks.

Hi @Mohd.Salman2 - The NRQL Library has many samples which you can use to put this query together :wink:

Hi Stefan,
I have checked the library and i have progressed although the result is not the correct format. I tried:

SELECT count(*) FROM PageView WHERE appName = ‘**’ FACET hourOf(timestamp ) SINCE this year LIMIT 5

The result is not sorted according to pageviews, i want most page views on top wrt the hour based timestamp. Thanks, let me know if this is possible.

You can try adding ORDER BY pageUrl but this may not work as the ORDER BY clause is not supported. Alternatively, you will need to manually set the sort by clicking the column header on the table.

1 Like

Thanks much. So the below query gives me the peak hours from 15 Nov to 15 Dec to during the day for the application. The pageviews can be taken as a parameter for traffic as a practice?

Hi, @Mohd.Salman2: It depends what you want to measure. If you want to measure page views, the above query will work. If you want to measure sessions (app launches), you can try:

SELECT uniqueCount(session)
FROM PageView...

If you want to measure users, you will have to capture a custom attribute with a unique ID for each user.


Thanks @philweber @stefan_garnham

1 Like

This is great stuff from @philweber and @stefan_garnham

Let us know how these queries go for you @Mohd.Salman2

1 Like