This integration is intended for those who are using Tealium IQ to send data into Google Analytics.

  1. Create new JavaScript Code extension. In it will be configured Google Analytics tracker and connected OWOX BI Streaming plugin:

    // Google Analytics tracker initialization snippet.
    (function(a,b){a.GoogleAnalyticsObject=b;a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)};a[b].l=1*new Date})(window,"ga");
    
    // Creating 'owox' tracker that will duplicate original Google Analytics hits to Google BigQuery.
    // Don't forget to define Create Only fields here, if you use any
    ga('create', 'UA-XXXXX-Y', 'auto', {name: 'owox'});
    
    // Connecting OWOX BI Streaming plugin to the tracker
    ga('owox.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= !1;try{b=navigator.sendBeacon&&navigator.sendBeacon(k(),c)}catch(a){}return b||2036>=c.length&&g(c)||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)})();
  2. Specify your Google Analytics web-property ID (UA-XXXXX-YY) in code above.
  3. Specify index of session-scope custom dimension, which is used for storage sessionId in GA, in sessionIdDimension parameter: ZZ.

Specify your Google Universal Analytics tag as the Scope for extension:

  1. Set Tracker Name "owox" in Google Universal Analytics tag:

  2. Create and publish a new version of container to finish OWOX BI Streaming settings on your website.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.