Move GA script to head.html (#140)
This commit is contained in:
parent
4a866f64c4
commit
2781e2eb4e
|
|
@ -37,3 +37,15 @@
|
||||||
{% if site.enable_darkmode %}
|
{% if site.enable_darkmode %}
|
||||||
<script src="{{ '/assets/js/theme.js' | relative_url }}"></script>
|
<script src="{{ '/assets/js/theme.js' | relative_url }}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if site.enable_google_analytics %}
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag() { dataLayer.push(arguments); }
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', '{{ site.google_analytics }}');
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,6 @@ $(function () {$('[data-toggle="tooltip"]').tooltip()})
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if site.enable_google_analytics %}
|
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag() { dataLayer.push(arguments); }
|
|
||||||
gtag('js', new Date());
|
|
||||||
|
|
||||||
gtag('config', '{{ site.google_analytics }}');
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- Load Common JS -->
|
<!-- Load Common JS -->
|
||||||
<script src="{{ '/assets/js/common.js' | relative_url }}"></script>
|
<script src="{{ '/assets/js/common.js' | relative_url }}"></script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue