2019-02-18 01:38:00 +01:00
|
|
|
{% if jekyll.environment == "production" %}
|
2020-08-27 05:38:55 +02:00
|
|
|
{% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %}
|
|
|
|
{% if gid %}
|
|
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ gid }}"></script>
|
|
|
|
<script>
|
|
|
|
window.dataLayer = window.dataLayer || [];
|
2019-02-18 01:38:00 +01:00
|
|
|
|
2020-08-27 05:38:55 +02:00
|
|
|
function gtag() {
|
|
|
|
dataLayer.push(arguments);
|
|
|
|
}
|
|
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', '{{ $gid }}');
|
|
|
|
</script>
|
|
|
|
{% elsif site.google_analytics_id %}
|
|
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
|
|
|
|
<script>
|
|
|
|
window.dataLayer = window.dataLayer || [];
|
2019-02-18 01:38:00 +01:00
|
|
|
|
2020-08-27 05:38:55 +02:00
|
|
|
function gtag() {
|
|
|
|
dataLayer.push(arguments);
|
|
|
|
}
|
|
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', '{{ site.google_analytics_id }}');
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
2018-12-09 11:56:24 +01:00
|
|
|
{% endif %}
|