@adobe/helix-rum-enhancer 2.3.1 → 2.4.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 +16 -0
- package/package.json +3 -3
- package/src/index.js +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [2.4.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.4.0...v2.4.1) (2024-04-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* broken code in the utm tracking ([d1695dd](https://github.com/adobe/helix-rum-enhancer/commit/d1695ddf62b316d3cc06c75c444f859a271cff2e))
|
|
7
|
+
|
|
8
|
+
# [2.4.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.3.1...v2.4.0) (2024-03-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* track UTM query parameters ([2c237e5](https://github.com/adobe/helix-rum-enhancer/commit/2c237e5361ea2f166a0c37b1b752feda30ae9293)), closes [#137](https://github.com/adobe/helix-rum-enhancer/issues/137)
|
|
14
|
+
* track UTM query parameters ([ed58621](https://github.com/adobe/helix-rum-enhancer/commit/ed586215611c492adb29e5a98cadca3bd140d429))
|
|
15
|
+
* track UTM query parameters ([d1a6552](https://github.com/adobe/helix-rum-enhancer/commit/d1a6552a9b661867c0bfde06bcd066b4a1ed9024))
|
|
16
|
+
|
|
1
17
|
## [2.3.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.3.0...v2.3.1) (2024-03-11)
|
|
2
18
|
|
|
3
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@adobe/eslint-config-helix": "2.0.6",
|
|
33
33
|
"@semantic-release/changelog": "6.0.3",
|
|
34
34
|
"@semantic-release/git": "10.0.1",
|
|
35
|
-
"@semantic-release/npm": "
|
|
35
|
+
"@semantic-release/npm": "12.0.0",
|
|
36
36
|
"c8": "9.1.0",
|
|
37
37
|
"codecov": "3.8.3",
|
|
38
38
|
"eslint": "8.57.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"jsdoc-to-markdown": "8.0.1",
|
|
43
43
|
"junit-report-builder": "3.2.1",
|
|
44
44
|
"lint-staged": "15.2.2",
|
|
45
|
-
"mocha": "10.
|
|
45
|
+
"mocha": "10.4.0",
|
|
46
46
|
"mocha-multi-reporters": "1.5.1",
|
|
47
47
|
"semantic-release": "22.0.12"
|
|
48
48
|
},
|
package/src/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/* eslint-env browser */
|
|
13
13
|
const KNOWN_PROPERTIES = ['weight', 'id', 'referer', 'checkpoint', 't', 'source', 'target', 'cwv', 'CLS', 'FID', 'LCP', 'INP', 'TTFB'];
|
|
14
|
-
const DEFAULT_TRACKING_EVENTS = ['click', 'cwv', 'form', 'enterleave', 'viewblock', 'viewmedia', 'loadresource'];
|
|
14
|
+
const DEFAULT_TRACKING_EVENTS = ['click', 'cwv', 'form', 'enterleave', 'viewblock', 'viewmedia', 'loadresource', 'utm'];
|
|
15
15
|
const SESSION_STORAGE_KEY = 'aem-rum';
|
|
16
16
|
const { sampleRUM, queue, isSelected } = window.hlx.rum;
|
|
17
17
|
|
|
@@ -224,6 +224,14 @@ function addViewMediaTracking(parent) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
function addUTMParametersTracking() {
|
|
228
|
+
const usp = new URLSearchParams(window.location.search);
|
|
229
|
+
[...usp.entries()]
|
|
230
|
+
.filter(([key]) => key.startsWith('utm_'))
|
|
231
|
+
.filter(([key]) => key !== 'utm_id')
|
|
232
|
+
.forEach(([source, target]) => sampleRUM('utm', { source, target }));
|
|
233
|
+
}
|
|
234
|
+
|
|
227
235
|
function addFormTracking(parent) {
|
|
228
236
|
activateBlocksMutationObserver();
|
|
229
237
|
parent.querySelectorAll('form').forEach((form) => {
|
|
@@ -254,6 +262,7 @@ function addTrackingFromConfig() {
|
|
|
254
262
|
form: () => addFormTracking(window.document.body),
|
|
255
263
|
enterleave: () => addEnterLeaveTracking(),
|
|
256
264
|
loadresource: () => addLoadResourceTracking(),
|
|
265
|
+
utm: () => addUTMParametersTracking(),
|
|
257
266
|
viewblock: () => addViewBlockTracking(window.document.body),
|
|
258
267
|
viewmedia: () => addViewMediaTracking(window.document.body),
|
|
259
268
|
};
|