At Focused Support we use Confluence and JIRA for internal development activities so when we were looking for an external facing customer support solution, JIRA Service Desk hosted in Atlassian Cloud made perfect sense. We especially like the ability to use Confluence as a "Knowlege Base" so that customers could potentially resolve their issue without needing to contact us. We also use the knowledge base internally to help solve customer issues when they do directly contact us.

Almost as soon as we got up and running we started to wonder how much our knowledge base was actually being utilized and which articles were the most popular. Confluence has a "site activity" plugin which is disabled by default, but after contacting Atlassian we discovered that it can not be enabled in Atlassian Cloud so that solution was out. The popular Google Analytics Plugin is not available for the cloud, and HTML Macros are not available in Confluence cloud so you can't just manually add the Google Analytics javascript.

We use Google Analytics for our other sites and wanted to continue to use it for Confluence Cloud but the unavailability of the plugin and restriction on the use of external Javascript means that we needed another way to track pageviews. Unfortunately our current solution requires the manual addition of a 1x1 pixel image to each Confluence Page, but ultimately it provides us with the information we're looking for so it's worth the pain. The Analytics Measurement Protocol documentation page provided the information needed to manually craft the image URL to be inserted into each Confluence page.

On each page that you want to track, select the "Images from the web" option from the "Insert -> Files and Images". For the image URL, enter a URL with the following parameters:

Google Analytics URL Structure

All values will be the same for each Confluence page that you add this image too, except for dp.

  • tid Is your Google Analytics tracking ID
  • dh Is your Atlassian Cloud URL
  • dp Is the unique name of your page. This is how the pageview will be reported to Google Analytics and should be unique for each page. It should probably match the name of the Confluence page that you are adding the tracking image to and it must be URL encoded.

Once the image is there, it's pretty much impossible to find it again. This can be a problem if you want to remove it, or verify that it hasn't been accidentally removed. Being able to view the source of each page using the Source Editor plugin can help with this.

Adam Stull