diff --git a/app/sites/[id]/settings/page.tsx b/app/sites/[id]/settings/page.tsx index e52ce07..32b0ceb 100644 --- a/app/sites/[id]/settings/page.tsx +++ b/app/sites/[id]/settings/page.tsx @@ -73,6 +73,8 @@ export default function SiteSettingsPage() { collect_screen_resolution: true, // Performance insights setting enable_performance_insights: false, + // Bot and noise filtering + filter_bots: true, // Session replay settings replay_mode: 'disabled' as ReplayMode, replay_sampling_rate: 100, @@ -108,6 +110,8 @@ export default function SiteSettingsPage() { collect_screen_resolution: data.collect_screen_resolution ?? true, // Performance insights setting (default to false) enable_performance_insights: data.enable_performance_insights ?? false, + // Bot and noise filtering (default to true) + filter_bots: data.filter_bots ?? true, // Session replay settings (legacy consent_required from API mapped to anonymous_skeleton) replay_mode: ((data as { replay_mode?: string }).replay_mode === 'consent_required' ? 'anonymous_skeleton' : data.replay_mode) || 'disabled', replay_sampling_rate: snapSamplingRate(data.replay_sampling_rate ?? 100), @@ -152,6 +156,8 @@ export default function SiteSettingsPage() { collect_screen_resolution: formData.collect_screen_resolution, // Performance insights setting enable_performance_insights: formData.enable_performance_insights, + // Bot and noise filtering + filter_bots: formData.filter_bots, // Session replay settings replay_mode: formData.replay_mode, replay_sampling_rate: formData.replay_sampling_rate, @@ -691,6 +697,30 @@ export default function SiteSettingsPage() { + {/* Bot and noise filtering */} +
+

Filtering

+
+
+
+

Filter bots and referrer spam

+

+ Exclude known crawlers, scrapers, and referrer spam domains from your stats +

+
+ +
+
+
+ {/* Performance Insights Toggle */}

Performance Insights

diff --git a/lib/api/sites.ts b/lib/api/sites.ts index 1893027..65c7e36 100644 --- a/lib/api/sites.ts +++ b/lib/api/sites.ts @@ -20,6 +20,8 @@ export interface Site { collect_screen_resolution?: boolean // Performance insights setting enable_performance_insights?: boolean + // Bot and noise filtering + filter_bots?: boolean // Session replay settings replay_mode?: ReplayMode replay_sampling_rate?: number @@ -50,6 +52,8 @@ export interface UpdateSiteRequest { collect_screen_resolution?: boolean // Performance insights setting enable_performance_insights?: boolean + // Bot and noise filtering + filter_bots?: boolean // Session replay settings replay_mode?: ReplayMode replay_sampling_rate?: number