Skip to content

Commit 0eadbc4

Browse files
fix(analytics): Message for tracking in GA is always printed
In case the usage reporting is disabled, the verbose log of CLI still prints that will send information to Google Analytics. In fact it does not do it. The problem is that the message is printed before checking the state of the usage reporting. Fix this by placing the printing in the correct method.
1 parent 2e866b2 commit 0eadbc4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/services/analytics/analytics-service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class AnalyticsService extends AnalyticsServiceBase {
5858
gaSettings.customDimensions[GoogleAnalyticsCustomDimensions.client] = this.$options.analyticsClient || (isInteractive() ? AnalyticsClients.Cli : AnalyticsClients.Unknown);
5959

6060
const googleAnalyticsData: IGoogleAnalyticsTrackingInformation = _.merge({ type: TrackingTypes.GoogleAnalyticsData, category: AnalyticsClients.Cli }, gaSettings);
61+
this.$logger.trace("Will send the following information to Google Analytics:", googleAnalyticsData);
6162
return this.sendMessageToBroker(googleAnalyticsData);
6263
}
6364
}
@@ -99,8 +100,6 @@ export class AnalyticsService extends AnalyticsServiceBase {
99100
customDimensions
100101
};
101102

102-
this.$logger.trace("Will send the following information to Google Analytics:", googleAnalyticsEventData);
103-
104103
await this.trackInGoogleAnalytics(googleAnalyticsEventData);
105104
}
106105

0 commit comments

Comments
 (0)