Skip to content

Commit

Permalink
feat(@angular/cli): report telemetry opt-ins (#15054)
Browse files Browse the repository at this point in the history
Only when prompted.
  • Loading branch information
hansl authored and mgechev committed Jul 12, 2019
1 parent 2676c2d commit 15b9ea8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/angular/cli/models/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ export async function promptGlobalAnalytics(force = false) {
${colors.yellow('ng analytics off')}
`);
console.log('');

// Send back a ping with the user `optin`.
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optin');
ua.pageview('/telemetry/optin');
await ua.flush();
} else {
// Send back a ping with the user `optout`. This is the only thing we send.
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optout');
Expand Down Expand Up @@ -465,6 +470,11 @@ export async function promptProjectAnalytics(force = false): Promise<boolean> {
${colors.yellow('ng analytics project off')}
`);
console.log('');

// Send back a ping with the user `optin`.
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optin');
ua.pageview('/telemetry/project/optin');
await ua.flush();
} else {
// Send back a ping with the user `optout`. This is the only thing we send.
const ua = new UniversalAnalytics(AnalyticsProperties.AngularCliDefault, 'optout');
Expand Down

0 comments on commit 15b9ea8

Please sign in to comment.