user-analytics-tracker 2.1.0 → 3.0.0
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 +45 -0
- package/README.md +15 -0
- package/dist/index.cjs.js +552 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.cts +95 -4
- package/dist/index.d.ts +95 -4
- package/dist/index.esm.js +545 -31
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
# [3.0.0](https://github.com/switch-org/analytics-tracker/compare/v2.2.0...v3.0.0) (2025-12-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* optimize essential mode with deduplication and reduced deviceInfo fields ([b64eefa](https://github.com/switch-org/analytics-tracker/commit/b64eefa4992e0570b1011fa029d0db8de89c321b))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* Essential mode deviceInfo now stores only 8 fields instead of 15
|
|
12
|
+
|
|
13
|
+
## Changes
|
|
14
|
+
|
|
15
|
+
### Core Optimizations
|
|
16
|
+
- Reduce deviceInfo essential fields from 15 to 8
|
|
17
|
+
- Implement automatic deduplication between location and customData.ipLocation
|
|
18
|
+
- Remove duplicate fields from location object
|
|
19
|
+
- Add null/undefined value removal from filtered objects
|
|
20
|
+
- Improve nested object handling
|
|
21
|
+
|
|
22
|
+
### Field Storage Improvements
|
|
23
|
+
- Add generic field storage transformer for all data types
|
|
24
|
+
- Support essential/all/custom modes for all data types
|
|
25
|
+
- Implement recursive null value cleaning
|
|
26
|
+
- Add mode-aware deduplication logic
|
|
27
|
+
|
|
28
|
+
### Documentation
|
|
29
|
+
- Merge and consolidate essential mode documentation
|
|
30
|
+
- Add comprehensive essential-mode-guide.md
|
|
31
|
+
- Update documentation index
|
|
32
|
+
- Add example payload JSON
|
|
33
|
+
|
|
34
|
+
## Impact
|
|
35
|
+
- Significantly smaller payloads (~30-40% reduction)
|
|
36
|
+
- No duplicate data storage
|
|
37
|
+
- All crucial information preserved
|
|
38
|
+
|
|
39
|
+
# [2.2.0](https://github.com/switch-org/analytics-tracker/compare/v2.1.0...v2.2.0) (2025-12-30)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* ip-location, connection update with ipwho-is api ([fa1b369](https://github.com/switch-org/analytics-tracker/commit/fa1b36997ecad6f71c758f738c768090529bb2b0))
|
|
45
|
+
|
|
1
46
|
# [2.1.0](https://github.com/switch-org/analytics-tracker/compare/v2.0.0...v2.1.0) (2025-12-29)
|
|
2
47
|
|
|
3
48
|
|
package/README.md
CHANGED
|
@@ -93,6 +93,21 @@ const analytics = useAnalytics({
|
|
|
93
93
|
|
|
94
94
|
// Metrics configuration
|
|
95
95
|
enableMetrics: false, // Enable metrics collection (default: false)
|
|
96
|
+
|
|
97
|
+
// Field storage configuration (optional) - control which fields are stored
|
|
98
|
+
fieldStorage: {
|
|
99
|
+
ipLocation: { mode: 'essential' }, // IP location fields
|
|
100
|
+
deviceInfo: { mode: 'essential' }, // Device info fields
|
|
101
|
+
networkInfo: { mode: 'essential' }, // Network info fields
|
|
102
|
+
location: { mode: 'essential' }, // Location fields
|
|
103
|
+
attribution: { mode: 'essential' }, // Attribution fields
|
|
104
|
+
// Each can be: 'essential' (default) | 'all' | 'custom'
|
|
105
|
+
// For 'custom': specify fields array
|
|
106
|
+
// For 'all': specify exclude array
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
// Legacy: IP Location storage (backward compatible)
|
|
110
|
+
ipLocationFields: { mode: 'essential' },
|
|
96
111
|
},
|
|
97
112
|
});
|
|
98
113
|
```
|