Add support for GA4 gtag.js Google Analytics

This commit is contained in:
Johan Guldmyr 2023-04-16 09:52:55 +03:00
commit 6e9f1e602e
No known key found for this signature in database
GPG key ID: B856C95D74525E1C

View file

@ -16,6 +16,18 @@
</script>
{% endif %}
{% if GOOGLE_ANALYTICS_GTAG %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ GOOGLE_ANALYTICS_GTAG }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ GOOGLE_ANALYTICS_GTAG }}');
</script>
{% endif %}
{% if GAUGES %}
<script>
var _gauges = _gauges || [];