Update analytics snip
This commit is contained in:
parent
c2d63daae2
commit
0b07b168c8
|
@ -105,9 +105,11 @@
|
|||
{% if site.data.google_analytics.enabled %}
|
||||
<script async src='https://www.googletagmanager.com/gtag/js?id={{ site.data.google_analytics.id }}'></script>
|
||||
<script>
|
||||
if(~location.hostname.indexOf('{{site.data.google_analytics.hostname}}')){
|
||||
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)};gtag('js',new Date());gtag('config','{{ site.data.google_analytics.id }}')
|
||||
}
|
||||
{% comment %}if(~location.hostname.indexOf('{{site.data.google_analytics.hostname}}')){{% endcomment %}
|
||||
window.dataLayer=window.dataLayer||[];
|
||||
function gtag(){dataLayer.push(arguments)};
|
||||
gtag('js',new Date());
|
||||
gtag('config','{{ site.data.google_analytics.id }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue