This type of tracking is intended for those who implemented a tracking code to a website.

1. Connect OWOX BI Streaming plugin on every page right after Google Analytics initialization command ga('create', ...);:

// Connecting OWOX BI Streaming plugin to the tracker
ga('require', 'OWOXBIStreaming', {sessionIdDimension: ZZ});

// OWOX BI Streaming plugin code
(function(){var g=function(e,f){var h=e.get("sendHitTask"),g=function(){function d(c){var b=!1,a;try{window.XMLHttpRequest&&"withCredentials"in(a=new XMLHttpRequest)&&(a.open("POST",k(),!0),a.onprogress=function(){},a.ontimeout=function(){},a.onerror=function(){},a.onload=function(){},a.setRequestHeader("Content-Type","text/plain"),a.send(c),b=!0)}catch(d){}return b}function h(c){var b=!1,a;try{window.XDomainRequest&&(a=new XDomainRequest,a.open("POST",k(!1,location.protocol.slice(0,-1))),a.onprogress=
function(){},a.ontimeout=function(){},a.onerror=function(){},a.onload=function(){},setTimeout(function(){a.send(c)},0),b=!0)}catch(d){}return b}function g(c){var b,a=!1;try{b=document.createElement("img"),b.onload=function(){},b.src=k(!0)+"?"+c,a=!0}catch(d){}return a}function k(c,b){var a;b||(b="https");a=b+"://"+l.domain+"/collect";c||(a+="?tid="+encodeURIComponent(e.get("trackingId")));return a}var l={domain:f&&f.domain?f.domain:"google-analytics.bi.owox.com",debug:!1};return{send:function(c){var b;
if(!(b=2036>=c.length&&g(c))){b=!1;try{b=navigator.sendBeacon&&navigator.sendBeacon(k(),c)}catch(a){}}return b||d(c)||h(c)||g(c)}}}();e.set("sendHitTask",function(d){var e;if(f&&0<f.sessionIdDimension)try{e=d.get("clientId")+"_"+Date.now(),d.set("dimension"+f.sessionIdDimension,e),d.get("buildHitTask")(d)}catch(m){}h(d);g.send(d.get("hitPayload"))})},h=window[window.GoogleAnalyticsObject||"ga"];h&&h("provide","OWOXBIStreaming",g)})();

Custom dimension index used to send and store sessionIdhas to be specified in plugin parameters in order to collect session data — sessionIdDimension: ZZ.

2. If you use several Google Analytics trackers, then define a name for a tracker that you want to use for OWOX BI Streaming as in the example above:

  • e.g. if tracker name is 'owox' — use ga('owox.require', 'OWOXBIStreaming');
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.