Skip to content

Commit 6508607

Browse files
committed
Disable tracking for spammy events
1 parent 7c44add commit 6508607

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/common/src/utils/analytics.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,22 @@ export async function resetUserId() {
112112
}
113113
}
114114

115+
const isAllowedEvent = (eventName, secondArg) => {
116+
try {
117+
if (eventName === 'VSCode - workbenchActionExecuted') {
118+
if (secondArg.id.startsWith('cursor')) {
119+
return false;
120+
}
121+
}
122+
return true;
123+
} catch (e) {
124+
return true;
125+
}
126+
};
127+
115128
export default function track(eventName, secondArg: Object = {}) {
116129
try {
117-
if (!DNT) {
130+
if (!DNT && isAllowedEvent(eventName, secondArg)) {
118131
const data = {
119132
...secondArg,
120133
version: VERSION,

0 commit comments

Comments
 (0)