Scroll Viewport - Page view Statistics/Analytics

Bandy January 25, 2019

Hi, 

I have the "Page View" Plugin installed as well have the "Activity" tracker enabled in my Confluence space (Scroll Version). As such I can view the activity details and page view statistics in my working space (Scroll Version).  

My audience refers to content using Viewport. 

My Query:  Is there a way/plugin that enables me to collect analytics on activities in Viewport? Page Hits/User details etc?

 

Regards,

Bandy

 

 

 

2 answers

1 accepted

4 votes
Answer accepted
Steffen Burzlaff _K15t_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 25, 2019

Hi Bandy,

 

"Is there a way/plugin that enables me to collect analytics on activities in Viewport? Page Hits/User details etc?"

Sure this is possible. I assume you are using the "Page View" plugin from EliteSoft?

The plugin is using an Ajax call to track the page view in Confluence.

So what you would have to do, is performing a PUT-Request in your Viewport Theme if a page is visited.

To achieve that you would need to call this URL via an Ajax call.

<confluence-base-url>/rest/page-tracking-services/1.0/page-tracking/page-view

To get the current page ID you would have to insert the following into your HTML-Head, which needs to be available on every page you want to track.

<meta name="pageId" content="${page.id}">

You can access this information with the following JavaScript (this is using jQuery) and send it over to the tracking plugin:

Paste this code into your document.ready function. If you are using the Scroll Web Help Theme you will find this function inside the: theme.main.js file.

var pageId  = $('meta[name="pageId"]').attr('content');
var baseUrl = $('meta[name="ajs-base-url"]').attr('content');
var url    = baseUrl + "/rest/page-tracking-services/1.0/page-tracking/page-view";

$.ajax({
    url: url,
    type: 'PUT',
    data: {'pageId': pageId}
}); 

 

If you don't want to track your own data you could exclude the specific user-group by adding a if statement around (either the script or around the meta tags) which check the current user-group.

#if($user.isInGroup(groupName))
<meta tags>
#end

or create a meta tag for the user-group and check it in your JavaScript.


Hope this is solving your problem.

Let me know if it works out for you. Thanks and have a nice day.

 

Best,
Steffen

Bandy January 27, 2019

Thank you Steffen.

I will try and work on your solution to see if it works for me. Am not much of a tech person so am not sure if I can implement this solution. Will  take some help from my tech guys here and will keep you updated. 

 

Regards,

Bandy

Bandy February 28, 2019

Hi Steffen,

I updated the theme as suggested in your response above. Am not able to see the page hit numbers anywhere. 

Can you please let me know where the page view hit details is getting reflected/stored?

 

Regards,

Bandy

1 vote
David (K15t) January 25, 2019

Hi Bandy,

who is your audience? Do they have Confluence accounts or are they anonymous?

We at K15t present our help.k15t.com content to anonymous users using Viewport and we use Google Analytics to keep track of views etc. That way we can also ignore all activities by logged in employees, so we don't distort the data.

Cheers,

David

Bandy January 27, 2019

Hi David, 

My audience for Viewport is anonymous.

Thank you. I will try and explore Google Analytics. 

Regards,

Bandy

shehzad.iqbal July 5, 2019

Hi @David (K15t) , 

How can we do the same? How do we insert the GA tracking code in the viewport? The view port seems to ignore the script added to Global Custom HTML.

Adriane Hunt November 15, 2019

I am also experiencing a similar problem. ScrollViewport seems to ignore the standard Confluence GA setup with Custom HTML.

shehzad.iqbal November 17, 2019

We were later able to do this by customizing/adding the code to the theme's page.vm.

Steffen Burzlaff _K15t_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 17, 2019

Hi @shehzad.iqbal and @Adriane Hunt ,

Scroll Viewport is grabbing the content only from the Confluence page itself. This means, every HTML which isn't in the page content of the Confluence page isn't available in the viewport. The Global Custom HTML is one of those cases.
As Shehzad already figured out - you would need to put the GA code directly into your theme (page.vm).

Scroll Viewport comes now with a new and customizable Help Center Theme which also offers a Google integration out of the box. You just need to enter your Google Tracking ID and won't have to enter a code by yourself.

Cheers,

Steffen

Like Adriane Hunt likes this
David (K15t) November 17, 2019

The new Help Center theme supports the GA integration out of the box. Just input your AnalyticsID or Tag Manager ID in the properties and you're good to go. More on that here: https://help.k15t.com/scroll-viewport/latest/integrations-168363871.html#id-.Integrationsv2.15-Third-PartyIntegrations

Like Adriane Hunt likes this
Adriane Hunt November 18, 2019

Steffen, David,

Thank you both for the helpful information! I implemented the GA code in our WebHelp theme and it's working flawlessly! I also took a look at the new Help Center theme (Nice!) and might implement a version of it in the future. Many thanks!

Regards,

Adriane

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events