Skip to content

Commit

Permalink
Ensured GTM script is called if not dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tahir-khalid committed Oct 15, 2024
1 parent 8c5fea6 commit ddf38c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/controllers/concerns/cookies_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def set_analytics_cookies(accept_analytics_cookies)
cookies[:cookies_policy] = {
value: get_policy.to_json,
expires: 1.year.from_now,
httponly: true
httponly: true,
raw: true
}
end
end
Expand All @@ -65,4 +66,4 @@ def get_policy
campaigns: true
}
end
end
end
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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? %>
<%= 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? %>
<%= render "shared/ga_body" %>
<% end %>
<%= javascript_tag nonce: true do -%>
Expand Down

0 comments on commit ddf38c1

Please sign in to comment.