@@ -34,7 +34,7 @@ export class PaymentsGleanManager {
3434 cartMetricsData : CartMetrics ;
3535 cmsMetricsData : CmsMetricsData ;
3636 } ) {
37- if ( this . paymentsGleanConfig . enabled ) {
37+ if ( this . isEnabled ) {
3838 this . paymentsGleanServerEventsLogger . recordPaySetupView (
3939 this . populateCommonMetrics ( metrics )
4040 ) ;
@@ -46,7 +46,7 @@ export class PaymentsGleanManager {
4646 cartMetricsData : CartMetrics ;
4747 cmsMetricsData : CmsMetricsData ;
4848 } ) {
49- if ( this . paymentsGleanConfig . enabled ) {
49+ if ( this . isEnabled ) {
5050 this . paymentsGleanServerEventsLogger . recordPaySetupEngage (
5151 this . populateCommonMetrics ( metrics )
5252 ) ;
@@ -61,7 +61,7 @@ export class PaymentsGleanManager {
6161 } ,
6262 paymentProvider ?: PaymentProvidersType
6363 ) {
64- if ( this . paymentsGleanConfig . enabled ) {
64+ if ( this . isEnabled ) {
6565 this . paymentsGleanServerEventsLogger . recordPaySetupSubmit ( {
6666 ...this . populateCommonMetrics ( metrics ) ,
6767 subscription_payment_provider :
@@ -80,7 +80,7 @@ export class PaymentsGleanManager {
8080 ) {
8181 const commonMetrics = this . populateCommonMetrics ( metrics ) ;
8282
83- if ( this . paymentsGleanConfig . enabled ) {
83+ if ( this . isEnabled ) {
8484 this . paymentsGleanServerEventsLogger . recordPaySetupSuccess ( {
8585 ...commonMetrics ,
8686 subscription_payment_provider :
@@ -99,7 +99,7 @@ export class PaymentsGleanManager {
9999 ) {
100100 const commonMetrics = this . populateCommonMetrics ( metrics ) ;
101101
102- if ( this . paymentsGleanConfig . enabled ) {
102+ if ( this . isEnabled ) {
103103 this . paymentsGleanServerEventsLogger . recordPaySetupFail ( {
104104 ...commonMetrics ,
105105 subscription_payment_provider :
@@ -117,7 +117,7 @@ export class PaymentsGleanManager {
117117 ) {
118118 const commonMetrics = this . populateCommonMetrics ( metrics ) ;
119119
120- if ( this . paymentsGleanConfig . enabled ) {
120+ if ( this . isEnabled ) {
121121 this . paymentsGleanServerEventsLogger . recordSubscriptionEnded ( {
122122 ...commonMetrics ,
123123 subscription_payment_provider :
@@ -178,4 +178,8 @@ export class PaymentsGleanManager {
178178 ...mapSubscriptionCancellation ( subscriptionCancellationData ) ,
179179 } ;
180180 }
181+
182+ private get isEnabled ( ) {
183+ return this . paymentsGleanConfig . enabled && process . env [ 'CI' ] !== 'true' ;
184+ }
181185}
0 commit comments