Skip to main content
Version: 2.x

Statistics

Statistics: a statistics widget on the admin dashboard. Bundled with Flarum 2.0.

The Statistics extension (flarum/statistics) shows how active your forum is: how many members, discussions and posts it has, and how those numbers change over time. It is a bundled extension, and it is enabled by default.

Statistics are only shown to administrators.

For developers

Any extension can add its own statistics alongside the built-in ones. See Adding statistics for the developer guide.

Installation​

The extension ships with Flarum and is enabled on new installs. If you have disabled it, enable it again from the Extensions page of the admin panel.

If it is not present in your install, require it like any other package:

composer require flarum/statistics
php flarum cache:clear

The dashboard widget​

The Forum statistics widget on the admin panel's Dashboard shows the total of each statistic. Click View more statistics to open the statistics page.

The statistics page​

Open the statistics page with View more statistics on the dashboard widget, or from the extension's entry in the admin panel's navigation.

Each statistic has a tile showing:

  • its total;
  • its count for the selected period;
  • how much that count has risen or fallen since the period before, as a percentage.

Click a tile to chart that statistic. The chart plots the selected period alongside the period before it, so you can compare the two. Click Export chart to SVG to download the chart as an image.

Periods​

Choose the period from the dropdown to the left of the tiles. Last 7 days is selected when the page opens.

PeriodCharted by
TodayHour
Last 7 daysDay
Previous 7 daysDay
Last 28 daysDay
Previous 28 daysDay
Last 12 monthsWeek
Choose custom range...Day

Choose custom range... asks for a start and an end date, both included. For a custom range, the tiles show no percentage change.

Days run from midnight to midnight UTC, whatever your forum's or your browser's time zone.

What is counted​

StatisticWhat it countsDated by
UsersEvery member account, whether or not its email address has been confirmed.When the member joined.
DiscussionsEvery discussion, including hidden and private ones.When the discussion was started.
PostsEvery comment post, including hidden and private ones. Event posts, such as "renamed the discussion", are not counted.When the post was made.

The statistics count what is in your forum's database, not what visitors can see, so hidden and private content is included. Content that has been deleted permanently is no longer counted, so totals and past counts can go down.

Other extensions can add their own statistics, which appear after the built-in ones. For example, the Messages extension (flarum/messages) adds:

StatisticWhat it countsDated by
PM startedEvery private conversation.When the conversation started.
PM repliesEvery private message after a conversation's first.When the message was sent.

How current the numbers are​

So that the statistics stay fast on large forums, the numbers are kept for a short time before they are counted again:

NumbersCounted again after
Totals5 minutes
Counts for the periods in the dropdown15 minutes
Counts for a custom rangeCounted each time you choose one

Clearing the cache, with Clear Cache on the dashboard or php flarum cache:clear, counts everything again the next time the statistics are opened.