Building a user tracking dashboard for Confluence administrators

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?

<ac:structured-macro ac:macro-id="9dc3ddd5-d509-4f3e-b7e7-418e4f38a91e" ac:name="report-table" ac:schema-version="1"> <ac:parameter ac:name="injected">true</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="f719701f-5cab-4026-aa8e-a3c0a1574c6e" ac:name="user-reporter" ac:schema-version="1"> <ac:parameter ac:name="groups">conf-users</ac:parameter> <ac:rich-text-body> <p> <br/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="26d38923-0ab2-4230-9ffc-94d15dcba98e" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">User Profile</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="ad65c475-c34e-4ddb-ab73-d5dc68252694" ac:name="report-image" ac:schema-version="1"> <ac:parameter ac:name="width">100px</ac:parameter> <ac:parameter ac:name="verticalalign">middle</ac:parameter> <ac:parameter ac:name="height">100px</ac:parameter> <ac:parameter ac:name="">user:picture</ac:parameter> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="74bbd9ea-5a3a-4539-ad04-6ef86793e728" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">User Name</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="81bce228-7b66-44f8-9936-3750757f9890" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">user:name</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="d6f4a113-725a-4fd6-a576-a9e26ec7d719" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Last Login</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="de67923f-efef-4b72-980a-5892320b61d0" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">user:last login date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="811ae9be-8d0c-4ef5-8965-1f358e7fa9a4" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Groups</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="bd05a5c8-89ea-42ac-8234-fc1e1c3875eb" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">user:groups</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="9c56e3af-5820-4248-bf79-cd07e2eff7fe" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title"># of Pages Authored</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="64bee0ff-3c05-4fed-9a5a-040bc97b13f9" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">user:authored pages count</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="3161b475-58dc-4576-a2ef-a549ebb0c537" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Pages Authored</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="0f192e22-1cfa-45aa-8abf-0f0655f8bd07" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">user:authored pages</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="bcb17c02-8c41-41bf-b040-d5536d96df8e" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Pages Modified</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="cc97d292-5852-4c10-a99a-756d8668514b" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">user:recently modified content</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro>

 

Building this use case

Setting up the report columns

We start by setting up the report columns.

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

User Name

This allows Reporting to fetch the user profile and provide a link to their personal space.

Last Login

This column returns the last login date for the user.

Groups

This column returns the groups in which the user belongs.

# of Pages Authored

This column returns the number of pages created by the user.

Pages Authored

This column returns the pages which was created by the user.

Pages Modified

This column returns the pages which was recently modified by the user.

Macro structure