@reservamos/browser-analytics 1.0.22-alpha.0 → 1.1.1
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/CHANGELOG.md +5 -1
- package/dist/browser-analytics.cjs +1 -1
- package/dist/browser-analytics.cjs.map +1 -1
- package/dist/browser-analytics.esm.js +5 -1
- package/dist/browser-analytics.esm.js.map +1 -1
- package/dist/browser-analytics.iife.js +1 -1
- package/dist/browser-analytics.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/services/mixpanel.ts +8 -0
package/package.json
CHANGED
package/src/services/mixpanel.ts
CHANGED
|
@@ -9,6 +9,13 @@ declare global {
|
|
|
9
9
|
|
|
10
10
|
const MIXPANEL_DISTINCT_ID_CACHE_KEY = 'mp_distinct_id';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Super property sent on every Mixpanel event. Fixed SDK marker; not configurable via the public API.
|
|
14
|
+
*/
|
|
15
|
+
const EVENT_SOURCE_SUPER_PROPERTY = {
|
|
16
|
+
'Event Source': 'sdk',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Initializes Mixpanel with the provided token and debug flag.
|
|
14
21
|
* @param {string} mixpanelToken - The Mixpanel token used for authenticating API requests.
|
|
@@ -26,6 +33,7 @@ function init(
|
|
|
26
33
|
debug,
|
|
27
34
|
loaded: () => {
|
|
28
35
|
window.mixpanel = mixpanel;
|
|
36
|
+
mixpanel.register({ ...EVENT_SOURCE_SUPER_PROPERTY });
|
|
29
37
|
resolve();
|
|
30
38
|
},
|
|
31
39
|
...(proxyUrl && { api_host: proxyUrl }),
|