user-analytics-tracker 2.0.0 → 2.2.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 +38 -0
- package/README.md +11 -2
- package/dist/index.cjs.js +399 -195
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.cts +76 -15
- package/dist/index.d.ts +76 -15
- package/dist/index.esm.js +398 -196
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
# [2.2.0](https://github.com/switch-org/analytics-tracker/compare/v2.1.0...v2.2.0) (2025-12-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* ip-location, connection update with ipwho-is api ([fa1b369](https://github.com/switch-org/analytics-tracker/commit/fa1b36997ecad6f71c758f738c768090529bb2b0))
|
|
7
|
+
|
|
8
|
+
# [2.1.0](https://github.com/switch-org/analytics-tracker/compare/v2.0.0...v2.1.0) (2025-12-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* migrate IP geolocation to ipwho.is API with dynamic key storage ([0605f72](https://github.com/switch-org/analytics-tracker/commit/0605f7207baa590b776a3b52cbc055e98a8a22e4))
|
|
14
|
+
|
|
15
|
+
# [2.1.0](https://github.com/switch-org/analytics-tracker/compare/v2.0.0...v2.1.0) (TBD)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **IP Geolocation API Migration**: Migrated from ip-api.com to ipwho.is API for IP-based location tracking
|
|
20
|
+
- More comprehensive location data including continent, flag, connection details, and timezone information
|
|
21
|
+
- Dynamic key storage: All API response keys are automatically stored, including nested objects
|
|
22
|
+
- Future-proof: New fields added by the API are automatically captured without code changes
|
|
23
|
+
- No API key required: Free tier with no authentication needed
|
|
24
|
+
* **Enhanced IP Location Data**: The `IPLocation` interface now includes all fields from the ipwho.is API response
|
|
25
|
+
- New fields: `continent`, `continent_code`, `flag`, `connection`, `timezone` (with full details), `is_eu`, `postal`, `calling_code`, `capital`, `borders`
|
|
26
|
+
- Full backward compatibility: All existing fields (`lat`, `lon`, `countryCode`, etc.) remain available
|
|
27
|
+
- Access to full IP location data in analytics events via `ipLocationData` field
|
|
28
|
+
|
|
29
|
+
### Improvements
|
|
30
|
+
|
|
31
|
+
* Better IP location data coverage with additional metadata
|
|
32
|
+
* Automatic storage of all API response keys, including future additions
|
|
33
|
+
* Improved type definitions for IP location data
|
|
34
|
+
|
|
35
|
+
### Migration Notes
|
|
36
|
+
|
|
37
|
+
This upgrade is **fully backward compatible**. No code changes are required. See the [Upgrade Guide](./docs/upgrade-guide.md) for details on accessing new fields.
|
|
38
|
+
|
|
1
39
|
# [2.0.0](https://github.com/switch-org/analytics-tracker/compare/v1.7.0...v2.0.0) (2025-12-01)
|
|
2
40
|
|
|
3
41
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ A comprehensive, lightweight analytics tracking library for React applications.
|
|
|
15
15
|
- 📍 **Location Tracking**:
|
|
16
16
|
- **IP-based location** - Requires user consent (privacy-compliant)
|
|
17
17
|
- **GPS location** - Requires explicit user consent and browser permission
|
|
18
|
-
- Includes public IP address, country, city, region, timezone
|
|
18
|
+
- Includes public IP address, country, city, region, timezone, continent, flag, connection details
|
|
19
|
+
- Dynamic key storage: All IP location API fields are automatically captured
|
|
19
20
|
- Automatic fallback from GPS to IP when GPS unavailable
|
|
20
21
|
- Consent management utilities included
|
|
21
22
|
- 🎯 **Attribution Tracking**: UTM parameters, referrer tracking, first/last touch attribution
|
|
@@ -855,6 +856,14 @@ export async function POST(req: NextRequest) {
|
|
|
855
856
|
|
|
856
857
|
Comprehensive documentation is available in the [`docs/`](./docs) directory:
|
|
857
858
|
|
|
859
|
+
- **[Upgrade Guide](./docs/upgrade-guide.md)** - Step-by-step migration instructions for upgrading between versions
|
|
860
|
+
|
|
861
|
+
- **[Upgrade Guide](./docs/upgrade-guide.md)** - Step-by-step migration instructions for upgrading between versions
|
|
862
|
+
- Breaking changes and compatibility notes
|
|
863
|
+
- New features and improvements
|
|
864
|
+
- Migration examples
|
|
865
|
+
- Troubleshooting upgrade issues
|
|
866
|
+
|
|
858
867
|
- **[Usage Guide](./docs/usage-guide.md)** - Complete guide on how to use the package in your applications
|
|
859
868
|
- Installation instructions
|
|
860
869
|
- Basic and advanced usage examples
|
|
@@ -964,7 +973,7 @@ MIT © [Switch Org](https://github.com/switch-org)
|
|
|
964
973
|
|
|
965
974
|
## 🙏 Acknowledgments
|
|
966
975
|
|
|
967
|
-
- Uses [
|
|
976
|
+
- Uses [ipwho.is](https://ipwho.is/) for free IP geolocation
|
|
968
977
|
- Built with modern web APIs (User-Agent Client Hints, Network Information API, Geolocation API)
|
|
969
978
|
|
|
970
979
|
<!-- ## 📞 Support
|