Skip to content

Commit

Permalink
Add a first_open even after GA ack to track new users (#697)
Browse files Browse the repository at this point in the history
* Add a first_open even after GA ack to track new users
  • Loading branch information
i2amsam authored Jul 26, 2024
1 parent 7b19f83 commit 0789701
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions genkit-tools/common/src/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ export class PageViewEvent extends GAEvent {
}
}

export class FirstUsageEvent extends GAEvent {
name = 'first_visit';
duration = 1;

constructor() {
super();
}
}

export class ToolsRequestEvent extends GAEvent {
name = 'tools_request';
duration = 1;
Expand Down Expand Up @@ -121,6 +130,8 @@ export async function notifyAnalyticsIfFirstRun(): Promise<void> {
await readline.question('Press "Enter" to continue');

configstore.set(NOTIFICATION_ACKED, true);

await record(new FirstUsageEvent());
}

/** Gets session information for the UI. */
Expand Down

0 comments on commit 0789701

Please sign in to comment.