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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am also experiencing a similar problem. ScrollViewport seems to ignore the standard Confluence GA setup with Custom HTML.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We were later able to do this by customizing/adding the code to the theme's page.vm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.