Google Analytics page not working

Issue #925 new
Raymond Reid created an issue

Hi

We've noticed that the Analytics ID field 'theme_adaptable_mmu | analyticstext1' is not working.

To get Google Analytics to work correctly we are having to put in the full java script in 'Custom CSS & JS' Javascript Section 'theme_adaptable_mmu | jssection'.

For example:

<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-*-*"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());

gtag('config', 'UA-*-*'); </script>

Comments (2)

  1. Info 3bits

    The code generated by Adaptable when GA is enabled is correct and it is the same Google adds:

                        <script type="text/javascript">
                            (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');
    
                            ga('create', 'UA-XXXXXXXX-X', 'auto');
                            ga('send', 'pageview');
                        </script>
    

    Do you enter the right code format UA-XXXXXXXX-X ?

    This is the only you must enter in the field.

  2. Raymond Reid reporter

    Hi, if I just rely on the section 'theme_adaptable | analyticstext1' and put our correct UA-XXXXXXXX-X code in there then the page renders with:

    <script type="text/javascript">
        (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');
    
        ga('create', 'analyticstext1', 'auto');
        ga('send', 'pageview');
        ga('set', 'anonymizeIp', 1);
    </script>
    

    It doesn't seem to be able to find analyticstext1 and convert that into the UA-XXXXXXXX-XX code which is in the field.

    Meaning that I need to add the full script section in theme_adaptable | jssection to get it to work and report traffic to Google Analytics.

  3. Log in to comment