From 913908fc611f59be80322238953edcc84e3b0f06 Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Wed, 14 Jun 2023 15:29:36 +0300 Subject: [PATCH] feat: add blocks to gtag snippet --- .../googleanalytics/snippets/_gtag.html | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/ckanext/googleanalytics/templates/googleanalytics/snippets/_gtag.html b/ckanext/googleanalytics/templates/googleanalytics/snippets/_gtag.html index 2ed2219..fa0ee91 100644 --- a/ckanext/googleanalytics/templates/googleanalytics/snippets/_gtag.html +++ b/ckanext/googleanalytics/templates/googleanalytics/snippets/_gtag.html @@ -1,16 +1,26 @@ - - - + + gtag('js', new Date()); + + gtag('config', '{{googleanalytics_id}}', { + anonymize_ip: true, + linker: { + domains: {{ googleanalytics_linked_domains|tojson }} + } + }); + {% endblock setup %} + + {% block extra %} + {% endblock extra %} + + + +{% endblock %}