42 lines
918 B
TypeScript
42 lines
918 B
TypeScript
export type AnalyticsEventName =
|
|
| 'page_view'
|
|
| 'section_view'
|
|
| 'navigation_click'
|
|
| 'locale_change'
|
|
| 'theme_change'
|
|
| 'mobile_nav_open'
|
|
| 'mobile_nav_close'
|
|
| 'product_tour_open'
|
|
| 'product_tour_step'
|
|
| 'product_tour_complete'
|
|
| 'product_tour_close'
|
|
| 'demo_open'
|
|
| 'demo_submit_attempt'
|
|
| 'demo_validation_error'
|
|
| 'demo_submit_success'
|
|
| 'demo_submit_failure'
|
|
| 'demo_close'
|
|
| 'faq_open';
|
|
export interface AnalyticsContext {
|
|
routeId: string;
|
|
locale: 'en' | 'fr' | 'ar';
|
|
direction: 'ltr' | 'rtl';
|
|
resolvedTheme: 'light' | 'dark';
|
|
source?: string;
|
|
step?: number;
|
|
errorCode?: string;
|
|
}
|
|
export interface AnalyticsAdapter {
|
|
consentGranted(): boolean;
|
|
track(name: AnalyticsEventName, context: AnalyticsContext): void;
|
|
}
|
|
export const forbiddenPayloadKeys = [
|
|
'name',
|
|
'email',
|
|
'company',
|
|
'message',
|
|
'phone',
|
|
'fieldValue',
|
|
'serverResponse',
|
|
] as const;
|