Skip to content

Commit

Permalink
feat: add blocks to gtag snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Jun 14, 2023
1 parent ef084a2 commit 913908f
Showing 1 changed file with 24 additions and 14 deletions.
@@ -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 %}

0 comments on commit 913908f

Please sign in to comment.