This integration is meant for those who're using Google Tag Manager to send data into Google Analytics.

To start collecting hits data you'll need to: 

  1. Create a new Custom HTML tag with the connected plugin OWOX BI Streaming;
  2. Set Tracker Name property = owox in every Universal Analytics tag for which you want to collect data.

To create a new Custom HTML tag:

    1. Select the container in your Google Tag Manager account, go to the section "Tags" and click the "New" button;

    2. Specify the name and type of the tag;

    3. Copy and paste plugin code from the streaming pipeline page or use the following code, changing the values of UA-XXXXXX-YY (your Google Analytics web-property ID) and sessionIdDimension: ZZ (index of a custom dimension used for the transmission and storage sessionId):

      try { // 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.   ga('create', 'UA-XXXXX-Y', 'auto', {'name':'owox'}); // Define Create Only fields here after you've created a tracker // 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)&&("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,"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:"",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")+"_",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)})();
        google_tag_manager[{{Container ID}}].onHtmlSuccess({{HTML ID}});
      } catch(e) {
        google_tag_manager[{{Container ID}}].onHtmlFailure({{HTML ID}});
    4. Set tag to fire once per page;


You need to confirm that all the necessary settings for creating Google Analytics tracker are set when creating the tracker within the streaming tag.

Don't forget to define Create Only fields together with creating a tracker in this tag, because they will be ignored in Universal Analytics tags.


Update settings in your Universal Analytics tags:

  1. Select the desired tag in the list and change its settings;

  2. Go to advanced configuration and set Tracker Name = owox.

  3. In Google Analytics tags sequencing set the OWOX BI tag to fire first:

After completing those actions, create and publish a new version of the GTM container to activate OWOX BI Streaming plugin on your site.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.