@adobe/spacecat-shared-utils 1.36.1 → 1.36.3
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 +4 -4
- package/src/formcalc.js +5 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.36.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.36.2...@adobe/spacecat-shared-utils-v1.36.3) (2025-04-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#708](https://github.com/adobe/spacecat-shared/issues/708)) ([57535ac](https://github.com/adobe/spacecat-shared/commit/57535ac8c636de229cec7c5cee83dead07ac09fb))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-utils-v1.36.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.36.1...@adobe/spacecat-shared-utils-v1.36.2) (2025-04-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#679](https://github.com/adobe/spacecat-shared/issues/679)) ([a41bf0c](https://github.com/adobe/spacecat-shared/commit/a41bf0cd488efa0f72af0933992edb256302af18))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-utils-v1.36.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.36.0...@adobe/spacecat-shared-utils-v1.36.1) (2025-04-10)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.3",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"chai": "5.2.0",
|
|
40
40
|
"chai-as-promised": "8.0.1",
|
|
41
41
|
"husky": "9.1.7",
|
|
42
|
-
"nock": "14.0.
|
|
42
|
+
"nock": "14.0.4",
|
|
43
43
|
"sinon": "20.0.0",
|
|
44
44
|
"sinon-chai": "4.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@adobe/fetch": "4.2.0",
|
|
48
|
-
"@aws-sdk/client-s3": "3.
|
|
49
|
-
"@aws-sdk/client-sqs": "3.
|
|
48
|
+
"@aws-sdk/client-s3": "3.797.0",
|
|
49
|
+
"@aws-sdk/client-sqs": "3.797.0",
|
|
50
50
|
"@json2csv/plainjs": "7.0.6",
|
|
51
51
|
"aws-xray-sdk": "3.10.3",
|
|
52
52
|
"uuid": "11.1.0"
|
package/src/formcalc.js
CHANGED
|
@@ -28,6 +28,7 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
|
|
|
28
28
|
formVitalsCollection.forEach((item) => {
|
|
29
29
|
const {
|
|
30
30
|
url, formview = {}, formengagement = {}, pageview = {}, formsubmit = {},
|
|
31
|
+
trafficacquisition = {},
|
|
31
32
|
} = item;
|
|
32
33
|
|
|
33
34
|
const totals = {
|
|
@@ -54,7 +55,7 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
|
|
|
54
55
|
totals.formengagement = calculateSums(formengagement, totals.formengagement);
|
|
55
56
|
totals.pageview = calculateSums(pageview, totals.pageview);
|
|
56
57
|
totals.formsubmit = calculateSums(formsubmit, totals.formsubmit);
|
|
57
|
-
|
|
58
|
+
totals.trafficacquisition = trafficacquisition;
|
|
58
59
|
resultMap.set(url, totals);
|
|
59
60
|
});
|
|
60
61
|
|
|
@@ -90,18 +91,13 @@ export function getHighFormViewsLowConversionMetrics(formVitalsCollection) {
|
|
|
90
91
|
const urls = [];
|
|
91
92
|
resultMap.forEach((metrics, url) => {
|
|
92
93
|
const pageViews = metrics.pageview.total;
|
|
93
|
-
|
|
94
|
-
const formViews = metrics.formview.total || pageViews;
|
|
95
|
-
const formEngagement = metrics.formengagement.total;
|
|
94
|
+
const formViews = metrics.formview.total;
|
|
96
95
|
const formSubmit = metrics.formsubmit.total;
|
|
97
96
|
|
|
98
97
|
if (hasHighPageViews(pageViews) && hasLowerConversionRate(formSubmit, formViews)) {
|
|
99
98
|
urls.push({
|
|
100
99
|
url,
|
|
101
|
-
|
|
102
|
-
formViews,
|
|
103
|
-
formEngagement,
|
|
104
|
-
formSubmit,
|
|
100
|
+
...metrics,
|
|
105
101
|
});
|
|
106
102
|
}
|
|
107
103
|
});
|
|
@@ -182,9 +178,7 @@ export function getHighPageViewsLowFormCtrMetrics(formVitalsCollection) {
|
|
|
182
178
|
if (deviceData != null) {
|
|
183
179
|
urls.push({
|
|
184
180
|
url: entry.url,
|
|
185
|
-
|
|
186
|
-
formViews: deviceData.formview.total,
|
|
187
|
-
formEngagement: deviceData.formengagement.total,
|
|
181
|
+
...deviceData,
|
|
188
182
|
CTA: {
|
|
189
183
|
url: maxPageviewUrl.url,
|
|
190
184
|
source: y.source,
|