@adobe/spacecat-shared-rum-api-client 2.16.0 → 2.16.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 +14 -0
- package/package.json +2 -2
- package/src/functions/total-metrics.js +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.16.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.16.1...@adobe/spacecat-shared-rum-api-client-v2.16.2) (2024-12-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update adobe fixes ([#501](https://github.com/adobe/spacecat-shared/issues/501)) ([7638fe7](https://github.com/adobe/spacecat-shared/commit/7638fe7d9433e1541fc2d41d0ef5bf1545abd281)), closes [#8203](https://github.com/adobe/spacecat-shared/issues/8203)
|
|
7
|
+
|
|
8
|
+
# [@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)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add totalClicks ([df9a688](https://github.com/adobe/spacecat-shared/commit/df9a688c8d12e10ceb84da2da8a409a74aeddeea))
|
|
14
|
+
|
|
1
15
|
# [@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
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.16.
|
|
3
|
+
"version": "2.16.2",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Rum API client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@adobe/helix-shared-wrap": "2.0.2",
|
|
40
40
|
"@adobe/helix-universal": "5.0.8",
|
|
41
41
|
"@adobe/spacecat-shared-utils": "1.22.4",
|
|
42
|
-
"@adobe/rum-distiller": "1.
|
|
42
|
+
"@adobe/rum-distiller": "1.14.0",
|
|
43
43
|
"aws4": "1.13.2",
|
|
44
44
|
"urijs": "^1.19.11"
|
|
45
45
|
},
|
|
@@ -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('
|
|
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?.
|
|
25
|
-
const weight = dataChunks?.totals?.
|
|
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
|
|