We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 768f854 commit c8a99e6Copy full SHA for c8a99e6
packages/core/src/analytics/utils.ts
@@ -34,9 +34,11 @@ export const isAnalyticsEnabled = (): boolean => {
34
// eslint-disable-next-line @typescript-eslint/no-explicit-any
35
export const trackEvent = (eventName: string, properties: Record<string, any> = {}) => {
36
try {
37
- track(eventName, properties, {
38
- user_id: getUserIdentifier() || 'unknown',
39
- })
+ if (isAnalyticsEnabled()) {
+ track(eventName, properties, {
+ user_id: getUserIdentifier() || 'unknown',
40
+ })
41
+ }
42
} catch (error) {
43
// Silently fail to not disrupt dev server
44
}
0 commit comments