Note: This article describes a deprecated integration method. We recommend you not to use it and use the customTask mehod instead.

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.

How to create a new Custom HTML tag

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

      2. Specify the name and the 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 sending and storing 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. Укажите условие срабатывания тега «Один раз на страницу».


Обратите внимание:При рекомендуемых нами настройках отслеживания указание триггера запуска у тега стриминга может привести к расхожденям по количеству просмотров страниц. Условием запуска тега стриминга выступают последовательности в тегах Universal Analytics, по которым ведётся отслеживание событий.

Теперь нужно проверить, все ли настройки, необходимые для создания трекера Google Analytics, установлены в этом теге.

Не забудьте указать в этом теге поля, необходимые при создании счетчика, поскольку в тегах Universal Analytics они будут игнорированы.

Кроссдоменное отслеживание

Если у вас настроено отслеживание по нескольким доменам, измените строку

ga('create', 'UA-XXXXX-Y', 'auto', {'name':'owox'});


ga('create', 'UA-XXXXX-Y', 'auto', {'name':'owox', allowLinker:true});
  1. Set Tag firing to "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 the Create Only fields together with creating a tracker in this tag, because they will be ignored in Universal Analytics tags. 

How to update settings in your Universal Analytics tags

  1. Select the tag you need from the list and change its settings:

  2. Go to Advanced Configuration and set Tracker Name to "owox":

  3. In Google Analytics Tag Sequencing, set the OWOX BI tag to fire first:

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

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


Please sign in to leave a comment.