This integration is intended for those who are using Tealium IQ to send data into Google Analytics.
-
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'); // OWOX BI Streaming plugin code (function(){function f(g){var c=g.get("sendHitTask"),f=function(){function e(b){var a=!1;try{var d=document.createElement("img");d.src=c(!0)+"?"+b;a=!0}catch(h){}return a}function c(b){var a="https://google-analytics.bi.owox.com/"+encodeURIComponent(g.get("trackingId"));b||(a+="?tid="+encodeURIComponent(g.get("trackingId")));return a}return{send:function(b){var a;if(!(a=2036>=b.length&&e(b))){a=!1;try{a=navigator.sendBeacon&&navigator.sendBeacon(c(),b)}catch(h){}}if(!a){a=!1;var d;try{window.XMLHttpRequest&&"withCredentials"in(d= new XMLHttpRequest)&&(d.open("POST",c(),!0),d.setRequestHeader("Content-Type","text/plain"),d.send(b),a=!0)}catch(h){}}return a||e(b)}}}();g.set("sendHitTask",function(e){try{c(e)}catch(k){}f.send(e.get("hitPayload"))})}var c=window[window.GoogleAnalyticsObject||"ga"];c&&c("provide","OWOXBIStreaming",f)})();
- Specify your Google Analytics web-property ID (UA-XXXXX-YY) in code above
Specify your Google Universal Analytics tag as the Scope for extension:
- Set Tracker Name "owox" in Google Universal Analytics tag:
- Create and publish a new version of container to finish OWOX BI Streaming settings on your website.
0 Comments