@adobe/spacecat-shared-rum-api-client 2.16.0 → 2.16.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-rum-api-client-v2.16.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.16.0...@adobe/spacecat-shared-rum-api-client-v2.16.1) (2024-12-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add totalClicks ([df9a688](https://github.com/adobe/spacecat-shared/commit/df9a688c8d12e10ceb84da2da8a409a74aeddeea))
7
+
1
8
  # [@adobe/spacecat-shared-rum-api-client-v2.16.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.15.7...@adobe/spacecat-shared-rum-api-client-v2.16.0) (2024-12-20)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-rum-api-client",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -17,16 +17,17 @@ function handler(bundles) {
17
17
  const dataChunks = new DataChunks();
18
18
  loadBundles(bundles, dataChunks);
19
19
  dataChunks.addSeries('traffic_domain', series.pageViews);
20
- dataChunks.addSeries('ctr', (bundle) => (bundle.events.some((e) => e.checkpoint === 'click')
20
+ dataChunks.addSeries('clicks', (bundle) => (bundle.events.some((e) => e.checkpoint === 'click')
21
21
  ? bundle.weight
22
22
  : 0));
23
23
  const totalPageViews = dataChunks?.totals?.traffic_domain?.weight;
24
- const sum = dataChunks?.totals?.ctr?.sum ?? 0;
25
- const weight = dataChunks?.totals?.ctr?.weight ?? 0;
24
+ const sum = dataChunks?.totals?.clicks?.sum ?? 0;
25
+ const weight = dataChunks?.totals?.clicks?.weight ?? 0;
26
26
  const totalCTR = weight !== 0 ? sum / weight : 0;
27
27
  return {
28
28
  totalPageViews,
29
29
  totalCTR,
30
+ totalClicks: sum,
30
31
  };
31
32
  }
32
33