@temps-sdk/react-analytics 0.0.1-beta.8 → 0.0.1-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Provider.d.ts +1 -1
- package/dist/Provider.d.ts.map +1 -1
- package/dist/Provider.js +38 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/usePageLeave.d.ts +13 -0
- package/dist/usePageLeave.d.ts.map +1 -0
- package/dist/usePageLeave.js +65 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +34 -0
- package/package.json +1 -1
package/dist/Provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AnalyticsContextValue, TempsAnalyticsProviderProps } from "./types";
|
|
2
|
-
export declare function TempsAnalyticsProvider({ basePath, disabled, ignoreLocalhost, autoTrackPageviews, domain, children, }: TempsAnalyticsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function TempsAnalyticsProvider({ basePath, disabled, ignoreLocalhost, autoTrackPageviews, autoTrackPageLeave, pageLeaveEventName, domain, children, }: TempsAnalyticsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function useTempsAnalytics(): AnalyticsContextValue;
|
|
4
4
|
//# sourceMappingURL=Provider.d.ts.map
|
package/dist/Provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../src/Provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../src/Provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAKlF,wBAAgB,sBAAsB,CAAC,EACrC,QAAwB,EACxB,QAAgB,EAChB,eAAsB,EACtB,kBAAyB,EACzB,kBAAyB,EACzB,kBAAiC,EACjC,MAAM,EACN,QAAQ,GACT,EAAE,2BAA2B,2CAiL7B;AAED,wBAAgB,iBAAiB,IAAI,qBAAqB,CAMzD"}
|
package/dist/Provider.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { isLocalhostLike, isTestEnvironment, sendAnalytics } from "./utils";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
4
|
+
import { isLocalhostLike, isTestEnvironment, sendAnalytics, sendAnalyticsReliable } from "./utils";
|
|
5
5
|
const AnalyticsContext = createContext(undefined);
|
|
6
|
-
export function TempsAnalyticsProvider({ basePath = "/api/_temps", disabled = false, ignoreLocalhost = true, autoTrackPageviews = true, domain, children, }) {
|
|
6
|
+
export function TempsAnalyticsProvider({ basePath = "/api/_temps", disabled = false, ignoreLocalhost = true, autoTrackPageviews = true, autoTrackPageLeave = true, pageLeaveEventName = "page_leave", domain, children, }) {
|
|
7
7
|
const enabled = useMemo(() => {
|
|
8
8
|
if (disabled)
|
|
9
9
|
return false;
|
|
@@ -122,6 +122,41 @@ export function TempsAnalyticsProvider({ basePath = "/api/_temps", disabled = fa
|
|
|
122
122
|
document.addEventListener("click", onClick);
|
|
123
123
|
return () => document.removeEventListener("click", onClick);
|
|
124
124
|
}, [enabled, trackEvent]);
|
|
125
|
+
// Page leave tracking
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (!autoTrackPageLeave || !enabled)
|
|
128
|
+
return;
|
|
129
|
+
let hasTracked = false;
|
|
130
|
+
let startTime = Date.now();
|
|
131
|
+
const trackPageLeave = () => {
|
|
132
|
+
if (hasTracked)
|
|
133
|
+
return;
|
|
134
|
+
hasTracked = true;
|
|
135
|
+
const timeOnPage = Date.now() - startTime;
|
|
136
|
+
sendAnalyticsReliable("event", {
|
|
137
|
+
event_name: pageLeaveEventName,
|
|
138
|
+
request_query: window.location.search,
|
|
139
|
+
request_path: window.location.pathname,
|
|
140
|
+
domain: domain || window.location.hostname,
|
|
141
|
+
event_data: {
|
|
142
|
+
time_on_page_ms: timeOnPage,
|
|
143
|
+
timestamp: new Date().toISOString(),
|
|
144
|
+
url: window.location.href,
|
|
145
|
+
referrer: document.referrer,
|
|
146
|
+
},
|
|
147
|
+
}, basePath);
|
|
148
|
+
};
|
|
149
|
+
// Use pagehide as primary (most reliable), with beforeunload as fallback
|
|
150
|
+
const handlePageLeave = () => trackPageLeave();
|
|
151
|
+
// pagehide is the most reliable for modern browsers
|
|
152
|
+
window.addEventListener("pagehide", handlePageLeave);
|
|
153
|
+
// beforeunload as fallback for older browsers
|
|
154
|
+
window.addEventListener("beforeunload", handlePageLeave);
|
|
155
|
+
return () => {
|
|
156
|
+
window.removeEventListener("pagehide", handlePageLeave);
|
|
157
|
+
window.removeEventListener("beforeunload", handlePageLeave);
|
|
158
|
+
};
|
|
159
|
+
}, [autoTrackPageLeave, enabled, pageLeaveEventName, domain, basePath]);
|
|
125
160
|
const value = useMemo(() => ({ trackEvent, identify, trackPageview, enabled }), [trackEvent, identify, trackPageview, enabled]);
|
|
126
161
|
return _jsx(AnalyticsContext.Provider, { value: value, children: children });
|
|
127
162
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ export interface AnalyticsContextValue {
|
|
|
32
32
|
export interface TempsAnalyticsProviderProps extends AnalyticsClientOptions {
|
|
33
33
|
/** Auto track pageviews on route changes. Defaults to true. */
|
|
34
34
|
autoTrackPageviews?: boolean;
|
|
35
|
+
/** Auto track page leave events. Defaults to true. */
|
|
36
|
+
autoTrackPageLeave?: boolean;
|
|
37
|
+
/** Custom event name for page leave events. Defaults to "page_leave". */
|
|
38
|
+
pageLeaveEventName?: string;
|
|
35
39
|
/** Children to render inside the provider. */
|
|
36
40
|
children: React.ReactNode;
|
|
37
41
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEnF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,oDAAoD;IACpD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvF,mCAAmC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;IACzE,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEnF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,oDAAoD;IACpD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvF,mCAAmC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;IACzE,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JsonValue } from "./types";
|
|
2
|
+
export interface UsePageLeaveOptions {
|
|
3
|
+
/** Custom event name. Defaults to "page_leave" */
|
|
4
|
+
eventName?: string;
|
|
5
|
+
/** Additional data to send with the page leave event */
|
|
6
|
+
eventData?: Record<string, JsonValue>;
|
|
7
|
+
/** Whether to enable page leave tracking. Defaults to true */
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function usePageLeave(options?: UsePageLeaveOptions): {
|
|
11
|
+
triggerPageLeave: () => Promise<void> | undefined;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=usePageLeave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageLeave.d.ts","sourceRoot":"","sources":["../src/usePageLeave.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB;;EA2E7D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useTempsAnalytics } from "./Provider";
|
|
4
|
+
import { sendAnalyticsReliable } from "./utils";
|
|
5
|
+
export function usePageLeave(options = {}) {
|
|
6
|
+
const { eventName = "page_leave", eventData = {}, enabled = true } = options;
|
|
7
|
+
const { enabled: analyticsEnabled, trackEvent } = useTempsAnalytics();
|
|
8
|
+
const hasTrackedRef = useRef(false);
|
|
9
|
+
const startTimeRef = useRef();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
startTimeRef.current = Date.now();
|
|
12
|
+
hasTrackedRef.current = false;
|
|
13
|
+
}, []);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!enabled || !analyticsEnabled)
|
|
16
|
+
return;
|
|
17
|
+
const trackPageLeave = () => {
|
|
18
|
+
if (hasTrackedRef.current)
|
|
19
|
+
return;
|
|
20
|
+
hasTrackedRef.current = true;
|
|
21
|
+
const timeOnPage = startTimeRef.current ? Date.now() - startTimeRef.current : 0;
|
|
22
|
+
const finalEventData = {
|
|
23
|
+
...eventData,
|
|
24
|
+
time_on_page_ms: timeOnPage,
|
|
25
|
+
timestamp: new Date().toISOString(),
|
|
26
|
+
url: window.location.href,
|
|
27
|
+
referrer: document.referrer,
|
|
28
|
+
};
|
|
29
|
+
// Use reliable sending method that tries sendBeacon first
|
|
30
|
+
sendAnalyticsReliable("event", {
|
|
31
|
+
event_name: eventName,
|
|
32
|
+
request_query: window.location.search,
|
|
33
|
+
request_path: window.location.pathname,
|
|
34
|
+
domain: window.location.hostname,
|
|
35
|
+
event_data: finalEventData,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
// Use pagehide as primary (most reliable), with beforeunload as fallback
|
|
39
|
+
const handlePageLeave = () => trackPageLeave();
|
|
40
|
+
// pagehide is the most reliable for modern browsers
|
|
41
|
+
window.addEventListener("pagehide", handlePageLeave);
|
|
42
|
+
// beforeunload as fallback for older browsers
|
|
43
|
+
window.addEventListener("beforeunload", handlePageLeave);
|
|
44
|
+
return () => {
|
|
45
|
+
window.removeEventListener("pagehide", handlePageLeave);
|
|
46
|
+
window.removeEventListener("beforeunload", handlePageLeave);
|
|
47
|
+
};
|
|
48
|
+
}, [enabled, analyticsEnabled, eventName, eventData]);
|
|
49
|
+
// Manual trigger function
|
|
50
|
+
const triggerPageLeave = () => {
|
|
51
|
+
if (!enabled || !analyticsEnabled || hasTrackedRef.current)
|
|
52
|
+
return;
|
|
53
|
+
hasTrackedRef.current = true;
|
|
54
|
+
const timeOnPage = startTimeRef.current ? Date.now() - startTimeRef.current : 0;
|
|
55
|
+
return trackEvent(eventName, {
|
|
56
|
+
...eventData,
|
|
57
|
+
time_on_page_ms: timeOnPage,
|
|
58
|
+
timestamp: new Date().toISOString(),
|
|
59
|
+
url: window.location.href,
|
|
60
|
+
referrer: document.referrer,
|
|
61
|
+
manual_trigger: true,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return { triggerPageLeave };
|
|
65
|
+
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export declare function getRequestId(): string | undefined;
|
|
|
3
3
|
export declare function isLocalhostLike(): boolean;
|
|
4
4
|
export declare function isTestEnvironment(): boolean;
|
|
5
5
|
export declare function sendAnalytics(endpoint: string, data: Record<string, JsonValue>, method?: "POST" | "PUT" | "PATCH", basePath?: string): Promise<void>;
|
|
6
|
+
export declare function sendAnalyticsReliable(endpoint: string, data: Record<string, JsonValue>, basePath?: string): boolean;
|
|
6
7
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAcjD;AAED,wBAAgB,eAAe,IAAI,OAAO,CASzC;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAY3C;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/B,MAAM,GAAE,MAAM,GAAG,KAAK,GAAG,OAAgB,EACzC,QAAQ,SAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAcjD;AAED,wBAAgB,eAAe,IAAI,OAAO,CASzC;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAY3C;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/B,MAAM,GAAE,MAAM,GAAG,KAAK,GAAG,OAAgB,EACzC,QAAQ,SAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/B,QAAQ,SAAgB,GACvB,OAAO,CAqCT"}
|
package/dist/utils.js
CHANGED
|
@@ -61,3 +61,37 @@ export async function sendAnalytics(endpoint, data, method = "POST", basePath =
|
|
|
61
61
|
console.error("Failed to send analytics:", error);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
export function sendAnalyticsReliable(endpoint, data, basePath = "/api/_temps") {
|
|
65
|
+
try {
|
|
66
|
+
const enrichedData = {
|
|
67
|
+
...data,
|
|
68
|
+
request_id: getRequestId(),
|
|
69
|
+
session_id: typeof localStorage !== "undefined"
|
|
70
|
+
? localStorage.getItem("session_id") || undefined
|
|
71
|
+
: undefined,
|
|
72
|
+
};
|
|
73
|
+
const url = `${basePath}/${endpoint}`;
|
|
74
|
+
const payload = JSON.stringify(enrichedData);
|
|
75
|
+
// Try sendBeacon first (most reliable for page unload)
|
|
76
|
+
if (navigator.sendBeacon && typeof navigator.sendBeacon === "function") {
|
|
77
|
+
const blob = new Blob([payload], { type: "application/json" });
|
|
78
|
+
return navigator.sendBeacon(url, blob);
|
|
79
|
+
}
|
|
80
|
+
// Fallback to synchronous fetch with keepalive
|
|
81
|
+
fetch(url, {
|
|
82
|
+
method: "POST",
|
|
83
|
+
headers: { "Content-Type": "application/json" },
|
|
84
|
+
body: payload,
|
|
85
|
+
keepalive: true,
|
|
86
|
+
}).catch((error) => {
|
|
87
|
+
// eslint-disable-next-line no-console
|
|
88
|
+
console.error("Failed to send analytics (reliable):", error);
|
|
89
|
+
});
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
// eslint-disable-next-line no-console
|
|
94
|
+
console.error("Failed to send analytics (reliable):", error);
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|