Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/PSD-3525_gtm_cookie_investigation #3229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tahir-khalid
Copy link
Contributor

Ensured GTM script is firing at correct time and cookies_policy is being set.

@tahir-khalid tahir-khalid force-pushed the chore/PSD-3525_gtm_cookie_investigation branch from ddf38c1 to a210556 Compare October 15, 2024 14:38
@@ -14,12 +14,12 @@
<%= javascript_include_tag "application", type: "module", nonce: true %>
<%= stylesheet_link_tag "application" %>
<%= csrf_meta_tags %>
<% if Rails.env.production? && analytics_cookies_accepted? %>
<% if !Rails.env.development? %>
Copy link
Contributor

@alan-at-work alan-at-work Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use <% unless Rails.env.development? %> also why are we not checking the analytics_cookies_accepted now? - leads to this #3229 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading John's email the issue seems to be the GTM container doesn't respond unless analytics cookie is accepted so the intention here is bypass that trigger the container regardless.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that means you're not setting the cookie, I think they need to remove that and trust that we are dealing with it or update their code to use the one we have set.

<%= render "shared/ga_head" %>
<% end %>
</head>
<body class="govuk-template__body app-body-class">
<% if Rails.env.production? && analytics_cookies_accepted? %>
<% if !Rails.env.development? %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above maybe use <% unless Rails.env.development? %>

@@ -49,7 +49,8 @@ def set_analytics_cookies(accept_analytics_cookies)
cookies[:cookies_policy] = {
Copy link
Contributor

@alan-at-work alan-at-work Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems if you're not calling this is it really needed? this was removed from the app/views/layouts/application.html.erb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjust code to ensure cookies policy is created.

@tahir-khalid tahir-khalid force-pushed the chore/PSD-3525_gtm_cookie_investigation branch from 6a54aeb to 95bf3c8 Compare October 16, 2024 08:47
@alan-at-work alan-at-work changed the title Ensured GTM script is called if not dev environment chore/PSD-3525_gtm_cookie_investigation Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants