Skip to content

Commit 15b9ea8

Browse files
hanslmgechev
authored andcommitted
feat(@angular/cli): report telemetry opt-ins (#15054)
Only when prompted.
1 parent 2676c2d commit 15b9ea8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/angular/cli/models/analytics.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ export async function promptGlobalAnalytics(force = false) {
411411
${colors.yellow('ng analytics off')}
412412
`);
413413
console.log('');
414+
415+
// Send back a ping with the user `optin`.
416+
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optin');
417+
ua.pageview('/telemetry/optin');
418+
await ua.flush();
414419
} else {
415420
// Send back a ping with the user `optout`. This is the only thing we send.
416421
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optout');
@@ -465,6 +470,11 @@ export async function promptProjectAnalytics(force = false): Promise<boolean> {
465470
${colors.yellow('ng analytics project off')}
466471
`);
467472
console.log('');
473+
474+
// Send back a ping with the user `optin`.
475+
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optin');
476+
ua.pageview('/telemetry/project/optin');
477+
await ua.flush();
468478
} else {
469479
// Send back a ping with the user `optout`. This is the only thing we send.
470480
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optout');

0 commit comments

Comments
 (0)