# Uur per uur statistieken

**URL:** https://meta.discourse.org/t/hour-by-hour-statistics/170223
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [15 november 2020 om 22:53 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223 "2020-11-15T22:53:13Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [15 november 2020 om 22:53 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/1 "2020-11-15T22:53:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [15 november 2020 om 22:54 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/2 "2020-11-15T22:54:39Z")

</div>

Try the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin.

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [15 november 2020 om 22:55 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/3 "2020-11-15T22:55:25Z")

</div>

I wish, the thing is is that I use [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting), so I’m not able to install plugins.

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [15 november 2020 om 23:00 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/4 "2020-11-15T23:00:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [16 november 2020 om 01:34 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/5 "2020-11-16T01:34:51Z")

</div>

You should email them for support.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [16 november 2020 om 17:12 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/6 "2020-11-16T17:12:22Z")

</div>

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](https://meta.discourse.org/t/32566?silent=true) 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](mailto:support@discoursehosting.com)._

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [16 november 2020 om 17:17 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/7 "2020-11-16T17:17:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [16 november 2020 om 17:17 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/8 "2020-11-16T17:17:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ondrej](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrej/32/198804_2.png) [@ondrej](https://meta.discourse.org/u/ondrej)
#### Post date: [16 november 2020 om 17:20 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/9 "2020-11-16T17:20:33Z")

</div>

For date explorer press run

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/d/5d761f2b5ff9a227bfe92d7fcbee09a1007c8cc2.png)

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [16 november 2020 om 17:20 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/10 "2020-11-16T17:20:54Z")

</div>

Where can I find that page?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [16 november 2020 om 17:22 UTC](https://meta.discourse.org/t/hour-by-hour-statistics/170223/11 "2020-11-16T17:22:35Z")

</div>

- Go to Admin - Plugins - [Data Explorer](https://meta.discourse.org/t/32566?silent=true).
- 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](mailto:support@discoursehosting.com).
