Skip to content

Commit

Permalink
devop: create event tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Jan 9, 2025
1 parent 575094d commit 839f0e4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/extension/src/libs/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,33 @@ import {

const metrics = new Metrics();


// tracks the new network ui
const trackNewNetworkUi = (event: string, options: {
networkName?: NetworkNames,
networkType?: 'regular' | 'testnet' | 'custom',
networkTab?: string,
isPinned?: boolean,
sortOption?: string,
customRpcUrl?: string,
customNetworkName?: string,
customChainId?: string,
customCurrencySymbol?: string,
customBlockExplorerUrl?: string
}) => {
metrics.track(event, options);
}

const trackGenericEvents = (event: GenericEvents) => {
metrics.track('generic', { event });
};

const trackNetworkSelected = (
event: NetworkChangeEvents,
options: { provider: ProviderName; network: NetworkNames },
options: {
provider: ProviderName;
network: NetworkNames
},
) => {
metrics.track('network', { event, ...options });
};
Expand Down

0 comments on commit 839f0e4

Please sign in to comment.