MCPcopy Index your code
hub / github.com/winfunc/opcode / useAnalytics

Function useAnalytics

src/hooks/useAnalytics.ts:27–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27export function useAnalytics(): UseAnalyticsReturn {
28 const isEnabled = analytics.isEnabled();
29 const hasConsented = analytics.hasConsented();
30
31 const track = useCallback((eventName: EventName | string, properties?: Record<string, any>) => {
32 analytics.track(eventName, properties);
33 }, []);
34
35 const trackEvent = useTrackEvent();
36
37 return {
38 track,
39 trackEvent,
40 isEnabled,
41 hasConsented,
42 };
43}
44
45export function useTrackEvent() {
46 return {

Callers

nothing calls this directly

Calls 4

useTrackEventFunction · 0.85
trackMethod · 0.80
isEnabledMethod · 0.45
hasConsentedMethod · 0.45

Tested by

no test coverage detected