Skip to content

Commit 9d0c636

Browse files
authored
Add telemetry for marketplace tab views and install clicks (#4781)
1 parent 48c9bd5 commit 9d0c636

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

packages/types/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.26.0",
3+
"version": "1.27.0",
44
"description": "TypeScript type definitions for Roo Code.",
55
"publishConfig": {
66
"access": "public",

packages/types/src/telemetry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export enum TelemetryEventName {
4343

4444
MARKETPLACE_ITEM_INSTALLED = "Marketplace Item Installed",
4545
MARKETPLACE_ITEM_REMOVED = "Marketplace Item Removed",
46+
MARKETPLACE_TAB_VIEWED = "Marketplace Tab Viewed",
47+
MARKETPLACE_INSTALL_BUTTON_CLICKED = "Marketplace Install Button Clicked",
4648

4749
SCHEMA_VALIDATION_ERROR = "Schema Validation Error",
4850
DIFF_APPLICATION_ERROR = "Diff Application Error",

webview-ui/src/App.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { MarketplaceViewStateManager } from "./components/marketplace/Marketplac
88

99
import { vscode } from "./utils/vscode"
1010
import { telemetryClient } from "./utils/TelemetryClient"
11+
import { TelemetryEventName } from "@roo-code/types"
1112
import { ExtensionStateContextProvider, useExtensionState } from "./context/ExtensionStateContext"
1213
import ChatView, { ChatViewRef } from "./components/chat/ChatView"
1314
import HistoryView from "./components/history/HistoryView"
@@ -144,6 +145,13 @@ const App = () => {
144145
// Tell the extension that we are ready to receive messages.
145146
useEffect(() => vscode.postMessage({ type: "webviewDidLaunch" }), [])
146147

148+
// Track marketplace tab views
149+
useEffect(() => {
150+
if (tab === "marketplace" && experiments.marketplace) {
151+
telemetryClient.capture(TelemetryEventName.MARKETPLACE_TAB_VIEWED)
152+
}
153+
}, [tab, experiments.marketplace])
154+
147155
if (!didHydrateState) {
148156
return null
149157
}

webview-ui/src/components/marketplace/components/MarketplaceItemCard.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useMemo, useState } from "react"
2-
import { MarketplaceItem } from "@roo-code/types"
2+
import { MarketplaceItem, TelemetryEventName } from "@roo-code/types"
33
import { vscode } from "@/utils/vscode"
4+
import { telemetryClient } from "@/utils/TelemetryClient"
45
import { ViewState } from "../MarketplaceViewStateManager"
56
import { useAppTranslation } from "@/i18n/TranslationContext"
67
import { isValidUrl } from "../../../utils/url"
@@ -43,6 +44,13 @@ export const MarketplaceItemCard: React.FC<MarketplaceItemCardProps> = ({ item,
4344
const isInstalled = isInstalledGlobally || isInstalledInProject
4445

4546
const handleInstallClick = () => {
47+
// Send telemetry for install button click
48+
telemetryClient.capture(TelemetryEventName.MARKETPLACE_INSTALL_BUTTON_CLICKED, {
49+
itemId: item.id,
50+
itemType: item.type,
51+
itemName: item.name,
52+
})
53+
4654
// Show modal for all item types (MCP and modes)
4755
setShowInstallModal(true)
4856
}

0 commit comments

Comments
 (0)