feat: add blocks to gtag snippet

This commit is contained in:
Sergey Motornyuk 2023-06-14 15:29:36 +03:00
parent ef084a2a60
commit 913908fc61
1 changed files with 24 additions and 14 deletions

View File

@ -1,16 +1,26 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{googleanalytics_id}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
{% block main %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{googleanalytics_id}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('set', 'linker', );
gtag('js', new Date());
{% block setup %}
gtag('set', 'linker');
gtag('config', '{{googleanalytics_id}}', {
anonymize_ip: true,
linker: {
domains: {{ googleanalytics_linked_domains|tojson }}
}
});
</script>
gtag('js', new Date());
gtag('config', '{{googleanalytics_id}}', {
anonymize_ip: true,
linker: {
domains: {{ googleanalytics_linked_domains|tojson }}
}
});
{% endblock setup %}
{% block extra %}
{% endblock extra %}
</script>
{% endblock %}