@adobe/spacecat-shared-rum-api-client 2.40.0 → 2.40.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.40.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.40.1...@adobe/spacecat-shared-rum-api-client-v2.40.2) (2025-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **rum-api-client:** traffic attibution for new llms ([#1229](https://github.com/adobe/spacecat-shared/issues/1229)) ([a6aac37](https://github.com/adobe/spacecat-shared/commit/a6aac37993e4c5e7527d4f1853a137f2ed9c2779))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v2.40.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.40.0...@adobe/spacecat-shared-rum-api-client-v2.40.1) (2025-12-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/rum-distiller to v1.21.0 ([#1217](https://github.com/adobe/spacecat-shared/issues/1217)) ([acf206f](https://github.com/adobe/spacecat-shared/commit/acf206fd35b41489a44b323aa7865ffe244ace0e))
14
+
1
15
  # [@adobe/spacecat-shared-rum-api-client-v2.40.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.39.1...@adobe/spacecat-shared-rum-api-client-v2.40.0) (2025-11-28)
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.40.0",
3
+ "version": "2.40.2",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -38,7 +38,7 @@
38
38
  "@adobe/fetch": "4.2.3",
39
39
  "@adobe/helix-shared-wrap": "2.0.2",
40
40
  "@adobe/helix-universal": "5.3.0",
41
- "@adobe/rum-distiller": "1.20.8",
41
+ "@adobe/rum-distiller": "1.21.0",
42
42
  "@adobe/spacecat-shared-utils": "1.81.1",
43
43
  "aws4": "1.13.2",
44
44
  "urijs": "1.19.11"
@@ -49,7 +49,7 @@ const referrers = {
49
49
  social: /^\b((www\.)?x)\b|(.*(facebook|tiktok|snapchat|twitter|pinterest|reddit|linkedin|threads|quora|discord|tumblr|mastodon|bluesky|instagram).*)$/,
50
50
  ad: /googlesyndication|2mdn|doubleclick|syndicatedsearch/,
51
51
  video: /youtube|vimeo|twitch|dailymotion|wistia/,
52
- llm: /\b(chatgpt|openai)\b|perplexity|claude|gemini\.google|copilot\.microsoft/,
52
+ llm: /\b(chatgpt|openai)\b|perplexity|claude|gemini\.google|copilot\.microsoft|m365\.cloud|(^|\.)?meta$|deepseek|(^|\.)?mistral$/,
53
53
  };
54
54
 
55
55
  const mediums = {
@@ -74,7 +74,7 @@ const sources = {
74
74
  display: /optumib2b|jun|googleads|dv360|dv36|microsoft|flipboard|programmatic|yext|gdn|banner|newsshowcase/,
75
75
  affiliate: /brandreward|yieldkit|fashionistatop|partner|linkbux|stylesblog|linkinbio|affiliate/,
76
76
  email: /sfmc|email/,
77
- llm: /chatgpt/,
77
+ llm: /chatgpt|openai|perplexity|claude|gemini|copilot|metaai|deepseek|mistral/,
78
78
  };
79
79
 
80
80
  /**
@@ -92,7 +92,7 @@ const vendorClassifications = [
92
92
  { regex: /linkedin|\b(ln)\b/i, result: 'linkedin' },
93
93
  { regex: /twitter|^\b(x)\b/i, result: 'x' },
94
94
  { regex: /snapchat/i, result: 'snapchat' },
95
- { regex: /microsoft|copilot/i, result: 'microsoft' },
95
+ { regex: /microsoft|copilot|m365\.cloud/i, result: 'microsoft' },
96
96
  { regex: /pinterest/i, result: 'pinterest' },
97
97
  { regex: /reddit/i, result: 'reddit' },
98
98
  { regex: /spotify/i, result: 'spotify' },
@@ -114,6 +114,9 @@ const vendorClassifications = [
114
114
  { regex: /\b(chatgpt|openai)\b/i, result: 'openai' },
115
115
  { regex: /perplexity/i, result: 'perplexity' },
116
116
  { regex: /claude/i, result: 'claude' },
117
+ { regex: /deepseek/i, result: 'deepseek' },
118
+ { regex: /mistral/i, result: 'mistral' },
119
+ { regex: /meta\.ai/i, result: 'meta' },
117
120
  { regex: /direct/i, result: 'direct' },
118
121
  ];
119
122
 
@@ -149,6 +152,10 @@ const notEmpty = (text) => hasText(text);
149
152
  // overrides
150
153
  const OVERRIDES = [
151
154
  { when: (ctx) => (ctx.utmSource || '').toLowerCase() === 'chatgpt.com', set: { type: 'earned', category: 'llm', vendor: 'openai' } },
155
+ // meta ai: when referrer is 'meta', set vendor to 'meta' (not 'facebook')
156
+ { when: (ctx) => ctx.type === 'earned' && ctx.category === 'llm' && /(^|\.)meta$/i.test(ctx.referrerDomain), set: { vendor: 'meta' } },
157
+ // meta ai: when utm_source is 'meta.ai', set vendor to 'meta' (not 'facebook')
158
+ { when: (ctx) => ctx.type === 'earned' && ctx.category === 'llm' && /^meta\.ai$/i.test(ctx.utmSource || ''), set: { vendor: 'meta' } },
152
159
  ];
153
160
 
154
161
  function applyOverrides(classification, context) {
@@ -159,7 +166,7 @@ function applyOverrides(classification, context) {
159
166
  // allowed known vendors per category
160
167
  const ALLOWED_VENDORS = {
161
168
  earned: {
162
- llm: ['openai', 'claude', 'perplexity', 'microsoft', 'google'],
169
+ llm: ['openai', 'claude', 'perplexity', 'microsoft', 'google', 'deepseek', 'mistral', 'meta'],
163
170
  search: ['google', 'bing', 'yahoo', 'yandex', 'baidu', 'duckduckgo', 'brave', 'ecosia', 'aol'],
164
171
  social: null, // any vendor allowed
165
172
  video: ['youtube', 'vimeo', 'twitch', 'tiktok', 'dailymotion'],
@@ -329,7 +336,7 @@ export function classifyTrafficSource(url, referrer, utmSource, utmMedium, track
329
336
  // apply overrides
330
337
  const overridden = applyOverrides(
331
338
  { type, category, vendor },
332
- { utmSource, utmMedium, referrerDomain },
339
+ { type, category, utmSource, utmMedium, referrerDomain },
333
340
  );
334
341
  type = overridden.type;
335
342
  category = overridden.category;