@betterlytics/tracker
Version:
Privacy-focused, cookieless analytics for your website
34 lines (32 loc) • 1.16 kB
TypeScript
interface BetterlyticsConfig {
/** Custom tracking server URL (defaults to https://betterlytics.io/track) */
serverUrl?: string;
/** Custom analytics script URL (defaults to https://betterlytics.io/analytics.js) */
scriptUrl?: string;
/** Array of URL patterns to normalize (e.g., ['/users/*', '/products/*']) */
dynamicUrls?: string[];
/** Enable Core Web Vitals tracking */
enableWebVitals?: boolean;
/** Disable Outbound Link tracking */
disableOutboundLinks?: boolean;
/** Mode for Outbound Link tracking (defaults to "domain") */
outboundLinksMode?: "domain" | "full";
/** Debug */
debug?: boolean;
}
type InitFunction = (siteId: string, options?: BetterlyticsConfig) => void;
type TrackingFunction = (eventName: string, eventProps?: object) => void;
type Betterlytics = {
init: InitFunction;
event: TrackingFunction;
};
declare global {
interface Window {
betterlytics?: {
event: TrackingFunction;
q?: IArguments[];
};
}
}
declare const _default: Betterlytics;
export { type Betterlytics, type BetterlyticsConfig, _default as default };