It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scroll Viewport - Page view Statistics/Analytics

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

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

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

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

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

Hi David, 

My audience for Viewport is anonymous.

Thank you. I will try and explore Google Analytics. 

Regards,

Bandy

Hi @David_Majninger__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.

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

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

Hi @shehzad777 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

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

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
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

269 views 9 6
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you