Confluence SQL query for pageviews by user?

Hi,

I'm developing a Confluence usage index for our staff and would like to run a SQL query that provides a count of pageviews by user the last three months.

I already have SQL queries for comments by user, page edits by user, and page creation by user. Is there any way to get the pageviews, too? Ideally, my table would look like this:

||User name||Pageview count||

|John Doe|165|

|Jane Smith|145|

|Texas Pete|25|

5 answers

1 accepted

Confluence does not store content view statistics in the database, unfortunately.

On a related note, the Usage Tracking Plugin work around this by creating its own indexes.

Azwandi,

At my company, we would like a list of page views by space, for all spaces. We want something that is similar to the "Most Popular Spaces (Views)" list in the Confluence Admin/Global Activity page -- but for all spaces. If the page view data is not stored in the database, where is it stored? The "Most Popular Spaces (Views)" list must be getting its data from somewhere.

Thanks.

Brad

Let me suggest an alternative metric for "popularity", different from the SUM(PAGEVIEWS) per space.

The page view tracking feature of the Archiving Plugin logs the last view date on each page. These are written to the AO_xxx_PAGE_VIEW table in your database, keyed with the page ID. You can easily write an SQL query to merge the page table with their last view date, and aggregate those records by space in some way.

mysql> SELECT * FROM AO_1991C6_PAGE_VIEW;
+-----+---------+-------------+---------------------+
| ID  | PAGE_ID | VIEWER_NAME | VIEW_DATE           |
+-----+---------+-------------+---------------------+
|  50 | 2470703 | admin       | 2013-09-18 16:52:04 |
| 134 | 2470468 | admin       | 2013-09-18 16:52:09 |
| 139 | 2470823 | admin       | 2013-09-18 16:52:04 |
...

For example, you could compute an AVG(LAST_PAGE_VIEW_DATE) per space as to measure "activity level" (or "popularity"). (Hint: use some very old date for those pages for which there is no page view date logged.)

We also developed a custom plugin some time ago exactly for this purpose: Viewtracker plugin

fyi... see Site Statistics for similar things. Also, you can contribute to that.

@Remo Siegwart Could you provide a reference for read-only accessing the viewtracker stats, please?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

450 views 21 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you