Hello Michal,
The GA tracking does not track topics twice and certainly not one time with the full url and one time with the page name only. This can only happen if you have enabled both - the built-in GA tracking and custom GA code in the topic template.
H&M tracks the page name only because that's what the GA function
_trackPageview() expects. We
could include a relative path, but not the full url. H&M not only tracks pageviews, but also full-text searches, clicked index keywords and - if enabled - exit pages (that is, when the reader clicks on an external link to leave the help system, the exit is tracked). Furthermore, if you open a topic page
directly, the page view is
not tracked. Because in most cases, when a topic is opened directly (outside the navigation frame), it gets synced and reloaded inside the navigation frame. This would indeed cause double tracking and to avoid this, we track the topic only when it's inside the navigation frame.
The tracker function is implemented in the file "helpman_navigation.js":
Code: Select all
function track(action, data) {
if (gaaccount != "") {
if (window._gat) {
var pageTracker = window._gat._getTracker(gaaccount);
switch(action) {
case "topic":
data = data.substring(data.indexOf("//")+1,data.length);
data = data.substring(data.lastIndexOf("/")+1,data.length);
pageTracker._trackPageview(data);
break;
case "search":
pageTracker._trackPageview(data);
break;
case "index":
pageTracker._trackEvent("Help|IndexTerm", data, null, null);
break;
case "exit":
pageTracker._trackEvent("Help|ExitTo", data, null, null);
break;
}
}
}
}
For detailed information on this function, please see
https://developers.google.com/analytics ... ckPageview
Question: It is (or will be) possible to customize Google Analytics behavior except of the only setting: Google Analytics code?
Yes. You can implement your own GA tracking by simply disabling the built-in implementation in Help & Manual: Open your project, go to "Config > Publishing Options > Webhelp > Google" and remove the Google Analytics Account number. If this setting is empty, H&M will not execute any GA code (without an account number, it cannot anyway). Now you can implement your own GA tracking in the topic HTML template with any functionality you need.