4 Replies Latest reply on Sep 8, 2015 7:03 AM by danaeinsidler

    Can anyone shed light on Google Analytics issue?

    ronanfeely

      Hello,

       

      Posted below is a Google Analytics script that I can't seem to get working.

       

      I know all the variables work and are being populated.

       

      I created the custom dimensions successfully.

       

      But when we put the code in place, we get nothing. At all.

       

      Any ideas?

       

      R.

       

      <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','//www.google-analytics.com/analytics.js','ga');

       

        var userclass;

        var userID = window.parent._jive_effective_user_id;

        var containerString = window.parent.jive.global.containerType.toString();

        var placeid = window.parent.jive.global.containerID.toString();

       

       

        if (userID < 0) {

         userclass = 'guest';

        } else {

         userclass = 'member';

        }

       

          if (containerString == '2020') {

          placeid = 'personal content';

                } else if (containerString == '3') {

          placeid = 'user profile';

                }

       

          ga('create', 'UA-894330-5', 'auto');

             

          ga('set', 'dimension1', userclass);

          ga('set', 'dimension2', placeid);

       

          ga('send', 'pageview');

       

      </script>