useAnalytics
The useAnalytics hook is designed to facilitate custom analytics integration within your application. It allows you to set a custom analytics provider and provides a trackEvent function that can be used to track crucial events in your custom components.
Hook Type definition: useAnalytics
Example usage
const { getAnalyticsProvider, setAnalyticsProvider, trackEvent } = useAnalytics();Hook Return Value
getAnalyticsProvider
getAnalyticsProviderA function to get custom analytics provider.
| Type |
|---|
| Function of type: () => IAnalyticsProvider |
setAnalyticsProvider
setAnalyticsProviderA function to set a custom analytics provider dynamically
| Type |
|---|
| Function of type: (provider: IAnalyticsProvider) => void |
trackEvent
trackEventA function that allows you to track custom events.
| Type |
|---|
| Function of type: (event: string, trackObj: unknown) => void |
Updated about 2 months ago
