Building a user tracking dashboard for Confluence administrators
Overview
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 the Reporting app built-in suppliers plus a number of other macros we can build a dashboard that can easily track the activity of your users.
Reporting is used to build a dynamic table that will display
each user in a particular Confluence user group
their last login details
what other groups they belong to
the number of pages they authored
what pages they authored
what pages they modified
This is similar to the example below.
Ingredients
Confluence apps
You will need the Reporting app installed on your Confluence instance.
Suppliers
You will also need to use the following suppliers
Full source code
The following source code is shared using Confluence Storage Format. This is 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 - How do I use Recipes that use the Storage Format with the Confluence Source Editor?
Building this use case
Setting up the report columns
We start by setting up the report columns.
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
add the user-report block
nest this block inside the Report Table macro
edit the User Reporter macro
type "confluence-users" in User Groups parameter
This sets Reporting to fetch only 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 adds 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"
set Height and Width parameters to "100px"
User Name
This allows Reporting to fetch the user 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"check the Link To parameter
Last Login
This column returns the last login date for the user.
insert a Report Column macro
name this column "Last login date"
insert a Report Info macro inside this Report Column macro
edit the Report Info macro
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
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.
insert a Report Info macro inside the Report Column macro
edit the Report Info macro
name the Key parameter "
user:recently modified content"
Macro structure
Content Reporter can be further edited to address specific spaces
User Reporter can be further edited to address specific spaces