@base44-preview/sdk 0.8.12-pr.65.5df0d45 → 0.8.12-pr.66.2e24aea
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.
|
@@ -2,7 +2,6 @@ import { AxiosInstance } from "axios";
|
|
|
2
2
|
import { TrackEventParams, AnalyticsModuleOptions } from "./analytics.types";
|
|
3
3
|
import type { AuthModule } from "./auth.types";
|
|
4
4
|
export declare const USER_HEARTBEAT_EVENT_NAME = "__user_heartbeat_event__";
|
|
5
|
-
export declare const ANALYTICS_REFERRER_EVENT_NAME = "__referrer_event__";
|
|
6
5
|
export declare const ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY = "analytics-enable";
|
|
7
6
|
export declare const ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY = "base44_analytics_session_id";
|
|
8
7
|
export interface AnalyticsModuleArgs {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getSharedInstance } from "../utils/sharedInstance.js";
|
|
2
2
|
import { generateUuid } from "../utils/common.js";
|
|
3
3
|
export const USER_HEARTBEAT_EVENT_NAME = "__user_heartbeat_event__";
|
|
4
|
-
export const ANALYTICS_REFERRER_EVENT_NAME = "__referrer_event__";
|
|
5
4
|
export const ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY = "analytics-enable";
|
|
6
5
|
export const ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY = "base44_analytics_session_id";
|
|
7
6
|
const defaultConfiguration = {
|
|
@@ -21,7 +20,6 @@ const analyticsSharedState = getSharedInstance(ANALYTICS_SHARED_STATE_NAME, () =
|
|
|
21
20
|
requestsQueue: [],
|
|
22
21
|
isProcessing: false,
|
|
23
22
|
isHeartBeatProcessing: false,
|
|
24
|
-
wasReferrerTracked: false,
|
|
25
23
|
sessionContext: null,
|
|
26
24
|
config: {
|
|
27
25
|
...defaultConfiguration,
|
|
@@ -126,8 +124,6 @@ export const createAnalyticsModule = ({ axiosClient, serverUrl, appId, userAuthM
|
|
|
126
124
|
startProcessing();
|
|
127
125
|
// start the heart beat processor //
|
|
128
126
|
clearHeartBeatProcessor = startHeartBeatProcessor(track);
|
|
129
|
-
// track the referrer event //
|
|
130
|
-
trackReferrerEvent(track);
|
|
131
127
|
// start the visibility change listener //
|
|
132
128
|
if (typeof window !== "undefined") {
|
|
133
129
|
window.addEventListener("visibilitychange", onVisibilityChange);
|
|
@@ -170,15 +166,6 @@ function startHeartBeatProcessor(track) {
|
|
|
170
166
|
analyticsSharedState.isHeartBeatProcessing = false;
|
|
171
167
|
};
|
|
172
168
|
}
|
|
173
|
-
function trackReferrerEvent(track) {
|
|
174
|
-
if (typeof window === "undefined" || analyticsSharedState.wasReferrerTracked)
|
|
175
|
-
return;
|
|
176
|
-
analyticsSharedState.wasReferrerTracked = true;
|
|
177
|
-
const referrer = document === null || document === void 0 ? void 0 : document.referrer;
|
|
178
|
-
if (!referrer)
|
|
179
|
-
return;
|
|
180
|
-
track({ eventName: ANALYTICS_REFERRER_EVENT_NAME, properties: { referrer } });
|
|
181
|
-
}
|
|
182
169
|
function getEventIntrinsicData() {
|
|
183
170
|
return {
|
|
184
171
|
timestamp: new Date().toISOString(),
|
|
File without changes
|