Hour By Hour Statistics

When looking at my forum, I generally see that there are more posts in specific hours than others. Is there a way that we can get a statistic that shows specifically; in hours how many posts how many page views etc. like there is day by day, instead; hour by hour.

Try the Data Explorer plugin.

2 Likes

I wish, the thing is is that I use Communiteq (formerly DiscourseHosting), so I’m not able to install plugins.

Then there’s not much you can do, unfortunately!

You should email them for support.

2 Likes

The query below will show posts created per hour of the day.

-- [params]
-- int :months_ago = 1

WITH query_period AS
(SELECT date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' AS period_start,
                                                    date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' + INTERVAL '1 month' - INTERVAL '1 second' AS period_end)
SELECT EXTRACT (HOUR FROM p.created_at) AS hour,
  COUNT(p.id) AS amount
FROM posts p
JOIN topics t ON t.id = p.topic_id
JOIN query_period qp ON p.created_at >= qp.period_start
AND p.created_at <= qp.period_end
WHERE t.archetype = 'regular'
AND p.user_id > 0
GROUP BY hour
ORDER BY hour

The data explorer plugin is one of the plugins that we install by default. All you need to do is enable it in Admin - Plugins. If you have any questions specific to our hosting please take them to support@discoursehosting.com.

6 Likes

What do I do with that code in order to install it?

I was able to activate it, I just don’t know how to use that code to make it actually work

For date explorer press run

Where can I find that page?

  • Go to Admin - Plugins - Data Explorer.
  • Press the + button on the top right.
  • Enter “post per hour” in the input box left to the “Create New” button and press the button.
  • Copy/paste the code so it replaces the SELECT 1 text.
  • Click ‘Save changes and run’

If you need more guidance, please contact support@discoursehosting.com.

1 Like