js_google_analytics

NAML documentation   Watch a video
   Usages of this macro
... in js_google_analytics.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<override_macro name="js_google_analytics">    
    <!-- Start Google Analytics -->
    <script type="text/javascript">
        var _gaq = _gaq || [];
        var pluginUrl = 
        '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
        _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
        _gaq.push(['nabble._setAccount', 'UA-91855-9']);
        _gaq.push(['nabble._trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
    <!-- End Google Analytics -->
</override_macro>
Overrides default macro
... in utilities.naml
105
106
107
108
109
110
111
112
113
114
115
116
117
<macro name="js_google_analytics">
    <!-- Start Google Analytics -->
    <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-91855-9', 'auto', 'nabble');
        ga('nabble.send', 'pageview');
    </script>
    <!-- End Google Analytics -->
</macro>