Using Google Analytics with bxp

From All n One's bxp software Wixi

Jump to: navigation, search

Overview

Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic. Google launched the service in November 2005 after acquiring Urchin. Google Analytics is now the most widely used web analytics service on the Internet.


It is possible to include Google Analytics in your use of bxp.


To create your account you can use


This output will give you a block of code. In it, it will contain

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-00000000-0', 'auto');
  ga('send', 'pageview');

</script>


bxp has a security setting to prevent JavaScript from other domains getting into a bxp page. So this part https://www.google-analytics.com/analytics.js will never work. Instead we copy this library into bxp so it can work. There are two options. 1. copy it into your custom folder or 2. use the bxp centralised version. You can use either but please note that the centralised version will be updated as and when, where as you have control of your own custom folder version.


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://ww3.allnone.ie/library/google/analytics.js','ga');

  ga('create', 'UA-00000000-0', 'auto');
  ga('send', 'pageview');

</script>


You add this block of code to Main Menu > System Access Management > System Management > System Settings > System Headers and Footers > Page Footer


In the footer, you add in the snippet of code supplied by Google https://developers.google.com/analytics/devguides/collection/analyticsjs/ with the library changed as necessary and your UA id in there as well.


You can now review, in real time the use of bxp through Google Analytics. From Analytics, Choose Reporting and then choose Real Time > Overview from the left menu. If the code is working you'll see real time information coming through onto the dashboard immediately.


googleanalytics 001.png