@click-chutney/analytics
Version:
Complete website analytics solution. Everything you need to understand your visitors - no Google Analytics required.
56 lines • 1.59 kB
TypeScript
import { ClickChutneyTracker } from './tracker';
interface AnalyticsProps {
trackingId?: string;
debug?: boolean;
disableInDev?: boolean;
config?: {
autoTrack?: boolean;
sessionTimeout?: number;
apiUrl?: string;
};
}
declare global {
interface Window {
__ccAnalyticsInitialized?: boolean;
__ccTracker?: ClickChutneyTracker;
__ccReactAPI?: {
page: (url?: string, title?: string) => void;
track: (event: string, properties?: Record<string, any>) => void;
identify: (userId: string, traits?: Record<string, any>) => void;
set: (properties: Record<string, any>) => void;
};
}
}
/**
* Simple Analytics component for React/Next.js
*
* Usage:
* ```tsx
* import { Analytics } from '@click-chutney/analytics/react';
*
* export default function Layout({ children }) {
* return (
* <html>
* <body>
* {children}
* <Analytics />
* </body>
* </html>
* );
* }
* ```
*/
export declare function Analytics(props?: AnalyticsProps): null;
/**
* Hook for manual analytics tracking
*/
export declare function useAnalytics(): {
page: (url?: string, title?: string) => void;
track: (event: string, properties?: Record<string, any>) => void;
identify: (userId: string, traits?: Record<string, any>) => void;
set: (properties: Record<string, any>) => void;
};
export default Analytics;
export { Analytics as ClickChutneyAnalytics };
export { useAnalytics as useClickChutney };
//# sourceMappingURL=react.d.ts.map