    <script type="text/javascript">
    <!--
    function toggle(id) {
        var e = document.getElementById(id);
        e.style.display == 'block' ? e.style.display = 'none' : e.style.display = 'block';
    }
    //-->
    </script>
    <script type="text/javascript">
    <!--
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', {{ .Site.Params.gaCode }}]);
        _gaq.push(['_trackPageview']);

        (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    -->
    </script>
    </body>
</html>

    <script type="text/javascript">
    <!--
    function toggle(id) {
        var e = document.getElementById(id);
        e.style.display == 'block' ? e.style.display = 'none' : e.style.display = 'block';
    }
    //-->
    </script>
    {{ template "_internal/google_analytics.html" . }}
    </body>
</html>

Replace custom google analytics code by internal template
Replace custom google analytics code by internal template

The internal template is not inserted when parameter googleAnalytics is not set.