@adobe/spacecat-shared-rum-api-client 2.13.2 → 2.14.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 +7 -0
- package/package.json +1 -1
- package/src/functions/form-vitals.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.14.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.13.2...@adobe/spacecat-shared-rum-api-client-v2.14.0) (2024-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* introduce form button clicks in form vitals ([#468](https://github.com/adobe/spacecat-shared/issues/468)) ([3907092](https://github.com/adobe/spacecat-shared/commit/39070920a9472f063e6ee11c867ed047107f001d))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-rum-api-client-v2.13.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.13.1...@adobe/spacecat-shared-rum-api-client-v2.13.2) (2024-12-02)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ import { DataChunks } from '@adobe/rum-distiller';
|
|
|
14
14
|
import { generateKey, DELIMITER, loadBundles } from '../utils.js';
|
|
15
15
|
|
|
16
16
|
const FORM_SOURCE = ['.form', '.marketo', '.marketo-form'];
|
|
17
|
-
const METRICS = ['formview', 'formengagement', 'formsubmit'];
|
|
17
|
+
const METRICS = ['formview', 'formengagement', 'formsubmit', 'formbuttonclick'];
|
|
18
18
|
|
|
19
19
|
function initializeResult(url) {
|
|
20
20
|
return {
|
|
@@ -22,6 +22,7 @@ function initializeResult(url) {
|
|
|
22
22
|
formsubmit: {},
|
|
23
23
|
formview: {},
|
|
24
24
|
formengagement: {},
|
|
25
|
+
formbuttonclick: {},
|
|
25
26
|
pageview: {},
|
|
26
27
|
};
|
|
27
28
|
}
|
|
@@ -39,6 +40,12 @@ const metricFns = {
|
|
|
39
40
|
const formSubmit = bundle.events.find((e) => e.checkpoint === 'formsubmit');
|
|
40
41
|
return formSubmit ? bundle.weight : 0;
|
|
41
42
|
},
|
|
43
|
+
formbuttonclick: (bundle) => {
|
|
44
|
+
const formButtonClick = bundle.events.find((e) => e.checkpoint === 'click' && e.source
|
|
45
|
+
&& /\bform\b/.test(e.source.toLowerCase())
|
|
46
|
+
&& /\bbutton\b/.test(e.source.toLowerCase()));
|
|
47
|
+
return formButtonClick ? bundle.weight : 0;
|
|
48
|
+
},
|
|
42
49
|
};
|
|
43
50
|
|
|
44
51
|
function containsFormVitals(row) {
|