16

I am using the REST Confluence API to retrieve a bunch of data around our Confluence pages, such as version, last modified, created, etc. However, I don't see any way to retrieve page views.

Do you know if this is accessible through any of their APIs?

Dijkgraaf
  • 9,324
  • 15
  • 34
  • 48
leora
  • 163,579
  • 332
  • 834
  • 1,328
  • You've probably done the basics -- but can you just give a brief sentence or two about why just an analytics script (https://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/) didn't work for you? I was considering this and dont want to get all the way down the path and run into the problems you might have.... – bri Jan 15 '16 at 04:36

1 Answers1

11

ViewTracker Plugin:

By default, no pageviews or page counts are recorded in Confluence due to performance reasons; however, after installing and configuring the Confluence ViewTracker Plugin you will start recording this data.

However, there is no mention anywhere on whether or not this information is available through the API. The plugin doesn't have an API, and it's not clear whether or not the additional information is available via an API. The ViewTracker Documentation does define a macro that returns the count, so the information is clearly stored in the database.

view count - The number of times the content has been viewed since the firstViewed date.

If this information is not returned by an API, then you may need to put in a feature request with the maintainer of the plugin.

Confluence Google Analytics Plugin:

If the ViewTracker plugin does not meet your needs, doesn't have an API, and the developers don't intend to expose one, then your other option is to install the Confluence Google Analytics Plugin.

Unlike ViewTracker, it's not free. However, you do gain programmatic access to this data through Google Analytics. Google exposes a Core Reporting API that would allow you programmatic access to the number of pageviews, visits, and other metrics reported by the analytics code.

Google supplies examples and documentation on how to get the data using Java, PHP, Python, and JavaScript.

jmort253
  • 32,054
  • 10
  • 92
  • 114
  • @mliebelt - Right, I'm not sure if the price is for the number of users on the Confluence site or the number of users accessing the analytics. That could make a difference. Also, I was wondering if there was perhaps a way to get Google Analytics on the site by writing your own plugin! When I put GA on my site, it's free, so why couldn't it be free on Confluence as well ;) The developers of that GA Confluence plugin are making quite the profit. – jmort253 May 26 '12 at 11:33
  • FWIW, Atlassian had its own Usage Tracking plugin (https://ecosystem.atlassian.net/wiki/x/AQCRAg) but it's disabled by default for performance reasons. No API in that, as well. – sendmoreinfo Jul 03 '15 at 08:52