@adobe/spacecat-shared-rum-api-client 2.36.3 → 2.36.5
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.36.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.36.4...@adobe/spacecat-shared-rum-api-client-v2.36.5) (2025-08-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* make max opportunities configurable ([#930](https://github.com/adobe/spacecat-shared/issues/930)) ([2b18c25](https://github.com/adobe/spacecat-shared/commit/2b18c25e8dc3303af0e1a09ebcbe830672368d13))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.36.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.36.3...@adobe/spacecat-shared-rum-api-client-v2.36.4) (2025-08-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **rum-api-client:** harden LLM-related classifications ([#916](https://github.com/adobe/spacecat-shared/issues/916)) ([63573d7](https://github.com/adobe/spacecat-shared/commit/63573d71af9e2452f3cf4377efcddd6e7e4267c0))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v2.36.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.36.2...@adobe/spacecat-shared-rum-api-client-v2.36.3) (2025-08-09)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -335,7 +335,13 @@ Calculates the amount of inorganic traffic and the bounce rate for each page. Id
|
|
|
335
335
|
|
|
336
336
|
### high-organic-low-ctr (Experimentation Opportunity)
|
|
337
337
|
|
|
338
|
-
Calculates the amount of non-inorganic (earned and owned) traffic and the click-through rate for each page and vendor. Identifies pages with high non-inorganic traffic and low click-through rates, which can be targeted for future experimentation opportunities.
|
|
338
|
+
Calculates the amount of non-inorganic (earned and owned) traffic and the click-through rate for each page and vendor. Identifies pages with high non-inorganic traffic and low click-through rates, which can be targeted for future experimentation opportunities.
|
|
339
|
+
|
|
340
|
+
#### options supported
|
|
341
|
+
- **maxOpportunities** - No. of maximum opportunities to return, defaults to 10
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
An example payload is provided below:
|
|
339
345
|
|
|
340
346
|
```json
|
|
341
347
|
[
|
package/package.json
CHANGED
package/src/common/traffic.js
CHANGED
|
@@ -41,7 +41,7 @@ const referrers = {
|
|
|
41
41
|
social: /^\b((www\.)?x)\b|(.*(facebook|tiktok|snapchat|twitter|pinterest|reddit|linkedin|threads|quora|discord|tumblr|mastodon|bluesky|instagram).*)$/,
|
|
42
42
|
ad: /googlesyndication|2mdn|doubleclick|syndicatedsearch/,
|
|
43
43
|
video: /youtube|vimeo|twitch|dailymotion|wistia/,
|
|
44
|
-
llm:
|
|
44
|
+
llm: /\b(chatgpt|openai)\b|perplexity|claude|gemini\.google|copilot\.microsoft/,
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const mediums = {
|
|
@@ -103,7 +103,7 @@ const vendorClassifications = [
|
|
|
103
103
|
{ regex: /amazon|ctv/i, result: 'amazon' },
|
|
104
104
|
{ regex: /dailymotion/i, result: 'dailymotion' },
|
|
105
105
|
{ regex: /twitch/i, result: 'twitch' },
|
|
106
|
-
{ regex:
|
|
106
|
+
{ regex: /\b(chatgpt|openai)\b/i, result: 'openai' },
|
|
107
107
|
{ regex: /perplexity/i, result: 'perplexity' },
|
|
108
108
|
{ regex: /claude/i, result: 'claude' },
|
|
109
109
|
{ regex: /direct/i, result: 'direct' },
|
|
@@ -14,7 +14,7 @@ import trafficAcquisition from '../traffic-acquisition.js';
|
|
|
14
14
|
import { getCTRByUrlAndVendor, getSiteAvgCTR } from '../../common/aggregateFns.js';
|
|
15
15
|
|
|
16
16
|
const VENDORS_TO_CONSIDER = 5;
|
|
17
|
-
const
|
|
17
|
+
const DEFAULT_MAX_OPPORTUNITIES = 10;
|
|
18
18
|
|
|
19
19
|
const MAIN_TYPES = ['paid', 'earned', 'owned'];
|
|
20
20
|
|
|
@@ -133,13 +133,13 @@ function sortPagesByEarnedAndOverallTraffic(pages) {
|
|
|
133
133
|
return percentiles.sort((a, b) => b.percentileScore - a.percentileScore);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
function handler(bundles) {
|
|
136
|
+
function handler(bundles, opts) {
|
|
137
137
|
const trafficByUrl = trafficAcquisition.handler(bundles);
|
|
138
138
|
const ctrByUrlAndVendor = getCTRByUrlAndVendor(bundles);
|
|
139
139
|
const siteAvgCTR = getSiteAvgCTR(bundles);
|
|
140
140
|
const pagesSortedByEarnedAndOverallTraffic = sortPagesByEarnedAndOverallTraffic(
|
|
141
141
|
trafficByUrl,
|
|
142
|
-
).slice(0,
|
|
142
|
+
).slice(0, opts?.maxOpportunities || DEFAULT_MAX_OPPORTUNITIES);
|
|
143
143
|
|
|
144
144
|
return pagesSortedByEarnedAndOverallTraffic.map((traffic) => ({
|
|
145
145
|
...traffic,
|