feat(telemetry): product interaction events
- h2h_viewed from match card, dock, profile, stats, predictions - reaction_sent with emoji and surface; score_report_opened from all three report entry points - stats_filtered and stats_sorted on stats route and profile - rules/teams/players/bracket/tournament view events with sources - match_history_viewed, badge_viewed, player_searched (count only)
This commit is contained in:
@@ -14,7 +14,7 @@ export interface ClientEventRow {
|
||||
session_id?: string;
|
||||
route_id?: string;
|
||||
value?: number;
|
||||
props?: { source?: string; emoji?: string; tournament?: string } | null;
|
||||
props?: { source?: string; emoji?: string; tournament?: string; value?: string } | null;
|
||||
}
|
||||
|
||||
export interface ClientErrorRow {
|
||||
@@ -78,8 +78,10 @@ export const newClientEventAccumulator = (): ClientEventAccumulator => ({
|
||||
eventDetails: new Map(),
|
||||
});
|
||||
|
||||
// emoji first: reaction_sent carries both emoji and source, and its aggregate
|
||||
// breakdown should be by emoji.
|
||||
const eventDetail = (row: ClientEventRow): string | undefined =>
|
||||
row.props?.source ?? row.props?.emoji ?? row.props?.tournament;
|
||||
row.props?.emoji ?? row.props?.value ?? row.props?.source ?? row.props?.tournament;
|
||||
|
||||
export const accumulateClientEvents = (acc: ClientEventAccumulator, rows: ClientEventRow[]) => {
|
||||
for (const row of rows) {
|
||||
|
||||
Reference in New Issue
Block a user