I’ve been searching for a while but couldn’t find anything similar, not even in the cool Data Explorer queries.
I want to see the history of views/visits that a specific topic has received for a period of time.
Ideally, I’d like to have something like this, but for each individual topic:
I don’t mind if it’s just a table day by day or if it can include a graph (I can build that outside Discourse). I’m also really interested in having all visits (user & anon).
This would help me track and analyze topics usage within certain periods of time (in where I expect more or less activity).
Do you know if is there some data explorer query for this?
Thank you in advance!
Maybe try this:
-- int :topic_id =
-- date :start_date =
-- date :end_date =
SELECT COUNT(*) AS views
WHERE topic_id = :topic_id
AND viewed_at BETWEEN :start_date AND :end_date
you will need to specify the topic id (from the topic URL) and the date range parameters in YYYY-MM-DD format.
It’s useful! I’ll make some research in order to separate data day by day, because it sums up all views during period.
Now I know where to begin
Glad that helps you. Let us know if you need more specific queries or more help with it
I’m afraid I have recently found out that the
topic_views table only records the very first view of a topic by a user and not one topic view per user/ip per day.
Unfortunately this makes doing a time-based breakdown on views a little skewed, and can only be done on ‘viewed for the first time’.
Well then the table should be called
Sorry @Ayelen_Rives , I tried
edit: Found a relevant discussion:
What a pity! Agree with Lilly that the table should be called topic_first_views for disambiguation.
Thanks for the info and thanks Lilly for the try!
I’ll keep looking on that discussion.