Add gtag support for Google Analytics (#374)
This commit is contained in:
parent
362462948f
commit
dfa273c1a4
3 changed files with 15 additions and 0 deletions
11
_includes/gtag.html
Normal file
11
_includes/gtag.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% if site.gtag %}
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.gtag }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ site.gtag }}');
|
||||
</script>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue