Skip to content

Commit

Permalink
[DFC-711]: Remove UA code
Browse files Browse the repository at this point in the history
  • Loading branch information
di-aholme committed Jan 31, 2025
1 parent f6e51bb commit 8d0b48f
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 279 deletions.
3 changes: 0 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ VERIFY_ACCESS_VALUE=
# subjectId returned from oidc stub
MY_ONE_LOGIN_USER_ID=user_id
METHOD_MANAGEMENT_BASE_URL=https://method-management-v1-stub.home.dev.account.gov.uk
UNIVERSAL_ANALYTICS_GTM_CONTAINER_ID="GTM-TK92W68"
GOOGLE_ANALYTICS_4_GTM_CONTAINER_ID="GTM-KD86CMZ"
GA4_ENABLED="true"
UA_ENABLED="true"
SELECT_TRACKING_ENABLED="true"
SUPPORT_ADD_BACKUP_MFA="1"
SUPPORT_METHOD_MANAGEMENT=1
Expand Down
27 changes: 0 additions & 27 deletions deploy/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ Mappings:
dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables
METHODMANAGEMENTBASEURL: "https://method-management-v1-stub.home.dev.account.gov.uk"
SUPPORTMETHODMANAGEMENT: "1"
UNIVERSALANALYTICSGTMCONTAINERID: "GTM-TK92W68"
GOOGLEANALYTICS4GTMCONTAINERID: "GTM-KD86CMZ"
GA4ENABLED: "true"
UAENABLED: "true"
SELECTTRACKINGENABLED: "true"
SUPPORTADDBACKUPMFA: "1"
SUPPORTCHANGEMFA: "1"
Expand Down Expand Up @@ -223,10 +221,8 @@ Mappings:
SUPPORTCHANGEMFA: "0"
dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables
ACCESSIBILITYSTATEMENTURL: "https://signin.account.gov.uk/accessibility-statement"
UNIVERSALANALYTICSGTMCONTAINERID: "GTM-TK92W68"
GOOGLEANALYTICS4GTMCONTAINERID: "GTM-KD86CMZ"
GA4ENABLED: "true"
UAENABLED: "true"
SELECTTRACKINGENABLED: "true"
LANGUAGETOGGLE: "1"
DTRUMURL: ""
Expand Down Expand Up @@ -259,10 +255,8 @@ Mappings:
SUPPORTADDBACKUPMFA: "0"
SUPPORTCHANGEMFA: "0"
dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables
UNIVERSALANALYTICSGTMCONTAINERID: "GTM-TK92W68"
GOOGLEANALYTICS4GTMCONTAINERID: "GTM-KD86CMZ"
GA4ENABLED: "true"
UAENABLED: "true"
SELECTTRACKINGENABLED: "true"
ACCESSIBILITYSTATEMENTURL: "https://signin.account.gov.uk/accessibility-statement"
LANGUAGETOGGLE: "1"
Expand Down Expand Up @@ -296,10 +290,8 @@ Mappings:
SUPPORTCHANGEMFA: "0"
CONTACTEMAILSERVICEURL: "https://signin.integration.account.gov.uk/contact-us-from-triage-page"
dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables
UNIVERSALANALYTICSGTMCONTAINERID: "TBD"
GOOGLEANALYTICS4GTMCONTAINERID: "TBD"
GA4ENABLED: "false"
UAENABLED: "false"
SELECTTRACKINGENABLED: "false"
ACCESSIBILITYSTATEMENTURL: "https://signin.account.gov.uk/accessibility-statement"
LANGUAGETOGGLE: "1"
Expand Down Expand Up @@ -333,10 +325,8 @@ Mappings:
SUPPORTADDBACKUPMFA: "0"
CONTACTEMAILSERVICEURL: "https://signin.account.gov.uk/contact-us-from-triage-page"
dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceProductionVariables
UNIVERSALANALYTICSGTMCONTAINERID: "GTM-TT5HDKV"
GOOGLEANALYTICS4GTMCONTAINERID: "GTM-K4PBJH3"
GA4ENABLED: "true"
UAENABLED: "true"
SELECTTRACKINGENABLED: "false"
ACCESSIBILITYSTATEMENTURL: "https://signin.account.gov.uk/accessibility-statement"
LANGUAGETOGGLE: "1"
Expand Down Expand Up @@ -858,26 +848,9 @@ Resources:
Value: !Ref Environment
- Name: "VERIFY_ACCESS_VALUE"
Value: !Sub "{{resolve:secretsmanager:/${BackendStackName}/Config/Storage/VerificationSecret}}"
- Name: "UNIVERSAL_ANALYTICS_GTM_CONTAINER_ID"
Value:
!FindInMap [
EnvironmentVariables,
!Ref Environment,
UNIVERSALANALYTICSGTMCONTAINERID,
]
- Name: "GOOGLE_ANALYTICS_4_GTM_CONTAINER_ID"
Value:
!FindInMap [
EnvironmentVariables,
!Ref Environment,
GOOGLEANALYTICS4GTMCONTAINERID,
]
- Name: "GA4_ENABLED"
Value:
!FindInMap [EnvironmentVariables, !Ref Environment, GA4ENABLED]
- Name: "UA_ENABLED"
Value:
!FindInMap [EnvironmentVariables, !Ref Environment, UAENABLED]
- Name: "SELECT_TRACKING_ENABLED"
Value:
!FindInMap [
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"scripts": {
"bubbleprof": "NODE_ENV=production clinic bubbleprof --autocannon [ -c 10 -d 10 /healthcheck ] -- node -r dotenv/config dist/server.js && echo '\n\nRemember to clean up files in .clinic and node_trace.*.log\n'",
"build-ts": "tsc",
"build": "npm run build-sass && npm run build-ts && npm run copy-assets && npm run build-js:analytics && npm run minfiy-build-js",
"build": "npm run build-sass && npm run build-ts && npm run copy-assets && npm run build-js:analytics",
"build-dev": "npm run build-sass && npm run build-ts && npm run copy-assets",
"build-sass": "rm -rf dist/public/style.css && sass --load-path=node_modules/govuk-frontend/dist/govuk --no-source-map src/assets/scss/application.scss dist/public/style.css --style compressed",
"build-js:analytics": "cp node_modules/@govuk-one-login/frontend-analytics/lib/analytics.js dist/public/scripts",
"clean": "rm -rf dist node_modules logs.json",
"clean-modules": "rm -rf node_modules",
"concat-client-js": "mkdir -p dist/public/scripts && uglifyjs src/assets/javascript/cookies.js src/assets/javascript/application.js -o dist/public/scripts/application.js -b",
"copy-assets": "mkdir -p dist && npm run concat-client-js && copyfiles -u 1 src/**/*.njk dist/ src/locales/**/** dist/ src/config/*.txt dist/ && cp node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js dist/public/scripts",
"copy-assets": "mkdir -p dist/public/scripts && copyfiles -u 1 src/**/*.njk dist/ src/locales/**/** dist/ src/config/*.txt dist/ && cp node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js dist/public/scripts",
"doctor": "NODE_ENV=production clinic doctor --autocannon [ -c 10 -d 10 /healthcheck ] -- node -r dotenv/config dist/server.js && echo '\n\nRemember to clean up files in .clinic and node_trace.*.log\n'",
"deep-clean": "npm cache clear --force && npm cache clean --force && npm run clean && npm install && npm run build",
"dev": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run watch-node\"",
Expand All @@ -23,7 +22,6 @@
"flame": "NODE_ENV=production clinic flame --autocannon [ -c 10 -d 10 /healthcheck ] -- node -r dotenv/config dist/server.js && echo '\n\nRemember to clean up files in .clinic and node_trace.*.log\n'",
"heap-profiler": "NODE_ENV=production clinic flame --autocannon [ / --method GET -d 120 ] -- node -r dotenv/config dist/server.js && echo '\n\nRemember to clean up files in .clinic and node_trace.*.log\n'",
"lint": "eslint .",
"minfiy-build-js": "uglifyjs dist/public/scripts/application.js -o dist/public/scripts/application.js -c -m",
"start": "node dist/server.js",
"test:audit": "npm audit",
"test:integration": "rm -rf test/coverage && NODE_ENV=test nyc mocha -r dotenv/config -P tsconfig.mocha.json \"src/**/*-integration.test.ts\"",
Expand Down
46 changes: 0 additions & 46 deletions src/assets/javascript/application.js

This file was deleted.

154 changes: 0 additions & 154 deletions src/assets/javascript/cookies.js

This file was deleted.

30 changes: 0 additions & 30 deletions src/assets/javascript/tests/cookies.test.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/components/common/layout/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,9 @@
<script type="text/javascript" {% if scriptNonce %} nonce="{{ scriptNonce }}"{% endif %}>
if (window.DI) {
window.DI.appInit({
ga4ContainerId: "{{ga4ContainerId}}",
uaContainerId: "{{uaContainerId}}"
ga4ContainerId: "{{ga4ContainerId}}"
}, {
enableGa4Tracking: {{isGa4Enabled}},
enableUaTracking: {{isUaEnabled}},
cookieDomain: "{{analyticsCookieDomain}}",
isDataSensitive: true,
enablePageViewTracking: true,
Expand Down
8 changes: 0 additions & 8 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,6 @@ export function googleAnalytics4GtmContainerId(): string {
return process.env.GOOGLE_ANALYTICS_4_GTM_CONTAINER_ID;
}

export function universalAnalyticsGtmContainerId(): string {
return process.env.UNIVERSAL_ANALYTICS_GTM_CONTAINER_ID;
}

export function googleAnalytics4Enabled(): boolean {
return process.env.GA4_ENABLED === "true";
}
Expand All @@ -451,10 +447,6 @@ export function missionLabsWebSocketAddress(): string {
return process.env.MISSION_LAB_WEBSOCKET_ADDR;
}

export function universalAnalyticsEnabled(): boolean {
return process.env.UA_ENABLED === "true";
}

export function selectContentTrackingEnabled(): boolean {
return process.env.SELECT_TRACKING_ENABLED === "true";
}
Expand Down
Loading

0 comments on commit 8d0b48f

Please sign in to comment.