Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef084a2
commit 913908f
Showing
1 changed file
with
24 additions
and
14 deletions.
There are no files selected for viewing
38 changes: 24 additions & 14 deletions
38
ckanext/googleanalytics/templates/googleanalytics/snippets/_gtag.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |