diff --git a/src/apps/__export-wins-review/view.njk b/src/apps/__export-wins-review/view.njk index 6940a9266fd..54e094502a7 100644 --- a/src/apps/__export-wins-review/view.njk +++ b/src/apps/__export-wins-review/view.njk @@ -5,9 +5,10 @@ DBT Export Wins - {% include "_includes/google-tag-manager-snippet.njk" %} + {% include "_includes/google-tag-manager/consent-needed.njk" %} + {% include "_includes/google-tag-manager/no-script.njk" %} {% include "_includes/csp-nonce.njk" %}
diff --git a/src/templates/_includes/google-tag-manager-no-script.njk b/src/templates/_includes/google-tag-manager-no-script.njk deleted file mode 100644 index e9939c65bd2..00000000000 --- a/src/templates/_includes/google-tag-manager-no-script.njk +++ /dev/null @@ -1,8 +0,0 @@ -{% if GOOGLE_TAG_MANAGER_KEY %} - -{% endif %} diff --git a/src/templates/_includes/google-tag-manager-snippet.njk b/src/templates/_includes/google-tag-manager-snippet.njk deleted file mode 100644 index 774e630411f..00000000000 --- a/src/templates/_includes/google-tag-manager-snippet.njk +++ /dev/null @@ -1,35 +0,0 @@ -{% if GOOGLE_TAG_MANAGER_KEY %} - - - - -{% endif %} diff --git a/src/templates/_includes/google-tag-manager/consent-needed.njk b/src/templates/_includes/google-tag-manager/consent-needed.njk new file mode 100644 index 00000000000..863d56096ce --- /dev/null +++ b/src/templates/_includes/google-tag-manager/consent-needed.njk @@ -0,0 +1,18 @@ +{# +This is a set-up of Google Tag Manager for external users +(currently anyone who accessess /exportwins/review/*), +for whom we need to manage consent to use Google Analytics cookies. +#} +{% if GOOGLE_TAG_MANAGER_KEY %} +{% include "_includes/google-tag-manager/gtag-definition.njk" %} + +{% include "_includes/google-tag-manager/snippet.njk" %} +{% endif %} diff --git a/src/templates/_includes/google-tag-manager/consent-not-needed.njk b/src/templates/_includes/google-tag-manager/consent-not-needed.njk new file mode 100644 index 00000000000..6c429c77a73 --- /dev/null +++ b/src/templates/_includes/google-tag-manager/consent-not-needed.njk @@ -0,0 +1,22 @@ +{# +This is a set-up of Google Tag Manager for internal users, +who are assumed that they have given consent for using +Google Analytics cookies. +#} +{% if GOOGLE_TAG_MANAGER_KEY %} +{% include "_includes/google-tag-manager/gtag-definition.njk" %} + +{% include "_includes/google-tag-manager/snippet.njk" %} +{% endif %} diff --git a/src/templates/_includes/google-tag-manager/gtag-definition.njk b/src/templates/_includes/google-tag-manager/gtag-definition.njk new file mode 100644 index 00000000000..dd3adc9cc4c --- /dev/null +++ b/src/templates/_includes/google-tag-manager/gtag-definition.njk @@ -0,0 +1,4 @@ + diff --git a/src/templates/_includes/google-tag-manager/no-script.njk b/src/templates/_includes/google-tag-manager/no-script.njk new file mode 100644 index 00000000000..3da69fddfbe --- /dev/null +++ b/src/templates/_includes/google-tag-manager/no-script.njk @@ -0,0 +1,6 @@ +{% if GOOGLE_TAG_MANAGER_KEY %} + + + +{% endif %} diff --git a/src/templates/_includes/google-tag-manager/snippet.njk b/src/templates/_includes/google-tag-manager/snippet.njk new file mode 100644 index 00000000000..d6feb0d6b88 --- /dev/null +++ b/src/templates/_includes/google-tag-manager/snippet.njk @@ -0,0 +1,8 @@ + + + + diff --git a/src/templates/_layouts/template.njk b/src/templates/_layouts/template.njk index 844e5ac1189..5d922d04d4f 100644 --- a/src/templates/_layouts/template.njk +++ b/src/templates/_layouts/template.njk @@ -68,7 +68,7 @@ - {% include "_includes/google-tag-manager-snippet.njk" %} + {% include "_includes/google-tag-manager/consent-not-needed.njk" %}