import type { ButtonTrackingProps } from "../utils/customAnalytics"; import type { AnalyticsConfig } from "../types"; export type StudioAnalyticsEventName = "page_view" | "property_view" | "floorplan_view" | "floorplan_cta_click" | "unit_view" | "form_submit" | "tour_booking" | "apply_click" | "phone_click" | "email_click" | "chat_start" | "property_map_explorer_view" | "property_map_search" | "property_map_filter_change" | "property_map_place_select" | "property_map_zero_results" | "property_map_reset" | "property_map_view_change" | "property_map_maps_click"; type PropertyMapExplorerEventName = Extract; type AnalyticsParameter = string | number | boolean | undefined; export type StudioAnalyticsParameters = Record; interface LegacyAnalyticsEvent { action: string; category?: string; label?: string; value?: number; } export interface StudioAnalyticsBrowser { gtag?: (...args: any[]) => void; dataLayer?: Array>; } /** * DOM event announced on the page's window for every Studio analytics event, * whatever the site's own GA4/GTM configuration. Nothing leaves the page on its * own; the iframe embed bridge listens for it to forward events to the host * page's data layer. */ export declare const STUDIO_ANALYTICS_DOM_EVENT = "elise-studio:analytics"; export interface StudioAnalyticsDomEventDetail { event: string; parameters: Record; } export declare function announceStudioAnalyticsEvent(event: string, parameters?: StudioAnalyticsParameters, eventTarget?: EventTarget | undefined): void; /** * Dispatch one event to the configured destination using the same payload keys. * Explicit mode is exclusive; missing mode retains the legacy dual-ID behavior. * Every event is also announced as a DOM event (see STUDIO_ANALYTICS_DOM_EVENT). */ export declare function dispatchStudioAnalyticsEvent(analytics: AnalyticsConfig | undefined, event: string, parameters?: StudioAnalyticsParameters, target?: StudioAnalyticsBrowser | undefined, eventTarget?: EventTarget): void; /** Classify a contact target without returning or recording its PII-bearing value. */ export declare function contactEventForTarget(target: string | undefined): "phone" | "email" | undefined; export declare function useAnalytics(): { trackCustomEvent: (tracking: ButtonTrackingProps) => boolean; trackEvent: ({ action, category, label, value }: LegacyAnalyticsEvent) => void; trackPageView: (path: string, title?: string) => void; trackPropertyView: (propertyId?: string) => void; trackFloorplanView: (propertyId: string | undefined, floorplanId: string) => void; trackFloorplanCtaClick: (propertyId: string | undefined, floorplanId: string, ctaAction?: "navigate" | "scroll" | "openModal" | "externalLink") => void; trackUnitView: (propertyId: string | undefined, unitId: string | undefined, floorplanId?: string) => void; trackTourBooking: (propertyId: string | undefined, tourType?: string) => void; trackApplyClick: (propertyId: string | undefined, unitId?: string) => void; trackFormSubmission: (formType: string, propertyId?: string) => void; trackContactClick: (kind: "phone" | "email", propertyId?: string) => void; trackChatStart: (propertyId?: string) => void; trackPropertyMapExplorer: (event: PropertyMapExplorerEventName, parameters?: StudioAnalyticsParameters) => void; }; export {}; //# sourceMappingURL=useAnalytics.d.ts.map