initial
This commit is contained in:
12
themes/next/layout/_third-party/analytics/google-analytics.swig
vendored
Normal file
12
themes/next/layout/_third-party/analytics/google-analytics.swig
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{% if theme.google_analytics.tracking_id %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ theme.google_analytics.tracking_id }}"></script>
|
||||
<script>
|
||||
var host = window.location.hostname;
|
||||
if (host !== "localhost" || !{{theme.google_analytics.localhost_ignored}}) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ theme.google_analytics.tracking_id }}');
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
Reference in New Issue
Block a user