# Admin dashboard report reference guide

**URL:** https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233
**Category:** Site Management
**Tags:** reference, sql-query, dashboard-reports, reporting
**Created:** [September 27, 2022, 8:25pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233 "2022-09-27T20:25:16Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [September 27, 2022, 8:25pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/1 "2022-09-27T20:25:16Z")

</div>

> 🔖 This is a reference guide for describing how the Admin Dashboard Reports function, the data they’re displaying, the corresponding [Data Explorer](https://meta.discourse.org/t/32566?silent=true) SQL queries, and where to find the Ruby code for each report.
> 
> 🙋 Required user level: Staff

Discourse contains several built-in admin dashboard Reports that can be useful for exploring stats about a community. To access these reports, you can visit `discourse.example.com/admin/dashboard/reports` on your site ( or click the **Reports** link in the sidebar). Note that only staff users will have access to these reports.

 ![Screenshot 2026-09-02 at 12.11.17 PM](https://global.discourse-cdn.com/meta/original/4X/a/3/3/a33721f8ed7bbed4ab4357cd0630514eec5874bc.png)

Data from all users on a site is included in these reports (including staff activity like visiting admin pages). The only condition that is put on users in the reports is that they are ‘real’ users, which is used to exclude the `system` user from the reports.

Plugins can also add reports to the dashboard with `add_report(name, &block)`.

> 💎 Ruby models for most reports are located at: [discourse/app/models/concerns/reports/](https://github.com/discourse/discourse/tree/main/app/models/concerns/reports). Some reports also reference: [discourse/app/models/report.rb](https://github.com/discourse/discourse/blob/4c085873e5c4174e876304d8300462fb96a7fd6e/app/models/report.rb)

> 💡 The #dashboard-sql topics contain all of the corresponding SQL queries that can be used to generate reports identical to the Admin Dashboard Reports. These queries can be used within the [Data Explorer](https://meta.discourse.org/t/discourse-data-explorer/32566) plugin and for [Running Data Explorer queries with the Discourse API](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063)

> 🔧 To hide specific reports from the dashboard, use the `dashboard_hidden_reports` site setting.

## Accepted solutions

Displays daily tally of posts marked as solutions.

Ruby code: [discourse-solved/plugin.rb at main · discourse/discourse-solved · GitHub](https://github.com/discourse/discourse-solved/blob/main/plugin.rb#L368)

SQL Query: [Dashboard Report - Accepted Solutions](https://meta.discourse.org/t/dashboard-report-accepted-solutions/288863)

## Admin Logins

List of admin login times with locations.

Ruby Code: [discourse/app/models/concerns/reports/staff\_logins.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/staff_logins.rb)

SQL Query: [Dashboard Report - Admin Logins](https://meta.discourse.org/t/dashboard-report-admin-logins/288873)

## Anonymous

Number of new pageviews by visitors not logged in to an account.

Ruby Code: [discourse/app/models/concerns/reports/consolidated\_page\_views.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/consolidated_page_views.rb)

SQL Query: [Dashboard Report - Anonymous](https://meta.discourse.org/t/dashboard-report-anonymous/289114)

## Bookmarks

Number of new topics and posts bookmarked.

Ruby Code: [discourse/app/models/concerns/reports/bookmarks.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/bookmarks.rb)

SQL Query: [Dashboard Report - Bookmarks](https://meta.discourse.org/t/dashboard-report-bookmarks/289129)

## Consolidated API Requests

API usage statistics by date, tracking both regular API requests and user API requests.

Ruby Code: [discourse/app/models/concerns/reports/consolidated\_api\_requests.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/consolidated_api_requests.rb)

SQL Query: [Dashboard Report - Consolidated API Requests](https://meta.discourse.org/t/dashboard-report-consolidated-api-requests/383778)

## Consolidated Pageviews

Pageviews for logged in users, anonymous users and crawlers. This is a legacy report superseded by the **Site Traffic** report.

Ruby Code: [discourse/app/models/concerns/reports/consolidated\_page\_views.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/consolidated_page_views.rb)

SQL Query: [Dashboard Report - Consolidated Pageviews](https://meta.discourse.org/t/dashboard-report-consolidated-pageviews/289263)

## Consolidated Pageviews with Browser Detection (Deprecated)

Pageviews for logged in users, anonymous users, known crawlers and other. This report is deprecated and now delegates to the **Site Traffic** report.

Ruby Code: [discourse/app/models/concerns/reports/consolidated\_page\_views\_browser\_detection.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/consolidated_page_views_browser_detection.rb)

SQL Query: [Dashboard Report - Consolidated Pageviews with Browser Detection](https://meta.discourse.org/t/dashboard-report-consolidated-pageviews-with-browser-detection/312968)

## DAU/MAU

Number of members that logged in in the last day divided by number of members that logged in in the last month – returns a % which indicates community ‘stickiness’. Aim for \>20%.

Ruby Code: [discourse/app/models/concerns/reports/dau\_by\_mau.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/dau_by_mau.rb)

SQL Query: [Dashboard Report - DAU/MAU](https://meta.discourse.org/t/dashboard-report-dau-mau/289383)

## Daily Engaged Users

Number of users that have liked or posted in the last day.

Ruby Code: [discourse/app/models/concerns/reports/daily\_engaged\_users.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/daily_engaged_users.rb)

SQL Query: [Dashboard Report - Daily Engaged Users](https://meta.discourse.org/t/dashboard-report-daily-engaged-users/288033)

## Emails Sent

Number of new emails sent.

Ruby Code: [discourse/app/models/concerns/reports/emails.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/emails.rb)

SQL Query: [Dashboard Report - Emails Sent](https://meta.discourse.org/t/dashboard-report-emails-sent/289401)

## Flags

Number of new flags.

Ruby Code: [discourse/app/models/concerns/reports/flags.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/flags.rb)

SQL Query: [Dashboard Report - Flags](https://meta.discourse.org/t/dashboard-report-flags/289412)

## Flags Status

List of flags’ statuses including type of flag, poster, flagger, and time to resolution.

Ruby Code: [discourse/app/models/concerns/reports/flags\_status.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/flags_status.rb)

SQL Query: [Dashboard Report - Flags Status](https://meta.discourse.org/t/dashboard-report-flags-status/289501)

## Likes

Number of new likes.

Ruby Code: [discourse/app/models/concerns/reports/likes.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/likes.rb)

SQL Query: [Dashboard Report - Likes](https://meta.discourse.org/t/dashboard-report-likes/291092)

## Logged In

Number of new pageviews from logged in users.

Ruby Code: [discourse/app/controllers/admin/reports\_controller.rb#L5](https://github.com/discourse/discourse/blob/main/app/controllers/admin/reports_controller.rb#L5)

SQL Query: [Dashboard Report - Logged In](https://meta.discourse.org/t/dashboard-report-logged-in/291102)

## Moderator Activity

List of moderator activity including flags reviewed, reading time, topics created, posts created, personal messages created, and revisions.

SQL Query: [Dashboard Report - Moderator Activity](https://meta.discourse.org/t/dashboard-report-moderator-activity/291244)

## Moderator Warning

Number of warnings sent by personal messages from moderators.

Ruby Code: [discourse/app/models/concerns/reports/moderator\_warning\_private\_messages.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/moderator_warning_private_messages.rb)

SQL Query: [Dashboard Report - Moderator Warnings](https://meta.discourse.org/t/dashboard-report-moderator-warnings/291876)

## New Contributors

Number of users who made their first post during this period.

Ruby Code: [discourse/app/models/concerns/reports/new\_contributors.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/new_contributors.rb)

SQL Query: [Dashboard Report - New Contributors](https://meta.discourse.org/t/dashboard-report-new-contributors/291879)

## Notify Moderators

Number of times moderators have been privately notified by a flag.

Ruby Code: [discourse/app/models/concerns/reports/notify\_moderators\_private\_messages.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/notify_moderators_private_messages.rb)

SQL Query: [Dashboard Report - Notify Moderators](https://meta.discourse.org/t/dashboard-report-notify-moderators/291887)

## Notify User

Number of times users have been privately notified by a flag.

Ruby Code: [discourse/app/models/concerns/reports/notify\_user\_private\_messages.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/notify_user_private_messages.rb)

SQL Query: [Dashboard Report - Notify User](https://meta.discourse.org/t/dashboard-report-notify-user/292004)

## Overall Sentiment

Number of posts classified either positive or negative with the “Sentiment” AI, over a specified period.

Ruby Code: [https://github.com/discourse/discourse-ai/blob/main/lib/sentiment/entry\_point.rb](https://github.com/discourse/discourse-ai/blob/main/lib/sentiment/entry_point.rb)

SQL Query: [Dashboard Report - Overall Sentiment](https://meta.discourse.org/t/dashboard-report-overall-sentiment/295428)

## Pageviews

Number of new pageviews from all visitors. Same as the total for Consolidated Pageviews.

Discourse uses the follow query to determine total pageviews:

SQL Query: [Dashboard Report - Consolidated Pageviews](https://meta.discourse.org/t/dashboard-report-consolidated-pageviews/289263)

## Post Edits

Number of new post edits.

Ruby Code: [discourse/app/models/concerns/reports/post\_edits.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/post_edits.rb)

SQL Query: [Dashboard Report - Post Edits](https://meta.discourse.org/t/dashboard-report-post-edits/292019)

## Posts

New posts created during the selected time period

Ruby Code: [discourse/app/models/concerns/reports/posts.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/posts.rb)

SQL Query: [Dashboard Report - Posts](https://meta.discourse.org/t/dashboard-report-posts/288579)

## Post Emotion

Number of posts classified by AI with one of following emotions: Sadness, Surprise, Fear, Anger, Joy, Disgust - group by poster trust level, over a specified period.

Ruby Code: [https://github.com/discourse/discourse-ai/blob/main/lib/sentiment/entry\_point.rb](https://github.com/discourse/discourse-ai/blob/main/lib/sentiment/entry_point.rb)

SQL Query: [Dashboard Report - Post Emotion](https://meta.discourse.org/t/dashboard-report-post-emotion/295553)

## Reactions

List most recent reactions.

Ruby code: [discourse-reactions/plugin.rb at main · discourse/discourse-reactions · GitHub](https://github.com/discourse/discourse-reactions/blob/main/plugin.rb#L194)

SQL Query: [Dashboard Report - Reactions](https://meta.discourse.org/t/dashboard-report-reactions/292024)

## Signups

New account registrations for this period.

Ruby Code: [discourse/app/models/concerns/reports/signups.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/signups.rb)

SQL Query: [Dashboard Report - Signups](https://meta.discourse.org/t/dashboard-report-signups/288037)

## Site Traffic

Pageviews for logged in browsers, anonymous browsers, crawlers, and other traffic. This is the primary traffic report, replacing the legacy Consolidated Pageviews reports.

Ruby Code: [discourse/app/models/concerns/reports/site\_traffic.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/site_traffic.rb)

SQL Query: [Dashboard Report - Site Traffic](https://meta.discourse.org/t/dashboard-report-site-traffic/358667)

## Suspicious Logins

Details of new logins that differ suspiciously from previous logins.

Ruby Code: [discourse/app/models/concerns/reports/suspicious\_logins.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/suspicious_logins.rb)

SQL Query: [Dashboard Report - Suspicious Logins](https://meta.discourse.org/t/dashboard-report-suspicious-logins/294773)

## System

Number of personal messages sent automatically by the System.

Ruby Code: [discourse/app/models/concerns/reports/system\_private\_messages.rb](https://github.com/discourse/discourse/blob/main/app/models/report.rb#L369)

SQL Query: [Dashboard Report - System](https://meta.discourse.org/t/dashboard-report-system/293546)

## Time to first response

Average time (in hours) of the first response to new topics.

Ruby Code: [discourse/app/models/concerns/reports/time\_to\_first\_response.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/time_to_first_response.rb) + [discourse/discourse/blob/main/app/models/topic.rb#L1799-L1844](https://github.com/discourse/discourse/blob/main/app/models/topic.rb#L1799-L1844)

SQL Query: [Dashboard Report - Time to First Response](https://meta.discourse.org/t/dashboard-report-time-to-first-response/288597)

## Top Ignored / Muted Users

Users who have been muted and/or ignored by many other users.

Ruby Code: [discourse/app/models/concerns/reports/top\_ignored\_users.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_ignored_users.rb)

SQL Query: [Dashboard Report - Top Ignored / Muted Users](https://meta.discourse.org/t/dashboard-report-top-ignored-muted-users/293582)

## Top Referred Topics

Topics that have received the most clicks from external sources.

Ruby Code: [discourse/app/models/concerns/reports/top\_referred\_topics.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_referred_topics.rb)

SQL Query: [Dashboard Report - Top Referred Topics](https://meta.discourse.org/t/dashboard-report-top-referred-topics/288433)

## Top Referrers

Users listed by number of clicks on links they have shared.

Ruby Code: [discourse/app/models/concerns/reports/top\_referrers.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_referrers.rb)

SQL Query: [Dashboard Report - Top Referrers](https://meta.discourse.org/t/dashboard-report-top-referrers/288437)

## Top Traffic Sources

External sources that have linked to this site the most.

Ruby Code: [discourse/app/models/concerns/reports/top\_traffic\_sources.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_traffic_sources.rb)

SQL Query: [Dashboard Report - Top Traffic Sources](https://meta.discourse.org/t/dashboard-report-top-traffic-sources/288745)

## Top Uploads

List all uploads by extension, filesize and author.

Ruby Code: [discourse/app/models/concerns/reports/top\_uploads.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_uploads.rb)

SQL Query: [Dashboard Report - Top Uploads](https://meta.discourse.org/t/dashboard-report-top-uploads/288440)

## Top Users by likes received

Top 10 users who have received likes.

Ruby Code: [discourse/app/models/concerns/reports/top\_users\_by\_likes\_received.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_users_by_likes_received.rb)

SQL Query: [Dashboard Report - Top Users by Likes Received](https://meta.discourse.org/t/dashboard-report-top-users-by-likes-received/293714)

## Top Users by likes received from a user with a lower trust level

Top 10 users in a higher trust level being liked by people in a lower trust level.

Ruby Code: [discourse/app/models/concerns/reports/top\_users\_by\_likes\_received\_from\_inferior\_trust\_level.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_users_by_likes_received_from_inferior_trust_level.rb)

SQL Query: [Dashboard Report - Top Users by Likes Received from a User with a Lower Trust Level](https://meta.discourse.org/t/dashboard-report-top-users-by-likes-received-from-a-user-with-a-lower-trust-level/293717)

## Top Users by likes received from a variety of people

Top 10 users who have had likes from a wide range of people.

Ruby Code: [discourse/app/models/concerns/reports/top\_users\_by\_likes\_received\_from\_a\_variety\_of\_people.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_users_by_likes_received_from_a_variety_of_people.rb)

SQL Query: [Dashboard Report - Top Users by Likes Received From a Variety of People](https://meta.discourse.org/t/dashboard-report-top-users-by-likes-received-from-a-variety-of-people/293723)

## Topics

New topics created during this period.

Ruby Code: [discourse/app/models/concerns/reports/topics.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/topics.rb)

SQL Query: [Dashboard Report - Topics](https://meta.discourse.org/t/dashboard-report-topics/288446)

## Topics with no response

Number of new topics created that did not receive a response.

Ruby Code: [discourse/app/models/concerns/reports/topics\_with\_no\_response.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/topics_with_no_response.rb)

SQL Query: [Dashboard Report - Topics with No Response](https://meta.discourse.org/t/dashboard-report-topics-with-no-response/294002)

## Topic View Stats

Top 100 topics by views with anonymous and logged-in breakdowns, filterable by category.

Ruby Code: [discourse/app/models/concerns/reports/topic\_view\_stats.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/topic_view_stats.rb)

SQL Query: [Dashboard Report - Topic View Stats](https://meta.discourse.org/t/dashboard-report-topic-view-stats/349452)

## Trending Search Terms

Most popular search terms with their click-through rates.

Ruby Code: [discourse/app/models/concerns/reports/trending\_search.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/trending_search.rb)

SQL Query: [Dashboard Report - Trending Search Terms](https://meta.discourse.org/t/dashboard-report-trending-search-terms/288562)

## Trust Level growth

Number of users who increased their Trust Level during this period.

The Trust Level Growth report is pulling data from the `user_histories` table in the Discourse database. Specifically, this report is counting the number of times a `user_histories.action` is recorded for an increase in a user trust level.

Ruby Code: [discourse/app/models/concerns/reports/trust\_level\_growth.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/trust_level_growth.rb)

SQL Query: [Dashboard Report - Trust Level Growth](https://meta.discourse.org/t/dashboard-report-trust-level-growth/294418)

## Unaccepted policies

This dashboard report identifies topics with policies that have not been accepted by certain users.

Ruby code: [discourse-policy/plugin.rb at main · discourse/discourse-policy · GitHub](https://github.com/discourse/discourse-policy/blob/main/plugin.rb#L159)

SQL Query: [Dashboard Report - Unaccepted Policies](https://meta.discourse.org/t/dashboard-report-unaccepted-policies/294432)

## User Flagging Ratio

List of users ordered by ratio of staff response to their flags (disagreed to agreed).

Ruby Code: [discourse/app/models/concerns/reports/user\_flagging\_ratio.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/user_flagging_ratio.rb)

SQL Query: [Dashboard Report - User Flagging Ratio](https://meta.discourse.org/t/dashboard-report-user-flagging-ratio/294442)

## User notes

List most recent user notes.

Ruby code: [discourse-user-notes/plugin.rb at main · discourse/discourse-user-notes · GitHub](https://github.com/discourse/discourse-user-notes/blob/main/plugin.rb#L153)

SQL Query: [Dashboard Report - User Notes](https://meta.discourse.org/t/dashboard-report-user-notes/294785)

## User Profile Views

Total new views of user profiles.

Ruby Code: [discourse/app/models/concerns/reports/profile\_views.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/profile_views.rb)

SQL Query: [Dashboard Report - User Profile Views](https://meta.discourse.org/t/dashboard-report-user-profile-views/294477)

## User Visits

The total number of logged-in user visits in the forum for the selected time period (today, yesterday, last 7 days, etc).

A User Visit is counted anytime a unique logged in user visits the site, up to once per day. For example, if a user visited a site every day within a week, Discourse would count that as 7 user visits.

Ruby Code: [discourse/app/models/concerns/reports/visits.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/visits.rb)

SQL Query: [Dashboard Report - User Visits](https://meta.discourse.org/t/dashboard-report-user-visits/294620)

## User Visits (mobile)

Number of unique logged-in users who visited using a mobile device.

Ruby Code: [discourse/app/models/concerns/reports/mobile\_visits.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/mobile_visits.rb)

SQL Query: [Dashboard Report - User Visits](https://meta.discourse.org/t/dashboard-report-user-visits/294620)

## User-to-User (excluding replies)

Number of newly initiated personal messages.

Ruby Code: [discourse/app/models/concerns/reports/user\_to\_user\_private\_messages.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/user_to_user_private_messages.rb)

SQL Query: [Dashboard Report - User-to-User](https://meta.discourse.org/t/dashboard-report-user-to-user/288459)

## User-to-User (with replies)

Number of all new personal messages and responses.

Ruby Code: [discourse/app/models/concerns/reports/user\_to\_user\_private\_messages\_with\_replies.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/user_to_user_private_messages_with_replies.rb)

SQL Query: [Dashboard Report - User-to-User](https://meta.discourse.org/t/dashboard-report-user-to-user/288459)

## Users per Trust Level

Number of users grouped by trust level.

Ruby Code: [discourse/app/models/concerns/reports/users\_by\_trust\_level.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/users_by_trust_level.rb)

SQL Query: [Dashboard Report - Users Per Trust Level](https://meta.discourse.org/t/dashboard-report-users-per-trust-level/288565)

## Users per Type

Number of users grouped by admin, moderator, suspended, and silenced.

Ruby Code: [discourse/app/models/concerns/reports/users\_by\_type.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/users_by_type.rb)

SQL Query: [Dashboard Report - Users Per Type](https://meta.discourse.org/t/dashboard-report-users-per-type/288569)

## Web Crawler Pageviews

Total pageviews from web crawlers over time.

Ruby Code: [discourse/app/models/report.rb](https://github.com/discourse/discourse/blob/main/app/models/report.rb#L209-L214)

SQL Query: [Dashboard Report - Web Crawler Pageviews](https://meta.discourse.org/t/dashboard-report-web-crawler-pageviews/294745)

## Web Crawler User Agents

List of web crawler user agents, sorted by pageviews.

Ruby Code: [discourse/app/models/concerns/reports/web\_crawlers.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/web_crawlers.rb)

SQL Query: [Dashboard Report - Web Crawler User Agents](https://meta.discourse.org/t/dashboard-report-web-crawler-user-agents/294762)

> Last edited by @meghna 2026-09-02T06:44:34Z
> 
> Last checked by @JonathanG 2026-04-14T03:52:32Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 28, 2022, 1:28pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/3 "2022-09-28T13:28:27Z")

</div>

> [@SaraDev](#):
>
> Discourse contains several built-in Admin Dashboard Reports that can be useful for exploring stats about a community. To access these reports, you can visit `/admin/dashboard/reports` on your site.

I don’t see a link to this on `/admin`. Am I failing to read? It would seem that this should be more discoverable. I think that I knew that these reports were here but looked and couldn’t find them.

Though it took me just a few minutes to find, it might be nice to add something like

> [@](#):
>
> Plugins can add reports to the dashboard with `add_report(name, &block)`.

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [September 28, 2022, 3:28pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/4 "2022-09-28T15:28:32Z")

</div>

> [@pfaffman](#):
>
> I don’t see a link to this on `/admin`.

 ![Screenshot 2022-09-28 at 08-26-34 Admin - Sandbox Discourse Kit](https://global.discourse-cdn.com/meta/original/4X/0/9/7/09725670a9a6bba9863b1f0f09ca03d45166fdf1.png)

> [@pfaffman](#):
>
> It would seem that this should be more discoverable. I think that I knew that these reports were here but looked and couldn’t find them.

Yeah, might be nice in a PM to staff to mention them when a site is first created. 🤔

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 28, 2022, 3:33pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/5 "2022-09-28T15:33:11Z")

</div>

😿

Sorry. I sure **thought** I’d seen it somewhere before.

You just can’t get people to read stuff. . . .Except I could read the source code to find how to do it in a plugin?

But maybe update the above to

> [@SaraDev](#):
>
> . To access these reports, you can visit `/admin/dashboard/reports` on your site _or click the **reports** link on the dashboard_.

I think that might be what really threw me. (But no, I have no excuse.)

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [September 28, 2022, 3:40pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/6 "2022-09-28T15:40:07Z")

</div>

> [@pfaffman](#):
>
> But maybe update the above to

I made the topic a wiki, go for it! 👍

---

<div class="post-metadata">

### Author: ![hello-smile6](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hello-smile6/32/304628_2.png) [@hello-smile6](https://meta.discourse.org/u/hello-smile6)
#### Post date: [May 19, 2023, 1:06am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/7 "2023-05-19T01:06:36Z")

</div>

> [@SaraDev](#):
>
> Aim for \>30%.

That doesn’t match the UI (the UI uses 20%), which one should it be?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 19, 2023, 4:55am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/8 "2023-05-19T04:55:35Z")

</div>

Nice catch. It was recently updated to 20%. I’ll make the change in the OP. 🙂 👍

> [@Is there a difference in target retention rate between a support-first forum and discussion-first forum?](https://meta.discourse.org/t/is-there-a-difference-in-target-retention-rate-between-a-support-first-forum-and-discussion-first-forum/259940/10):
>
> Here’s a PR with that change: Longer term, I think a more nuanced approach could be powerful. I’d love for communities to be able to set their own goals (with some guidance like what you shared above about why they might choose one vs. the other) and use the dashboard or other related features to help them track their results vs. what they are aiming for.

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [November 30, 2023, 2:53pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/13 "2023-11-30T14:53:51Z")

</div>

> [@SaraDev](#):
>
> ## Top Traffic Sources
> 
> External sources that have linked to this site the most.
> 
> Ruby Code: [discourse/app/models/concerns/reports/top\_traffic\_sources.rb](https://github.com/discourse/discourse/blob/main/app/models/concerns/reports/top_traffic_sources.rb)

Hi @SaraDev Can this report output be obtained with an SQL query? Can you share it?  
Thanks

---

<div class="post-metadata">

### Author: ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)
#### Post date: [November 30, 2023, 8:19pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/14 "2023-11-30T20:19:49Z")

</div>

> [@Yotam\_Hagay](#):
>
> Hi @SaraDev Can this report output be obtained with an SQL query? Can you share it?  
> Thanks

Yes, you can use the following SQL report for Top Traffic Sources:

```sql
-- [params]
-- date :start_date = 01/05/2023
-- date :end_date = 03/06/2023

WITH count_links AS (
  
SELECT COUNT(*) AS clicks,
       ind.name AS domain
FROM incoming_links il
  INNER JOIN posts p ON p.deleted_at ISNULL AND p.id = il.post_id
  INNER JOIN topics t ON t.deleted_at ISNULL AND t.id = p.topic_id
  INNER JOIN incoming_referers ir ON ir.id = il.incoming_referer_id
  INNER JOIN incoming_domains ind ON ind.id = ir.incoming_domain_id
WHERE t.archetype = 'regular'
  AND il.created_at::date BETWEEN :start_date AND :end_date 
GROUP BY ind.name
ORDER BY clicks DESC
), 

count_topics AS (
  
SELECT COUNT(DISTINCT p.topic_id) AS topics,
       ind.name AS domain
FROM incoming_links il
INNER JOIN posts p ON p.deleted_at ISNULL AND p.id = il.post_id
INNER JOIN topics t ON t.deleted_at ISNULL AND t.id = p.topic_id
INNER JOIN incoming_referers ir ON ir.id = il.incoming_referer_id
INNER JOIN incoming_domains ind ON ind.id = ir.incoming_domain_id
WHERE t.archetype = 'regular'
  AND il.created_at > (CURRENT_TIMESTAMP - INTERVAL '30 DAYS')
GROUP BY ind.name
) 

SELECT cl.domain, 
       cl.clicks AS "Clicks", 
       ct.topics AS "Topics"
FROM count_links cl
JOIN count_topics ct ON cl.domain = ct.domain
LIMIT 10

```

With this query note that the date parameters accepts dates in the format of `day/month/year`.

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 2, 2023, 10:49pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/16 "2023-12-02T22:49:12Z")

</div>

> [@SaraDev](#):
>
> Yes, you can use the following SQL report for Top Traffic Sources:
> 
> ```plaintext
> 
> ```

Hi @SaraDev, thank you for sharing the query.  
A more general question reg this report, and the incoming\_links table actually - it only represents traffic for posts pages and not the traffic to all the forum pages, right?

Context: I’m looking to analyze trends in the forum overall traffic and I was hoping to get the overall traffic by sources from the Top Traffic Sources report.  
But while the overall traffic is ~ 272K in the last month (users and anons), the total clicks in the traffic sources report for the same timeframe is only 59K.  
Also, I see that you use inner join with the topics and posts tables which means that if there is no post\_id attached to the click you don’t count it.

Can you please confirm my conclusion and perhaps explain a bit about the logic behind the incoming\_links table?

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 3, 2023, 1:53pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/17 "2023-12-03T13:53:24Z")

</div>

> [@SaraDev](#):
>
> ## Posts
> 
> New posts created during this period

Hi @SaraDev I ran this query and the result does not precisely match the Posts report in the general tab.  
E.G for Nov 30th:  
Query = 112 posts  
Report = 120 posts  
Can you please check the gap?  
Thanks

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 3, 2023, 3:48pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/18 "2023-12-03T15:48:09Z")

</div>

Just an FYI @Yotam_Hagay - even though Sara’s the OP, the guide is the responsibility of everyone 🙂 :discourse: There’s no need for an @mention on each post. 🙂

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 5, 2023, 6:19am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/19 "2023-12-05T06:19:28Z")

</div>

Thank you @JammyDodger for clarifying.  
Is there anyone else I can tag or turn to to get an answer?

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 5, 2023, 8:29am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/20 "2023-12-05T08:29:07Z")

</div>

> [@SaraDev](#):
>
> SQL Time to first response
> 
> ```plaintext
> --[params]
> -- date :date_start
> -- date :date_end
> 
> WITH first_reply AS (
> SELECT 
> p.topic_id, 
> MIN(post_number) post_number, 
> t.created_at
> FROM posts p
> INNER JOIN topics t ON (p.topic_id = t.id)
> WHERE p.deleted_at IS NULL
> AND p.post_number != 1
> AND p.post_type = 1
> AND p.user_id > 0
> AND t.user_id > 0
> AND t.deleted_at IS NULL
> AND t.archetype = 'regular'
> AND t.created_at::date BETWEEN :date_start AND :date_end
> GROUP BY p.topic_id, t.created_at
> ORDER BY 2 DESC
> )
> 
> SELECT 
> p.topic_id, 
> fr.created_at::date dt_topic_created,
> (p.created_at - fr.created_at) response_time
> FROM posts p
> INNER JOIN first_reply fr 
> ON fr.topic_id = p.topic_id 
> AND fr.post_number = p.post_number
> AND p.created_at > fr.created_at
> ORDER BY response_time
> 
> ```

The results of this query are slightly different than the Time to first response report:  
On November 8th for example:  
Query: 93 Hours  
Report: 116 Hours  
Can someone advise?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 5, 2023, 8:34am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/21 "2023-12-05T08:34:42Z")

</div>

I think some of these may take some time to research. I’m having a look into it myself to see if I can see what’s going on (though the gap between my SQL skills and my ruby skills is quite large 🙂).

But keep the findings coming as it would be great to firm all this information up. 👍

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 5, 2023, 9:29am UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/22 "2023-12-05T09:29:16Z")

</div>

> [@Yotam\_Hagay](#):
>
> Hi @SaraDev I ran this query and the result does not precisely match the Posts report in the general tab.  
> E.G for Nov 30th:  
> Query = 112 posts  
> Report = 120 posts  
> Can you please check the gap?  
> Thanks

For the Posts one, I think the stock report is also counting topic posts as well as ones from system users, but also only targeting those with `post_type` 1 (that is, not whispers, small action posts, or moderator actions)

I think the SQL would look more like this:

```sql
--[params]
-- date :start_date
-- date :end_date

SELECT 
    p.created_at::date AS "Day",
    COUNT(p.id) AS "Count"
FROM posts p
INNER JOIN topics t ON t.id = p.topic_id AND t.deleted_at ISNULL
WHERE p.created_at::date BETWEEN :start_date AND :end_date
    AND p.deleted_at ISNULL
    AND t.archetype = 'regular'
    AND p.post_type = 1
GROUP BY p.created_at::date
ORDER BY 1

```

Could you run that on your site and see if it marries up?

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 5, 2023, 1:39pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/23 "2023-12-05T13:39:24Z")

</div>

Thanks Jammy, will check!  
I’m currently working on a Time to first response analysis so I’d appreciate if you could take a look at this one as well.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 5, 2023, 2:50pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/24 "2023-12-05T14:50:40Z")

</div>

Having a look at the SQL version, I think it’s missing the `AND p.user_id <> t.user_id` to exclude replies from the OP. If I add that in it gives me the accurate time between the OP and the first response from someone else:

```sql
--[params]
-- date :date_start
-- date :date_end

WITH first_reply AS (
    SELECT 
        p.topic_id, 
        MIN(post_number) post_number, 
        t.created_at
    FROM posts p
    INNER JOIN topics t ON (p.topic_id = t.id)
    WHERE p.deleted_at IS NULL
        AND p.user_id <> t.user_id
        AND p.post_number != 1
        AND p.post_type = 1
        AND p.user_id > 0
        AND t.user_id > 0
        AND t.deleted_at IS NULL
        AND t.archetype = 'regular'
        AND t.created_at::date BETWEEN :date_start AND :date_end
    GROUP BY p.topic_id, t.created_at
    ORDER BY 2 DESC
)

SELECT 
    p.topic_id, 
    fr.created_at::date dt_topic_created,
    (p.created_at - fr.created_at) response_time
FROM posts p
INNER JOIN first_reply fr 
    ON fr.topic_id = p.topic_id 
    AND fr.post_number = p.post_number
    AND p.created_at > fr.created_at
ORDER BY response_time

```

I also think the stock report is in decimal rather than hours and minutes like the SQL. I’ll have another crack at getting it to match. 👍

* * *

Just a small update to include the `AVG` so it’s more similar to the output of the stock report:

```sql
--[params]
-- date :date_start
-- date :date_end

WITH first_reply AS (
    SELECT 
        p.topic_id, 
        MIN(post_number) post_number, 
        t.created_at
    FROM posts p
    INNER JOIN topics t ON p.topic_id = t.id
    WHERE p.deleted_at IS NULL
        AND p.user_id <> t.user_id
        AND p.post_type = 1
        AND p.user_id > 0
        AND t.user_id > 0
        AND t.deleted_at IS NULL
        AND t.archetype = 'regular'
        AND t.created_at::date BETWEEN :date_start AND :date_end
    GROUP BY p.topic_id, t.created_at
)

SELECT 
    fr.created_at::date dt_topic_created,
    AVG(p.created_at - fr.created_at) response_time
FROM posts p
INNER JOIN first_reply fr 
    ON fr.topic_id = p.topic_id 
    AND fr.post_number = p.post_number
    AND p.created_at > fr.created_at
GROUP BY fr.created_at::date
ORDER BY response_time

```

This seems to marry up with the stock report as long as you take into account that one is in decimal and one in HH:MM. I’m sure there’s a way to convert the SQL `response_time` to decimal but the HH:MM seems like a more intuitive way of doing it. (I think there are also some extra criteria in there that may not be necessary, but also could be a safety guard against unusual circumstances, so I’ve ultimately left those bits as is until I can say for sure one way or the other 🙂)

Could you run this one and see how it matches up?

---

<div class="post-metadata">

### Author: ![Yotam\_Hagay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yotam_hagay/32/324059_2.png) [@Yotam\_Hagay](https://meta.discourse.org/u/Yotam_Hagay)
#### Post date: [December 6, 2023, 2:37pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/25 "2023-12-06T14:37:47Z")

</div>

Yes, it now adds up to the numbers shown in the stock report, thank you!  
Just one comment -  
I found that the Avg function below brings back missing results in case the time is \> 24h (a # of days section is missing I guess).

> AVG(p.created\_at - fr.created\_at)::time response\_time

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 6, 2023, 4:11pm UTC](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233/26 "2023-12-06T16:11:49Z")

</div>

Ah yes, casting to `time` was a poor choice. 🙂 If you remove the `::time` it will revert back to the more accurate (though harder on the eyes) version.

I’ll edit the one above as well. 👍

[Next page](https://meta.discourse.org/t/admin-dashboard-report-reference-guide/240233.md?page=2)
