JavaScript / User Analytics - Confluence Cloud
Asked by Jon Simone:

*This question is in reference to Atlassian Documentation: [How to use JavaScript in Confluence](https://confluence.atlassian.com/pages/viewpage.action?pageId=313458839)*

Hello,

I am desperately trying to gather as much user analytics as humanly possible from our Confluence Cloud instance.

Here is a quick run down:

1. I have read this article about viewing Site Statistics but this does not give us nearly as much information as we need: <https://confluence.atlassian.com/doc/viewing-site-statistics-123043962.html> BTW, anyone know if there is a way to pull more than just the top 10 viewed pages in each space? That info must live somewhere.
2. I have also read this article about using add-ons to gather data: <https://confluence.atlassian.com/confkb/how-do-i-get-more-statistics-from-confluence-154239308.html> but these require using the server version of Confluence (which is not an option for us at this time).
3. Our company uses Looker and Snow Plow and with these tools and a little help from JavaScript we are able to track all sorts of data and events.

So here are my questions:

1. Is there a way to insert Javascript into the head tag on every page as mentioned in this article: <https://confluence.atlassian.com/confkb/how-to-use-javascript-in-confluence-313458839.html> (This article looks like it may be out of date or that it does not apply to the Cloud version of Confluence).

2. If we are able to insert Javascript does anyone have an idea how we can grab the email address of each logged in user?

The main things I need are:

1. The ability to see page views for every single page (and hopefully the ability to see how many unique visits there are).
2. The ability to see which pages each particular user has viewed.

I appreciate any help or suggestions!

Thank you!


Answers:
author: Thomas Alfred
body: Drop [david@davidsimpson.me](mailto:david@davidsimpson.me) an email if you'd like to try out Google Analytics in Confluence Cloud. He should be able to help you out.

comments: author: David at David Simpson Apps
body: Yes, my [Google Analytics add-on for Confluence Cloud](https://marketplace.atlassian.com/plugins/me.davidsimpson.confluence.addon.google-analytics-for-confluence/cloud/overview) is now in the Marketplace after a year of closed beta ;)


author: Tim
body: Hi Jon,

We've created an analytics add-on for Confluence Cloud that makes it easy to get an overview of activity and also zoom in on the details like who has viewed a particular page.

You can find more information here: [Analytics for Confluence Cloud](https://marketplace.atlassian.com/plugins/com.addonengine.analytics/cloud/overview)

Hope it helps!


author: Huiyi
body: Hi Jon,

I am not a geek, so I cannot comment on the technical side of your questions. However, in terms of the "main things you need", mentioned above, I can give you some suggestion.

Our engineer created a plugin for our internal use previously, to connect GoogleAnalytics with Confluence Cloud, as I was very disturbed by the fact that there's little analytics available on Cloud. We saw that many people have the same problem like we do, so in early March we decided to put the plugin in the marketplace. It's free at the moment, so give it try, maybe it helps. Here is the setup guide.

1. The ability to see page views for every single page including unique visitors.

Yes, you can see this through google analytics after you connect your confluence cloud via our Plugin. Sorry, I have to take out the data.

Behavior\>Site\>All Pages\>Click on a specific page in the list, then you will see my screenshot below.

![Pageview_unique visitor.png](https://community.atlassian.com/t5/image/serverpage/image-id/27i4ECA40BECAC3C931/image-size/large?v=v2&px=999 "Pageview_unique visitor.png")

<br />

2. The ability to see which pages each particular user has viewed

Yes, You can see which page the users viewed.

Audience\> User Explorer\> then you see a list with Client Id, session duration, bounce rate, etc\> click on a specific Client Id. However, I don't think you will be able to recognise who the client is, because the ID is assigned by Google.

I hope this is helpful to you.

comments: author: Huiyi
body: Oops, the link was not there:

Marketplace: [GoogleAnalytics for Confluence Cloud](https://marketplace.atlassian.com/1216514)

Documentation: [Setup guide](https://wiki.resolution.de/x/LQOtBQ)


Tags: analytics

cloud

confluence-cloud

javascript