Hi folks, wasn’t able to find this discussed previously.
Is there a way to generate reports (pageviews, topics, posts) on a per-category basis?
We created a new category that’s generating interest from our community, and we’d like to see its growth curve over time as we make people aware it’s there.
Would that be possible? Could that be done by 1) customizing the stock Discourse reports UI, or 2) by using analytics tools on my end to look at the Discourse database through the API?
You can use this to generate reports from SQL queries, here’s a query that will capture some of what you want to track.
-- [params]
-- date :start_date = 2020-04-01
-- date :end_date = 2020-04-29
SELECT c.id category_id, COUNT(DISTINCT(t.id)) topics, COUNT(p.id) posts, sum(p.like_count) likes, sum(p.reads) reads
FROM categories c
INNER JOIN topics t ON (t.category_id = c.id)
INNER JOIN posts p ON (p.topic_id = t.id AND p.post_type = 1)
WHERE p.created_at BETWEEN :start_date AND :end_date
GROUP BY c.id
ORDER BY COUNT(p.id) DESC
You can share these reports with groups via the Data Explorer UI:
Danke dafür, es ist genau das, was ich brauchte (und bringt mich auch dazu, mehr darüber zu erfahren, was ich abfragen kann). Ich habe die SELECT-Anweisung erweitert, um die Anzahl der Antworten in einem Thema zu erhalten