@adobe/spacecat-shared-rum-api-client 2.23.0 → 2.23.2

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,17 @@
1
+ # [@adobe/spacecat-shared-rum-api-client-v2.23.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.23.1...@adobe/spacecat-shared-rum-api-client-v2.23.2) (2025-04-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * changing user agent categorization for forms ([#705](https://github.com/adobe/spacecat-shared/issues/705)) ([239a186](https://github.com/adobe/spacecat-shared/commit/239a18657607ba9fcc041c9b90342d173cc5b81c))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v2.23.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.23.0...@adobe/spacecat-shared-rum-api-client-v2.23.1) (2025-04-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * eliminating unnecessary data from forms vitals ([#704](https://github.com/adobe/spacecat-shared/issues/704)) ([29be01e](https://github.com/adobe/spacecat-shared/commit/29be01e5d77d41b728a013a4b5532d06a08f7b2c))
14
+
1
15
  # [@adobe/spacecat-shared-rum-api-client-v2.23.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.22.6...@adobe/spacecat-shared-rum-api-client-v2.23.0) (2025-04-16)
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.23.0",
3
+ "version": "2.23.2",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -11,7 +11,6 @@
11
11
  */
12
12
 
13
13
  import { DataChunks } from '@adobe/rum-distiller';
14
- import trafficAcquisition from './traffic-acquisition.js';
15
14
  import { generateKey, DELIMITER, loadBundles } from '../utils.js';
16
15
 
17
16
  const METRICS = ['formview', 'formengagement', 'formsubmit'];
@@ -155,11 +154,11 @@ function handler(bundles) {
155
154
  }
156
155
  });
157
156
  });
158
- // traffic acquisition data per url
159
- const trafficByUrl = trafficAcquisition.handler(bundles);
160
- const trafficByUrlMap = Object.fromEntries(
161
- trafficByUrl.map(({ url, ...item }) => [url, item]),
162
- );
157
+ // traffic acquisition data per url - uncomment this when required
158
+ // const trafficByUrl = trafficAcquisition.handler(bundles);
159
+ // const trafficByUrlMap = Object.fromEntries(
160
+ // trafficByUrl.map(({ url, ...item }) => [url, item]),
161
+ // );
163
162
  const formVitals = {};
164
163
 
165
164
  globalFormSourceSet.forEach((source) => {
@@ -167,7 +166,12 @@ function handler(bundles) {
167
166
  const match = source.match(/form[#.](\w+)/);
168
167
  const formsource = match ? match[1] : 'unknown';
169
168
  // groups by url and user agent
170
- dataChunks.addFacet('urlUserAgents', (bundle) => generateKey(bundle.url, bundle.userAgent));
169
+ dataChunks.addFacet('urlUserAgents', (bundle) => {
170
+ // eslint-disable-next-line no-nested-ternary
171
+ const deviceType = bundle.userAgent.startsWith('desktop') ? 'desktop' : bundle.userAgent.startsWith('mobile') ? 'mobile' : 'other';
172
+ return generateKey(bundle.url, deviceType);
173
+ });
174
+
171
175
  METRICS.forEach((metric) => dataChunks.addSeries(metric, metricFns[metric](formsource)));
172
176
  // aggregates metrics per group (url and user agent)
173
177
  dataChunks.facets.urlUserAgents.reduce((acc, { value, metrics, weight }) => {
@@ -175,7 +179,8 @@ function handler(bundles) {
175
179
  const key = formSourceMap[url].has(source) ? generateKey(url, source) : url;
176
180
  acc[key] = acc[key] || initializeResult(url);
177
181
  acc[key].pageview[userAgent] = acc[key].pageview[userAgent] || weight;
178
- acc[key].trafficacquisition = trafficByUrlMap[url];
182
+ // Enable traffic acquisition for persistence by uncommenting this line
183
+ // acc[key].trafficacquisition = trafficByUrlMap[url];
179
184
  acc[key].formsource = source;
180
185
  METRICS.filter((metric) => metrics[metric].sum) // filter out user-agents with no form vitals
181
186
  .forEach((metric) => {