@adobe/spacecat-shared-rum-api-client 2.25.2 → 2.27.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 CHANGED
@@ -1,3 +1,22 @@
1
+ # [@adobe/spacecat-shared-rum-api-client-v2.27.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.26.0...@adobe/spacecat-shared-rum-api-client-v2.27.0) (2025-05-26)
2
+
3
+
4
+ ### Features
5
+
6
+ * including traffic acquisition data in forms oppoty ([#754](https://github.com/adobe/spacecat-shared/issues/754)) ([616ebd3](https://github.com/adobe/spacecat-shared/commit/616ebd3b0302d67693db8bce7b55224ff7915778))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v2.26.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.25.2...@adobe/spacecat-shared-rum-api-client-v2.26.0) (2025-05-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * filter Forms that submit to an endpoint containing the term search ([#748](https://github.com/adobe/spacecat-shared/issues/748)) ([aa2d74b](https://github.com/adobe/spacecat-shared/commit/aa2d74b1ae7895101b90ff2b91acff5ed351f60d))
14
+
15
+
16
+ ### Features
17
+
18
+ * add cookie auth handler ([#749](https://github.com/adobe/spacecat-shared/issues/749)) ([362184b](https://github.com/adobe/spacecat-shared/commit/362184b1339ccdaa25328228c906917721d86bd1))
19
+
1
20
  # [@adobe/spacecat-shared-rum-api-client-v2.25.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.25.1...@adobe/spacecat-shared-rum-api-client-v2.25.2) (2025-05-19)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-rum-api-client",
3
- "version": "2.25.2",
3
+ "version": "2.27.0",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -11,6 +11,7 @@
11
11
  */
12
12
 
13
13
  import { DataChunks } from '@adobe/rum-distiller';
14
+ import trafficAcquisition from './traffic-acquisition.js';
14
15
  import { generateKey, DELIMITER, loadBundles } from '../utils.js';
15
16
 
16
17
  const METRICS = ['formview', 'formengagement', 'formsubmit'];
@@ -41,9 +42,13 @@ function filterEvents(bundles) {
41
42
  }
42
43
 
43
44
  const isFormRelatedEvent = ['fill', 'formsubmit'].includes(event.checkpoint)
44
- || /\bform\b|aemform\w*/i.test(event.source);
45
- return isFormRelatedEvent && !KEYWORDS_TO_FILTER.some((keyword) => event.source
46
- && event.source.toLowerCase().includes(keyword));
45
+ || /\bform\b|aemform\w*/i.test(event.source);
46
+
47
+ return isFormRelatedEvent
48
+ && !KEYWORDS_TO_FILTER.some(
49
+ (keyword) => (event.source && event.source.toLowerCase().includes(keyword))
50
+ || (event.target && event.target.toLowerCase().includes(keyword)),
51
+ );
47
52
  }),
48
53
  }));
49
54
  }
@@ -226,10 +231,10 @@ function handler(bundles) {
226
231
  );
227
232
 
228
233
  // traffic acquisition data per url - uncomment this when required
229
- // const trafficByUrl = trafficAcquisition.handler(bundles);
230
- // const trafficByUrlMap = Object.fromEntries(
231
- // trafficByUrl.map(({ url, ...item }) => [url, item]),
232
- // );
234
+ const trafficByUrl = trafficAcquisition.handler(bundles);
235
+ const trafficByUrlMap = Object.fromEntries(
236
+ trafficByUrl.map(({ url, ...item }) => [url, item]),
237
+ );
233
238
  const formVitals = {};
234
239
 
235
240
  globalFormSourceSet.forEach((source) => {
@@ -252,7 +257,7 @@ function handler(bundles) {
252
257
  acc[key] = acc[key] || initializeResult(url);
253
258
  acc[key].pageview[userAgent] = acc[key].pageview[userAgent] || weight;
254
259
  // Enable traffic acquisition for persistence by uncommenting this line
255
- // acc[key].trafficacquisition = trafficByUrlMap[url];
260
+ acc[key].trafficacquisition = trafficByUrlMap[url];
256
261
  acc[key].formsource = source;
257
262
  // filter out user-agents with no form vitals
258
263
  METRICS.filter((metric) => metrics[metric].sum)