@codecademy/tracking 0.17.1-alpha.76698b.0 → 0.18.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 +11 -2
- package/dist/events/__tests__/track.test.js +13 -0
- package/dist/events/types.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [0.18.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.17.1...@codecademy/tracking@0.18.0) (2021-12-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **Tracking:** add search id param to userclick data ([7150c44](https://github.com/Codecademy/client-modules/commit/7150c44d665624502cfd95ac0020130b5ab8c26a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [0.17.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.17.0...@codecademy/tracking@0.17.1) (2021-12-17)
|
|
7
16
|
|
|
8
17
|
|
|
9
18
|
### Bug Fixes
|
|
10
19
|
|
|
11
|
-
* **tracking:**
|
|
20
|
+
* **tracking:** remove navigator.sendBeacon .bind and add try/catch ([b924d7e](https://github.com/Codecademy/client-modules/commit/b924d7e1ffd22d75adcaf15c9726d10f19b2924e))
|
|
12
21
|
|
|
13
22
|
|
|
14
23
|
|
|
@@ -114,6 +114,19 @@ describe('createTracker', function () {
|
|
|
114
114
|
method: 'POST'
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
|
+
it('calls to fetch when beacon throws an error', function () {
|
|
118
|
+
Object.defineProperty(navigator, 'sendBeacon', {
|
|
119
|
+
writable: true,
|
|
120
|
+
value: function value() {
|
|
121
|
+
throw new Error('Oh no!');
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
tracker[event](expectedProps);
|
|
125
|
+
expect(fetch).toHaveBeenCalledWith('https://www.codecademy.com/analytics/user?utm_source=twitter', {
|
|
126
|
+
body: expect.any(FormData),
|
|
127
|
+
method: 'POST'
|
|
128
|
+
});
|
|
129
|
+
});
|
|
117
130
|
});
|
|
118
131
|
};
|
|
119
132
|
|
package/dist/events/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/tracking",
|
|
3
3
|
"description": "Tracking library for Codecademy apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "385adaca6433410aa8d68085fde952e98ea6798a"
|
|
40
40
|
}
|