Building a user tracking dashboard for Confluence administrators
As Confluence admin, you are responsible for administrating your Confluence instance and keeping track of users and their activities.
But how do we go about doing that? Using REP's built-in Suppliers as well as a few choice macros we can build a dashboard so that you can easily track the activity of your users.
Using Reporting, we'll build a dynamic table that will display each user in a particular Confluence user group, their last login details, which other groups they belong to, the number of pages they authored, what pages they authored, and what pages they modified.
The end result will look something like this:
Check it out!
Full source code
The following source code is shared using Confluence Storage Format, the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments.
For more information on how to use this source code on your Confluence, read the following article:
Building this use case
Setting up the report columns
We start by setting up the report columns.
- First, create a Report Table macro. This will be the main structure of our report, which is a table.
- Next, define what to report using a User Reporter macro. Nest this block inside the Report Table macro.
- Edit the User Reporter macro, and type "confluence-users" in User Groups parameter. This means Reporting will only fetch users from the "confluence-users" group. You can specify a different group name based on existing groups you have in your Confluence instance.
User Profile
This will add the user profile picture into the dashboard.
- Within the Report Table macro, insert a Report Column macro underneath the User Reporter macro. Name this column "User Profile".
- Insert a Report Image macro inside this Report Column macro.
- Edit the Report Image macro, name the Key parameter "
user:picture
".
Set verticalalign parameter to "middle", Height and Width parameters to "100px".
User Name
This will allow Reporting to fetch the user's profile and provide a link to their personal space.
- Insert a Report Column macro, name this column "User name".
- Insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro, name the Key parameter "
user:name to
" and check the Link To parameter.
Last Login
This column returns the user's last login date.
- Insert a Report Column macro and name this column "Last login date".
- Insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro and name the Key parameter "
user:last login date
".
Groups
This column returns the groups in which the user belongs.
- Insert a Report Column macro, name this column "Group".
- Insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro, name the Key parameter "
user:groups
".
# of Pages Authored
This column returns the number of pages created by the user.
- Insert a Report Column macro and name this column "# of Pages Authored".
- Insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro, name the Key parameter "
user:authored pages count
".
Pages Authored
This column returns the pages which was created by the user.
- Insert a Report Column macro, name this column "Pages Authored".
- Insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro, name the Key parameter "
user:authored pages count
".
Pages Modified
This column returns the pages which was recently modified by the user.
- Finally, insert a Report Info macro inside this Report Column macro.
- Edit the Report Info macro, name the Key parameter "
user:recently modified content
".
Macro structure
Tips
- Content Reporter can be further edited to address specific spaces.
- User Reporter can be further edited to address specific spaces.