Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inject LearningHub.Nhs.WebUI.Configuration.Settings settings
@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnv
@if (settings.GoogleTagManagerEnabled && hostingEnv.EnvironmentName == "Production")
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
@if (settings.GoogleTagManagerEnabled && @Configuration["Environment"] == "Production")
{
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=@settings.GoogleTagManagerContainerId"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@inject LearningHub.Nhs.WebUI.Configuration.Settings settings
@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnv
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
@{
var detectCookieStatusBeforePageLoad = (string)TempData["ObtainUserConsentToTrackPriorToPageLoad"]; // Need to capture cookie status before page load to avoid inconsistencies.
}

@if (detectCookieStatusBeforePageLoad == "true" && settings.GoogleTagManagerEnabled && hostingEnv.EnvironmentName == "Production") // [BY] When the user consent for first time load the follolwing JS. To avoid inconsistencies a temp varaible has been set when the user consent cookie choice
@if (detectCookieStatusBeforePageLoad == "true" && settings.GoogleTagManagerEnabled && @Configuration["Environment"] == "Production") // [BY] When the user consent for first time load the follolwing JS. To avoid inconsistencies a temp varaible has been set when the user consent cookie choice
{
<!-- Google Tag Manager -->
<script>
Expand Down