Skip to content

Commit 297be22

Browse files
committed
remove unused cmp tracking in GA
1 parent e70bc32 commit 297be22

File tree

1 file changed

+0
-37
lines changed
  • dotcom-rendering/src/web/browser/bootCmp

1 file changed

+0
-37
lines changed

dotcom-rendering/src/web/browser/bootCmp/init.ts

-37
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,6 @@ import { injectPrivacySettingsLink } from '../../lib/injectPrivacySettingsLink';
1111
import { submitComponentEvent } from '../ophan/ophan';
1212
import { startup } from '../startup';
1313

14-
const trackPerformance = (
15-
timingCategory: string,
16-
timingVar: any,
17-
timingLabel: string,
18-
): void => {
19-
const { ga } = window;
20-
21-
if (!ga) {
22-
return;
23-
}
24-
25-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- not supported in all browsers
26-
if (window.performance?.now) {
27-
ga(
28-
'allEditorialPropertyTracker.send',
29-
'timing',
30-
timingCategory,
31-
timingVar,
32-
Math.round(window.performance.now()),
33-
timingLabel,
34-
);
35-
}
36-
};
37-
3814
const init = async (): Promise<void> => {
3915
/**
4016
* Keep this file in sync with CONSENT_TIMING in static/src/javascripts/boot.js in frontend
@@ -44,19 +20,6 @@ const init = async (): Promise<void> => {
4420
const browserId = getCookie({ name: 'bwid', shouldMemoize: true });
4521
const { pageViewId } = window.guardian.config.ophan;
4622

47-
// Track when CMP will show with GA
48-
cmp.willShowPrivacyMessage()
49-
.then((willShow) => {
50-
trackPerformance(
51-
'consent',
52-
'acquired',
53-
willShow ? 'new' : 'existing',
54-
);
55-
})
56-
.catch((e) =>
57-
log('dotcom', `CMP willShowPrivacyMessage - error: ${String(e)}`),
58-
);
59-
6023
onConsentChange((consentState: ConsentState) => {
6124
if (!consentState) return;
6225
// Register changes in consent state with Ophan

0 commit comments

Comments
 (0)