@@ -11,30 +11,6 @@ import { injectPrivacySettingsLink } from '../../lib/injectPrivacySettingsLink';
11
11
import { submitComponentEvent } from '../ophan/ophan' ;
12
12
import { startup } from '../startup' ;
13
13
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
-
38
14
const init = async ( ) : Promise < void > => {
39
15
/**
40
16
* 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> => {
44
20
const browserId = getCookie ( { name : 'bwid' , shouldMemoize : true } ) ;
45
21
const { pageViewId } = window . guardian . config . ophan ;
46
22
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
-
60
23
onConsentChange ( ( consentState : ConsentState ) => {
61
24
if ( ! consentState ) return ;
62
25
// Register changes in consent state with Ophan
0 commit comments