@adobe/spacecat-shared-rum-api-client 2.27.2 → 2.28.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 +14 -0
- package/package.json +2 -2
- package/src/functions/form-vitals.js +25 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.28.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.28.0...@adobe/spacecat-shared-rum-api-client-v2.28.1) (2025-05-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#779](https://github.com/adobe/spacecat-shared/issues/779)) ([07f8cce](https://github.com/adobe/spacecat-shared/commit/07f8cce73e33bfb9c61fe14f2ef28012b872437d))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.28.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.27.2...@adobe/spacecat-shared-rum-api-client-v2.28.0) (2025-05-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* filter pages under experiment ([#772](https://github.com/adobe/spacecat-shared/issues/772)) ([af63666](https://github.com/adobe/spacecat-shared/commit/af636667a38602a848624567ddcd37adba931597))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v2.27.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.27.1...@adobe/spacecat-shared-rum-api-client-v2.27.2) (2025-05-27)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-rum-api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Rum API client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"chai": "5.2.0",
|
|
48
48
|
"chai-as-promised": "8.0.1",
|
|
49
|
-
"nock": "14.0.
|
|
49
|
+
"nock": "14.0.5",
|
|
50
50
|
"sinon": "20.0.0",
|
|
51
51
|
"sinon-chai": "4.0.0",
|
|
52
52
|
"typescript": "5.8.3"
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { DataChunks } from '@adobe/rum-distiller';
|
|
13
|
+
import { DataChunks, facets } from '@adobe/rum-distiller';
|
|
14
14
|
import trafficAcquisition from './traffic-acquisition.js';
|
|
15
|
-
import {
|
|
15
|
+
import { DELIMITER, generateKey, loadBundles } from '../utils.js';
|
|
16
16
|
|
|
17
17
|
const METRICS = ['formview', 'formengagement', 'formsubmit'];
|
|
18
|
-
const CHECKPOINTS = ['viewblock', 'click', 'fill', 'formsubmit', 'navigate', 'viewmedia'];
|
|
18
|
+
const CHECKPOINTS = ['viewblock', 'click', 'fill', 'formsubmit', 'navigate', 'viewmedia', 'experiment'];
|
|
19
19
|
const KEYWORDS_TO_FILTER = ['search'];
|
|
20
20
|
|
|
21
21
|
function initializeResult(url) {
|
|
@@ -37,7 +37,7 @@ function filterEvents(bundles) {
|
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
if (event.checkpoint === 'navigate') {
|
|
40
|
+
if (event.checkpoint === 'navigate' || event.checkpoint === 'experiment') {
|
|
41
41
|
return true;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -81,6 +81,18 @@ function findByUrl(formVitals, url) {
|
|
|
81
81
|
return Object.values(formVitals).find((item) => item.url === url);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
function getAllURLWithExperiment(bundles) {
|
|
85
|
+
const dataChunks = new DataChunks();
|
|
86
|
+
loadBundles(bundles, dataChunks);
|
|
87
|
+
const { checkpoint } = facets;
|
|
88
|
+
dataChunks.addFacet('checkpoint', checkpoint);
|
|
89
|
+
return new Set(
|
|
90
|
+
dataChunks.facets.checkpoint
|
|
91
|
+
.filter((cp) => cp.value === 'experiment')
|
|
92
|
+
.flatMap((_checkpoint) => _checkpoint.entries.map((_entry) => _entry.url)),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
84
96
|
function populateFormsInternalNavigation(bundles, formVitals) {
|
|
85
97
|
const dataChunks = new DataChunks();
|
|
86
98
|
loadBundles(bundles, dataChunks);
|
|
@@ -139,6 +151,10 @@ function containsFormVitals(row) {
|
|
|
139
151
|
return METRICS.some((metric) => Object.keys(row[metric]).length > 0);
|
|
140
152
|
}
|
|
141
153
|
|
|
154
|
+
function isUnderExperiment(row, experimentUrls) {
|
|
155
|
+
return experimentUrls.has(row.url);
|
|
156
|
+
}
|
|
157
|
+
|
|
142
158
|
function getParentPageVitalsGroupedByIFrame(bundles, dataChunks, iframeParentMap) {
|
|
143
159
|
const iframeVitals = {};
|
|
144
160
|
if (dataChunks.facets.urlUserAgents) {
|
|
@@ -275,10 +291,14 @@ function handler(bundles) {
|
|
|
275
291
|
iframeParentMapWithoutDuplicates,
|
|
276
292
|
);
|
|
277
293
|
|
|
294
|
+
const experimentUrls = getAllURLWithExperiment(bundlesWithFilteredEvents);
|
|
295
|
+
|
|
278
296
|
// populate internal navigation data
|
|
279
297
|
populateFormsInternalNavigation(bundles, formVitals);
|
|
280
298
|
// filter out pages with no form vitals
|
|
281
|
-
const filteredFormVitals = Object.values(formVitals).filter(
|
|
299
|
+
const filteredFormVitals = Object.values(formVitals).filter(
|
|
300
|
+
(formVital) => containsFormVitals(formVital) && !isUnderExperiment(formVital, experimentUrls),
|
|
301
|
+
);
|
|
282
302
|
findFormCTAForInternalNavigation(bundles, filteredFormVitals);
|
|
283
303
|
|
|
284
304
|
const updatedFormVitals = filteredFormVitals.map((formVital) => {
|