Skip to content

Commit

Permalink
Merge pull request #199 from UKGovernmentBEIS/fix/remove-GA-service
Browse files Browse the repository at this point in the history
fix(cookie-banner):remove GA service
  • Loading branch information
AiswaryaBEIS authored Sep 11, 2024
2 parents 014aaba + fb60fad commit 9df30ea
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 190 deletions.

This file was deleted.

This file was deleted.

6 changes: 1 addition & 5 deletions DVSRegister/Controllers/CabController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using DVSRegister.BusinessLogic.Models.CAB;
using DVSRegister.BusinessLogic.Services;
using DVSRegister.BusinessLogic.Services.CAB;
using DVSRegister.BusinessLogic.Services.GoogleAnalytics;
using DVSRegister.Extensions;
using DVSRegister.Models.CAB.Provider;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -18,21 +17,18 @@ public class CabController : Controller
{

private readonly ICabService cabService;
private readonly GoogleAnalyticsService googleAnalyticsService;
private readonly IUserService userService;

public CabController(ICabService cabService, GoogleAnalyticsService googleAnalyticsService, IUserService userService)
public CabController(ICabService cabService, IUserService userService)
{
this.cabService = cabService;
this.googleAnalyticsService = googleAnalyticsService;
this.userService = userService;
}

[HttpGet("")]
[HttpGet("home")]
public async Task<IActionResult> LandingPage()
{
await googleAnalyticsService.SendSponsorPageViewedEventAsync(Request);
string email = HttpContext?.Session.Get<string>("Email")??string.Empty;
string cab = string.Empty;
var identity = HttpContext?.User.Identity as ClaimsIdentity;
Expand Down
9 changes: 3 additions & 6 deletions DVSRegister/Controllers/RegisterController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using DVSRegister.BusinessLogic.Models.CAB;
using DVSRegister.BusinessLogic.Models.Register;
using DVSRegister.BusinessLogic.Services.GoogleAnalytics;
using DVSRegister.BusinessLogic.Services;
using DVSRegister.BusinessLogic.Services.CAB;
using DVSRegister.CommonUtility.Models.Enums;
Expand All @@ -16,15 +15,15 @@ public class RegisterController : Controller
private readonly ILogger<RegisterController> logger;
private readonly IRegisterService registerService;
private readonly ICabService cabService;
private readonly GoogleAnalyticsService googleAnalyticsService;
// private readonly GoogleAnalyticsService googleAnalyticsService;


public RegisterController(ILogger<RegisterController> logger, IRegisterService registerService, ICabService cabService, GoogleAnalyticsService googleAnalyticsService)
public RegisterController(ILogger<RegisterController> logger, IRegisterService registerService, ICabService cabService)
{
this.logger = logger;
this.registerService = registerService;
this.cabService = cabService;
this.googleAnalyticsService = googleAnalyticsService;
// this.googleAnalyticsService = googleAnalyticsService;


}
Expand Down Expand Up @@ -86,7 +85,6 @@ public async Task<IActionResult> ProviderDetails(int providerId)
ProviderDetailsViewModel providerDetailsViewModel = new ProviderDetailsViewModel();
providerDetailsViewModel.Provider = providerDto;
providerDetailsViewModel.LastUpdated = TempData.Peek("LastUpdated") as string??string.Empty;
await googleAnalyticsService.SendProviderDetailsViewedEventAsync(Request);
return View(providerDetailsViewModel);
}

Expand All @@ -96,7 +94,6 @@ public async Task<IActionResult> Updates()
{
RegisterPublishLogsViewModel registerPublishLogsViewModel = new RegisterPublishLogsViewModel();
registerPublishLogsViewModel.RegisterPublishLog = await registerService.GetRegisterPublishLogs();
await googleAnalyticsService.SendPublishLogViewedEventAsync(Request);
return View("Updates", registerPublishLogsViewModel);
}

Expand Down
4 changes: 1 addition & 3 deletions DVSRegister/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@using DVSRegister.Middleware
@using DVSRegister.BusinessLogic.Services
@using DVSRegister.BusinessLogic.Services.Cookies
@using DVSRegister.BusinessLogic.Services.GoogleAnalytics
@using Microsoft.Extensions.Hosting
@inject CookieService CookieService
@inject GoogleAnalyticsService GoogleAnalytics
@{
string assetsPath = "/assets/images";
}
Expand Down Expand Up @@ -48,7 +46,7 @@ string assetsPath = "/assets/images";
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '@GoogleAnalytics.Configuration.MeasurementId');
})(window, document, 'script', 'dataLayer', 'GTM-NZ96NTWC');
// <!-- End Google Tag Manager -->
</script>
<meta charset="utf-8" />
Expand Down
4 changes: 1 addition & 3 deletions DVSRegister/Views/Shared/_LayoutLoggedIn.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@using DVSRegister.Middleware
@using DVSRegister.BusinessLogic.Services
@using DVSRegister.BusinessLogic.Services.Cookies
@using DVSRegister.BusinessLogic.Services.GoogleAnalytics
@using Microsoft.Extensions.Hosting
@inject CookieService CookieService
@inject GoogleAnalyticsService GoogleAnalytics
@{
string assetsPath = "/assets/images";
}
Expand Down Expand Up @@ -48,7 +46,7 @@ string assetsPath = "/assets/images";
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '@GoogleAnalytics.Configuration.MeasurementId');
})(window, document, 'script', 'dataLayer', 'GTM-NZ96NTWC');
// <!-- End Google Tag Manager -->
</script>
<meta charset="utf-8"/>
Expand Down
4 changes: 1 addition & 3 deletions DVSRegister/Views/Shared/_Layout_CAB.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@using DVSRegister.Middleware
@using DVSRegister.BusinessLogic.Services
@using DVSRegister.BusinessLogic.Services.Cookies
@using DVSRegister.BusinessLogic.Services.GoogleAnalytics
@using Microsoft.Extensions.Hosting
@inject CookieService CookieService
@inject GoogleAnalyticsService GoogleAnalytics
@{
string assetsPath = "/assets/images";
}
Expand Down Expand Up @@ -48,7 +46,7 @@ string assetsPath = "/assets/images";
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '@GoogleAnalytics.Configuration.MeasurementId');
})(window, document, 'script', 'dataLayer', 'GTM-NZ96NTWC');
// <!-- End Google Tag Manager -->
</script>
<meta charset="utf-8"/>
Expand Down

0 comments on commit 9df30ea

Please sign in to comment.