@blotoutio/providers-app-lovin-sdk 1.53.1 → 1.55.0
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/index.cjs.js +156 -1
- package/index.js +156 -1
- package/index.mjs +156 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -77,6 +77,40 @@ const logger = {
|
|
|
77
77
|
},
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Known ad-network click ID query parameters and the human-readable provider
|
|
82
|
+
* label each one maps to. Used by the CDN worker to resolve `inSessionTouch`
|
|
83
|
+
* and by the analytics API to classify paid-media touch sessions.
|
|
84
|
+
*
|
|
85
|
+
* Keep this list in sync with `defaultParams` in queryParams.ts when new
|
|
86
|
+
* click ID providers are added.
|
|
87
|
+
*/
|
|
88
|
+
const CLICK_IDS = [
|
|
89
|
+
{ param: 'fbclid', label: 'Facebook' }, // Facebook Ads
|
|
90
|
+
{ param: 'gclid', label: 'Google' }, // Google Ads (click)
|
|
91
|
+
{ param: 'gbraid', label: 'Google' }, // Google Ads (iOS app)
|
|
92
|
+
{ param: 'wbraid', label: 'Google' }, // Google Ads (iOS web)
|
|
93
|
+
{ param: 'msclkid', label: 'Bing' }, // Microsoft Bing Ads
|
|
94
|
+
{ param: 'ttclid', label: 'TikTok' }, // TikTok Ads
|
|
95
|
+
{ param: 'ScCid', label: 'Snapchat' }, // Snapchat Ads
|
|
96
|
+
{ param: 'epik', label: 'Pinterest' }, // Pinterest Ads
|
|
97
|
+
{ param: 'li_fat_id', label: 'LinkedIn' }, // LinkedIn Ads
|
|
98
|
+
{ param: 'twclid', label: 'Twitter' }, // X (Twitter) Ads
|
|
99
|
+
{ param: 'rdt_cid', label: 'Reddit' }, // Reddit Ads
|
|
100
|
+
{ param: 'aleid', label: 'AppLovin' }, // AppLovin
|
|
101
|
+
{ param: 'tabclid', label: 'Taboola' }, // Taboola
|
|
102
|
+
{ param: 'obclid', label: 'Outbrain' }, // Outbrain
|
|
103
|
+
{ param: 'trybe', label: 'Trybe' }, // Trybe
|
|
104
|
+
{ param: '_kx', label: 'Klaviyo' }, // Klaviyo email campaigns
|
|
105
|
+
{ param: 'mc_eid', label: 'Mailchimp' }, // Mailchimp email campaigns
|
|
106
|
+
{ param: 'ttd_id', label: 'The Trade Desk' }, // The Trade Desk programmatic
|
|
107
|
+
{ param: 'evsclid', label: 'EvoSearch' }, // EvoSearch
|
|
108
|
+
{ param: 'li_did', label: 'Live Intent' }, // LiveIntent device-level ad
|
|
109
|
+
{ param: '_raclid', label: 'Rumble' }, // Rumble Ads
|
|
110
|
+
{ param: 'ref_id', label: 'StackAdapt' }, // StackAdapt programmatic
|
|
111
|
+
{ param: 'duel_a', label: 'Duel' }, // Duel referral/advocacy
|
|
112
|
+
];
|
|
113
|
+
|
|
80
114
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
81
115
|
if (!entry.includes('-')) {
|
|
82
116
|
return entry;
|
|
@@ -464,6 +498,127 @@ const usStates = new Map([
|
|
|
464
498
|
]);
|
|
465
499
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
466
500
|
|
|
501
|
+
/**
|
|
502
|
+
* Exact utm_source normalization (lowercase key → canonical name).
|
|
503
|
+
*
|
|
504
|
+
* Use exact match when the key is short, generic, or must not accidentally
|
|
505
|
+
* absorb variant spellings (e.g. "impact" must not match "impact_radius").
|
|
506
|
+
*
|
|
507
|
+
* Ordering: Paid (search/social → ad networks → affiliates) →
|
|
508
|
+
* Organic (AI/discovery) → Retention (email → SMS → push → post-purchase)
|
|
509
|
+
*/
|
|
510
|
+
const UTM_SOURCE_EXACT = {
|
|
511
|
+
// ── Paid – Search & Social ────────────────────────────────────────────────
|
|
512
|
+
google: 'Google',
|
|
513
|
+
adwords: 'Google',
|
|
514
|
+
youtube: 'Google',
|
|
515
|
+
yt: 'Google',
|
|
516
|
+
meta: 'Facebook',
|
|
517
|
+
facebook: 'Facebook',
|
|
518
|
+
instagram: 'Facebook',
|
|
519
|
+
ig: 'Facebook',
|
|
520
|
+
igshopping: 'Facebook',
|
|
521
|
+
threads: 'Facebook',
|
|
522
|
+
twitter: 'Twitter',
|
|
523
|
+
snapchat: 'Snapchat',
|
|
524
|
+
pinterest: 'Pinterest',
|
|
525
|
+
bing: 'Bing',
|
|
526
|
+
microsoft: 'Bing',
|
|
527
|
+
tiktok: 'TikTok',
|
|
528
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
529
|
+
rtbhouse: 'RTB House',
|
|
530
|
+
applovin: 'AppLovin',
|
|
531
|
+
ttd: 'The Trade Desk',
|
|
532
|
+
amazondsp: 'Amazon DSP',
|
|
533
|
+
axon: 'Axon',
|
|
534
|
+
duel: 'Duel',
|
|
535
|
+
// ── Paid – Affiliates ────────────────────────────────────────────────────
|
|
536
|
+
awin: 'Awin',
|
|
537
|
+
'affiliate-cj': 'CJ Affiliate',
|
|
538
|
+
impact: 'Impact',
|
|
539
|
+
rakuten: 'Rakuten',
|
|
540
|
+
superfiliate: 'Superfiliate',
|
|
541
|
+
// ── Organic – AI & Discovery ─────────────────────────────────────────────
|
|
542
|
+
perplexity: 'Perplexity',
|
|
543
|
+
chatgpt: 'ChatGPT',
|
|
544
|
+
'chatgpt.com': 'ChatGPT',
|
|
545
|
+
openai: 'ChatGPT',
|
|
546
|
+
'copilot.com': 'Microsoft Copilot',
|
|
547
|
+
copilot: 'Microsoft Copilot',
|
|
548
|
+
applenews: 'Apple News',
|
|
549
|
+
whatsapp: 'WhatsApp',
|
|
550
|
+
podcast: 'Podcast',
|
|
551
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
552
|
+
mailchimp: 'Mailchimp',
|
|
553
|
+
omnisend: 'Omnisend',
|
|
554
|
+
iterable: 'Iterable',
|
|
555
|
+
listrak: 'Listrak',
|
|
556
|
+
sailthru: 'Sailthru',
|
|
557
|
+
// ── Retention – Push ─────────────────────────────────────────────────────
|
|
558
|
+
pushowl: 'PushOwl',
|
|
559
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
560
|
+
narvar: 'Narvar',
|
|
561
|
+
shop_app: 'Shop App',
|
|
562
|
+
salesforce: 'Salesforce',
|
|
563
|
+
yotpo: 'Yotpo',
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* Partial utm_source normalization (startsWith prefix check, lowercase).
|
|
567
|
+
*
|
|
568
|
+
* Checked after exact match so short exact keys (e.g. "ig", "yt") win first.
|
|
569
|
+
*/
|
|
570
|
+
const UTM_SOURCE_PARTIAL = [
|
|
571
|
+
// ── Paid – Social ─────────────────────────────────────────────────────────
|
|
572
|
+
{ prefix: 'tiktok', name: 'TikTok' },
|
|
573
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
574
|
+
{ prefix: 'criteo', name: 'Criteo' },
|
|
575
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
576
|
+
{ prefix: 'klaviyo', name: 'Klaviyo' },
|
|
577
|
+
// ── Retention – SMS ──────────────────────────────────────────────────────
|
|
578
|
+
{ prefix: 'attentive', name: 'Attentive' },
|
|
579
|
+
{ prefix: 'postscript', name: 'Postscript' },
|
|
580
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
581
|
+
{ prefix: 'afterpay', name: 'Afterpay' },
|
|
582
|
+
{ prefix: 'klarna', name: 'Klarna' },
|
|
583
|
+
];
|
|
584
|
+
const ORGANIC_SEARCH_ENGINES = [
|
|
585
|
+
{ match: 'google', name: 'Google' },
|
|
586
|
+
{ match: 'bing', name: 'Bing' },
|
|
587
|
+
{ match: 'yahoo', name: 'Yahoo' },
|
|
588
|
+
{ match: 'duckduckgo', name: 'DuckDuckGo' },
|
|
589
|
+
{ match: 'baidu', name: 'Baidu' },
|
|
590
|
+
{ match: 'yandex', name: 'Yandex' },
|
|
591
|
+
{ match: 'brave', name: 'Brave' },
|
|
592
|
+
];
|
|
593
|
+
const KNOWN_REFERRAL_PLATFORMS = [
|
|
594
|
+
{ match: 'facebook', name: 'Facebook' },
|
|
595
|
+
{ match: 'instagram', name: 'Facebook' },
|
|
596
|
+
{ match: 'twitter', name: 'Twitter' },
|
|
597
|
+
{ match: 'x.com', name: 'Twitter' },
|
|
598
|
+
{ match: 'tiktok', name: 'TikTok' },
|
|
599
|
+
{ match: 'pinterest', name: 'Pinterest' },
|
|
600
|
+
{ match: 'linkedin', name: 'LinkedIn' },
|
|
601
|
+
{ match: 'youtube', name: 'YouTube' },
|
|
602
|
+
{ match: 'chatgpt', name: 'ChatGPT' },
|
|
603
|
+
{ match: 'claude', name: 'Claude' },
|
|
604
|
+
{ match: 'perplexity', name: 'Perplexity' },
|
|
605
|
+
{ match: 'shop.app', name: 'Shop App' },
|
|
606
|
+
{ match: 'amazon', name: 'Amazon' },
|
|
607
|
+
{ match: 'attentive', name: 'Attentive' },
|
|
608
|
+
];
|
|
609
|
+
const OFFLINE_TOUCH = 'Blotout_Offline';
|
|
610
|
+
new Set([
|
|
611
|
+
...CLICK_IDS.map((c) => c.label),
|
|
612
|
+
...Object.values(UTM_SOURCE_EXACT),
|
|
613
|
+
...UTM_SOURCE_PARTIAL.map((e) => e.name),
|
|
614
|
+
...ORGANIC_SEARCH_ENGINES.map((e) => `Organic Search - ${e.name}`),
|
|
615
|
+
...KNOWN_REFERRAL_PLATFORMS.map((e) => `Referral - ${e.name}`),
|
|
616
|
+
'Referral - Other',
|
|
617
|
+
'Direct Traffic',
|
|
618
|
+
'Other',
|
|
619
|
+
OFFLINE_TOUCH,
|
|
620
|
+
]);
|
|
621
|
+
|
|
467
622
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
468
623
|
const getParsedCategoryId = (category) => {
|
|
469
624
|
try {
|
|
@@ -679,7 +834,7 @@ const getEventData = ({ eventName, userData, data, defaultCategory, categoryMapp
|
|
|
679
834
|
|
|
680
835
|
const tag = ({ data, eventName, eventId, manifestVariables, userId, }) => {
|
|
681
836
|
const payload = {
|
|
682
|
-
sdkVersion: "1.
|
|
837
|
+
sdkVersion: "1.55.0" ,
|
|
683
838
|
};
|
|
684
839
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
685
840
|
try {
|
package/index.js
CHANGED
|
@@ -78,6 +78,40 @@ var ProvidersAppLovinSdk = (function () {
|
|
|
78
78
|
},
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Known ad-network click ID query parameters and the human-readable provider
|
|
83
|
+
* label each one maps to. Used by the CDN worker to resolve `inSessionTouch`
|
|
84
|
+
* and by the analytics API to classify paid-media touch sessions.
|
|
85
|
+
*
|
|
86
|
+
* Keep this list in sync with `defaultParams` in queryParams.ts when new
|
|
87
|
+
* click ID providers are added.
|
|
88
|
+
*/
|
|
89
|
+
const CLICK_IDS = [
|
|
90
|
+
{ param: 'fbclid', label: 'Facebook' }, // Facebook Ads
|
|
91
|
+
{ param: 'gclid', label: 'Google' }, // Google Ads (click)
|
|
92
|
+
{ param: 'gbraid', label: 'Google' }, // Google Ads (iOS app)
|
|
93
|
+
{ param: 'wbraid', label: 'Google' }, // Google Ads (iOS web)
|
|
94
|
+
{ param: 'msclkid', label: 'Bing' }, // Microsoft Bing Ads
|
|
95
|
+
{ param: 'ttclid', label: 'TikTok' }, // TikTok Ads
|
|
96
|
+
{ param: 'ScCid', label: 'Snapchat' }, // Snapchat Ads
|
|
97
|
+
{ param: 'epik', label: 'Pinterest' }, // Pinterest Ads
|
|
98
|
+
{ param: 'li_fat_id', label: 'LinkedIn' }, // LinkedIn Ads
|
|
99
|
+
{ param: 'twclid', label: 'Twitter' }, // X (Twitter) Ads
|
|
100
|
+
{ param: 'rdt_cid', label: 'Reddit' }, // Reddit Ads
|
|
101
|
+
{ param: 'aleid', label: 'AppLovin' }, // AppLovin
|
|
102
|
+
{ param: 'tabclid', label: 'Taboola' }, // Taboola
|
|
103
|
+
{ param: 'obclid', label: 'Outbrain' }, // Outbrain
|
|
104
|
+
{ param: 'trybe', label: 'Trybe' }, // Trybe
|
|
105
|
+
{ param: '_kx', label: 'Klaviyo' }, // Klaviyo email campaigns
|
|
106
|
+
{ param: 'mc_eid', label: 'Mailchimp' }, // Mailchimp email campaigns
|
|
107
|
+
{ param: 'ttd_id', label: 'The Trade Desk' }, // The Trade Desk programmatic
|
|
108
|
+
{ param: 'evsclid', label: 'EvoSearch' }, // EvoSearch
|
|
109
|
+
{ param: 'li_did', label: 'Live Intent' }, // LiveIntent device-level ad
|
|
110
|
+
{ param: '_raclid', label: 'Rumble' }, // Rumble Ads
|
|
111
|
+
{ param: 'ref_id', label: 'StackAdapt' }, // StackAdapt programmatic
|
|
112
|
+
{ param: 'duel_a', label: 'Duel' }, // Duel referral/advocacy
|
|
113
|
+
];
|
|
114
|
+
|
|
81
115
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
82
116
|
if (!entry.includes('-')) {
|
|
83
117
|
return entry;
|
|
@@ -465,6 +499,127 @@ var ProvidersAppLovinSdk = (function () {
|
|
|
465
499
|
]);
|
|
466
500
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
467
501
|
|
|
502
|
+
/**
|
|
503
|
+
* Exact utm_source normalization (lowercase key → canonical name).
|
|
504
|
+
*
|
|
505
|
+
* Use exact match when the key is short, generic, or must not accidentally
|
|
506
|
+
* absorb variant spellings (e.g. "impact" must not match "impact_radius").
|
|
507
|
+
*
|
|
508
|
+
* Ordering: Paid (search/social → ad networks → affiliates) →
|
|
509
|
+
* Organic (AI/discovery) → Retention (email → SMS → push → post-purchase)
|
|
510
|
+
*/
|
|
511
|
+
const UTM_SOURCE_EXACT = {
|
|
512
|
+
// ── Paid – Search & Social ────────────────────────────────────────────────
|
|
513
|
+
google: 'Google',
|
|
514
|
+
adwords: 'Google',
|
|
515
|
+
youtube: 'Google',
|
|
516
|
+
yt: 'Google',
|
|
517
|
+
meta: 'Facebook',
|
|
518
|
+
facebook: 'Facebook',
|
|
519
|
+
instagram: 'Facebook',
|
|
520
|
+
ig: 'Facebook',
|
|
521
|
+
igshopping: 'Facebook',
|
|
522
|
+
threads: 'Facebook',
|
|
523
|
+
twitter: 'Twitter',
|
|
524
|
+
snapchat: 'Snapchat',
|
|
525
|
+
pinterest: 'Pinterest',
|
|
526
|
+
bing: 'Bing',
|
|
527
|
+
microsoft: 'Bing',
|
|
528
|
+
tiktok: 'TikTok',
|
|
529
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
530
|
+
rtbhouse: 'RTB House',
|
|
531
|
+
applovin: 'AppLovin',
|
|
532
|
+
ttd: 'The Trade Desk',
|
|
533
|
+
amazondsp: 'Amazon DSP',
|
|
534
|
+
axon: 'Axon',
|
|
535
|
+
duel: 'Duel',
|
|
536
|
+
// ── Paid – Affiliates ────────────────────────────────────────────────────
|
|
537
|
+
awin: 'Awin',
|
|
538
|
+
'affiliate-cj': 'CJ Affiliate',
|
|
539
|
+
impact: 'Impact',
|
|
540
|
+
rakuten: 'Rakuten',
|
|
541
|
+
superfiliate: 'Superfiliate',
|
|
542
|
+
// ── Organic – AI & Discovery ─────────────────────────────────────────────
|
|
543
|
+
perplexity: 'Perplexity',
|
|
544
|
+
chatgpt: 'ChatGPT',
|
|
545
|
+
'chatgpt.com': 'ChatGPT',
|
|
546
|
+
openai: 'ChatGPT',
|
|
547
|
+
'copilot.com': 'Microsoft Copilot',
|
|
548
|
+
copilot: 'Microsoft Copilot',
|
|
549
|
+
applenews: 'Apple News',
|
|
550
|
+
whatsapp: 'WhatsApp',
|
|
551
|
+
podcast: 'Podcast',
|
|
552
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
553
|
+
mailchimp: 'Mailchimp',
|
|
554
|
+
omnisend: 'Omnisend',
|
|
555
|
+
iterable: 'Iterable',
|
|
556
|
+
listrak: 'Listrak',
|
|
557
|
+
sailthru: 'Sailthru',
|
|
558
|
+
// ── Retention – Push ─────────────────────────────────────────────────────
|
|
559
|
+
pushowl: 'PushOwl',
|
|
560
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
561
|
+
narvar: 'Narvar',
|
|
562
|
+
shop_app: 'Shop App',
|
|
563
|
+
salesforce: 'Salesforce',
|
|
564
|
+
yotpo: 'Yotpo',
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Partial utm_source normalization (startsWith prefix check, lowercase).
|
|
568
|
+
*
|
|
569
|
+
* Checked after exact match so short exact keys (e.g. "ig", "yt") win first.
|
|
570
|
+
*/
|
|
571
|
+
const UTM_SOURCE_PARTIAL = [
|
|
572
|
+
// ── Paid – Social ─────────────────────────────────────────────────────────
|
|
573
|
+
{ prefix: 'tiktok', name: 'TikTok' },
|
|
574
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
575
|
+
{ prefix: 'criteo', name: 'Criteo' },
|
|
576
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
577
|
+
{ prefix: 'klaviyo', name: 'Klaviyo' },
|
|
578
|
+
// ── Retention – SMS ──────────────────────────────────────────────────────
|
|
579
|
+
{ prefix: 'attentive', name: 'Attentive' },
|
|
580
|
+
{ prefix: 'postscript', name: 'Postscript' },
|
|
581
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
582
|
+
{ prefix: 'afterpay', name: 'Afterpay' },
|
|
583
|
+
{ prefix: 'klarna', name: 'Klarna' },
|
|
584
|
+
];
|
|
585
|
+
const ORGANIC_SEARCH_ENGINES = [
|
|
586
|
+
{ match: 'google', name: 'Google' },
|
|
587
|
+
{ match: 'bing', name: 'Bing' },
|
|
588
|
+
{ match: 'yahoo', name: 'Yahoo' },
|
|
589
|
+
{ match: 'duckduckgo', name: 'DuckDuckGo' },
|
|
590
|
+
{ match: 'baidu', name: 'Baidu' },
|
|
591
|
+
{ match: 'yandex', name: 'Yandex' },
|
|
592
|
+
{ match: 'brave', name: 'Brave' },
|
|
593
|
+
];
|
|
594
|
+
const KNOWN_REFERRAL_PLATFORMS = [
|
|
595
|
+
{ match: 'facebook', name: 'Facebook' },
|
|
596
|
+
{ match: 'instagram', name: 'Facebook' },
|
|
597
|
+
{ match: 'twitter', name: 'Twitter' },
|
|
598
|
+
{ match: 'x.com', name: 'Twitter' },
|
|
599
|
+
{ match: 'tiktok', name: 'TikTok' },
|
|
600
|
+
{ match: 'pinterest', name: 'Pinterest' },
|
|
601
|
+
{ match: 'linkedin', name: 'LinkedIn' },
|
|
602
|
+
{ match: 'youtube', name: 'YouTube' },
|
|
603
|
+
{ match: 'chatgpt', name: 'ChatGPT' },
|
|
604
|
+
{ match: 'claude', name: 'Claude' },
|
|
605
|
+
{ match: 'perplexity', name: 'Perplexity' },
|
|
606
|
+
{ match: 'shop.app', name: 'Shop App' },
|
|
607
|
+
{ match: 'amazon', name: 'Amazon' },
|
|
608
|
+
{ match: 'attentive', name: 'Attentive' },
|
|
609
|
+
];
|
|
610
|
+
const OFFLINE_TOUCH = 'Blotout_Offline';
|
|
611
|
+
new Set([
|
|
612
|
+
...CLICK_IDS.map((c) => c.label),
|
|
613
|
+
...Object.values(UTM_SOURCE_EXACT),
|
|
614
|
+
...UTM_SOURCE_PARTIAL.map((e) => e.name),
|
|
615
|
+
...ORGANIC_SEARCH_ENGINES.map((e) => `Organic Search - ${e.name}`),
|
|
616
|
+
...KNOWN_REFERRAL_PLATFORMS.map((e) => `Referral - ${e.name}`),
|
|
617
|
+
'Referral - Other',
|
|
618
|
+
'Direct Traffic',
|
|
619
|
+
'Other',
|
|
620
|
+
OFFLINE_TOUCH,
|
|
621
|
+
]);
|
|
622
|
+
|
|
468
623
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
469
624
|
const getParsedCategoryId = (category) => {
|
|
470
625
|
try {
|
|
@@ -680,7 +835,7 @@ var ProvidersAppLovinSdk = (function () {
|
|
|
680
835
|
|
|
681
836
|
const tag = ({ data, eventName, eventId, manifestVariables, userId, }) => {
|
|
682
837
|
const payload = {
|
|
683
|
-
sdkVersion: "1.
|
|
838
|
+
sdkVersion: "1.55.0" ,
|
|
684
839
|
};
|
|
685
840
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
686
841
|
try {
|
package/index.mjs
CHANGED
|
@@ -75,6 +75,40 @@ const logger = {
|
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Known ad-network click ID query parameters and the human-readable provider
|
|
80
|
+
* label each one maps to. Used by the CDN worker to resolve `inSessionTouch`
|
|
81
|
+
* and by the analytics API to classify paid-media touch sessions.
|
|
82
|
+
*
|
|
83
|
+
* Keep this list in sync with `defaultParams` in queryParams.ts when new
|
|
84
|
+
* click ID providers are added.
|
|
85
|
+
*/
|
|
86
|
+
const CLICK_IDS = [
|
|
87
|
+
{ param: 'fbclid', label: 'Facebook' }, // Facebook Ads
|
|
88
|
+
{ param: 'gclid', label: 'Google' }, // Google Ads (click)
|
|
89
|
+
{ param: 'gbraid', label: 'Google' }, // Google Ads (iOS app)
|
|
90
|
+
{ param: 'wbraid', label: 'Google' }, // Google Ads (iOS web)
|
|
91
|
+
{ param: 'msclkid', label: 'Bing' }, // Microsoft Bing Ads
|
|
92
|
+
{ param: 'ttclid', label: 'TikTok' }, // TikTok Ads
|
|
93
|
+
{ param: 'ScCid', label: 'Snapchat' }, // Snapchat Ads
|
|
94
|
+
{ param: 'epik', label: 'Pinterest' }, // Pinterest Ads
|
|
95
|
+
{ param: 'li_fat_id', label: 'LinkedIn' }, // LinkedIn Ads
|
|
96
|
+
{ param: 'twclid', label: 'Twitter' }, // X (Twitter) Ads
|
|
97
|
+
{ param: 'rdt_cid', label: 'Reddit' }, // Reddit Ads
|
|
98
|
+
{ param: 'aleid', label: 'AppLovin' }, // AppLovin
|
|
99
|
+
{ param: 'tabclid', label: 'Taboola' }, // Taboola
|
|
100
|
+
{ param: 'obclid', label: 'Outbrain' }, // Outbrain
|
|
101
|
+
{ param: 'trybe', label: 'Trybe' }, // Trybe
|
|
102
|
+
{ param: '_kx', label: 'Klaviyo' }, // Klaviyo email campaigns
|
|
103
|
+
{ param: 'mc_eid', label: 'Mailchimp' }, // Mailchimp email campaigns
|
|
104
|
+
{ param: 'ttd_id', label: 'The Trade Desk' }, // The Trade Desk programmatic
|
|
105
|
+
{ param: 'evsclid', label: 'EvoSearch' }, // EvoSearch
|
|
106
|
+
{ param: 'li_did', label: 'Live Intent' }, // LiveIntent device-level ad
|
|
107
|
+
{ param: '_raclid', label: 'Rumble' }, // Rumble Ads
|
|
108
|
+
{ param: 'ref_id', label: 'StackAdapt' }, // StackAdapt programmatic
|
|
109
|
+
{ param: 'duel_a', label: 'Duel' }, // Duel referral/advocacy
|
|
110
|
+
];
|
|
111
|
+
|
|
78
112
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
79
113
|
if (!entry.includes('-')) {
|
|
80
114
|
return entry;
|
|
@@ -462,6 +496,127 @@ const usStates = new Map([
|
|
|
462
496
|
]);
|
|
463
497
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
464
498
|
|
|
499
|
+
/**
|
|
500
|
+
* Exact utm_source normalization (lowercase key → canonical name).
|
|
501
|
+
*
|
|
502
|
+
* Use exact match when the key is short, generic, or must not accidentally
|
|
503
|
+
* absorb variant spellings (e.g. "impact" must not match "impact_radius").
|
|
504
|
+
*
|
|
505
|
+
* Ordering: Paid (search/social → ad networks → affiliates) →
|
|
506
|
+
* Organic (AI/discovery) → Retention (email → SMS → push → post-purchase)
|
|
507
|
+
*/
|
|
508
|
+
const UTM_SOURCE_EXACT = {
|
|
509
|
+
// ── Paid – Search & Social ────────────────────────────────────────────────
|
|
510
|
+
google: 'Google',
|
|
511
|
+
adwords: 'Google',
|
|
512
|
+
youtube: 'Google',
|
|
513
|
+
yt: 'Google',
|
|
514
|
+
meta: 'Facebook',
|
|
515
|
+
facebook: 'Facebook',
|
|
516
|
+
instagram: 'Facebook',
|
|
517
|
+
ig: 'Facebook',
|
|
518
|
+
igshopping: 'Facebook',
|
|
519
|
+
threads: 'Facebook',
|
|
520
|
+
twitter: 'Twitter',
|
|
521
|
+
snapchat: 'Snapchat',
|
|
522
|
+
pinterest: 'Pinterest',
|
|
523
|
+
bing: 'Bing',
|
|
524
|
+
microsoft: 'Bing',
|
|
525
|
+
tiktok: 'TikTok',
|
|
526
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
527
|
+
rtbhouse: 'RTB House',
|
|
528
|
+
applovin: 'AppLovin',
|
|
529
|
+
ttd: 'The Trade Desk',
|
|
530
|
+
amazondsp: 'Amazon DSP',
|
|
531
|
+
axon: 'Axon',
|
|
532
|
+
duel: 'Duel',
|
|
533
|
+
// ── Paid – Affiliates ────────────────────────────────────────────────────
|
|
534
|
+
awin: 'Awin',
|
|
535
|
+
'affiliate-cj': 'CJ Affiliate',
|
|
536
|
+
impact: 'Impact',
|
|
537
|
+
rakuten: 'Rakuten',
|
|
538
|
+
superfiliate: 'Superfiliate',
|
|
539
|
+
// ── Organic – AI & Discovery ─────────────────────────────────────────────
|
|
540
|
+
perplexity: 'Perplexity',
|
|
541
|
+
chatgpt: 'ChatGPT',
|
|
542
|
+
'chatgpt.com': 'ChatGPT',
|
|
543
|
+
openai: 'ChatGPT',
|
|
544
|
+
'copilot.com': 'Microsoft Copilot',
|
|
545
|
+
copilot: 'Microsoft Copilot',
|
|
546
|
+
applenews: 'Apple News',
|
|
547
|
+
whatsapp: 'WhatsApp',
|
|
548
|
+
podcast: 'Podcast',
|
|
549
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
550
|
+
mailchimp: 'Mailchimp',
|
|
551
|
+
omnisend: 'Omnisend',
|
|
552
|
+
iterable: 'Iterable',
|
|
553
|
+
listrak: 'Listrak',
|
|
554
|
+
sailthru: 'Sailthru',
|
|
555
|
+
// ── Retention – Push ─────────────────────────────────────────────────────
|
|
556
|
+
pushowl: 'PushOwl',
|
|
557
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
558
|
+
narvar: 'Narvar',
|
|
559
|
+
shop_app: 'Shop App',
|
|
560
|
+
salesforce: 'Salesforce',
|
|
561
|
+
yotpo: 'Yotpo',
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* Partial utm_source normalization (startsWith prefix check, lowercase).
|
|
565
|
+
*
|
|
566
|
+
* Checked after exact match so short exact keys (e.g. "ig", "yt") win first.
|
|
567
|
+
*/
|
|
568
|
+
const UTM_SOURCE_PARTIAL = [
|
|
569
|
+
// ── Paid – Social ─────────────────────────────────────────────────────────
|
|
570
|
+
{ prefix: 'tiktok', name: 'TikTok' },
|
|
571
|
+
// ── Paid – Ad Networks ───────────────────────────────────────────────────
|
|
572
|
+
{ prefix: 'criteo', name: 'Criteo' },
|
|
573
|
+
// ── Retention – Email ────────────────────────────────────────────────────
|
|
574
|
+
{ prefix: 'klaviyo', name: 'Klaviyo' },
|
|
575
|
+
// ── Retention – SMS ──────────────────────────────────────────────────────
|
|
576
|
+
{ prefix: 'attentive', name: 'Attentive' },
|
|
577
|
+
{ prefix: 'postscript', name: 'Postscript' },
|
|
578
|
+
// ── Retention – Post-purchase / Payment ──────────────────────────────────
|
|
579
|
+
{ prefix: 'afterpay', name: 'Afterpay' },
|
|
580
|
+
{ prefix: 'klarna', name: 'Klarna' },
|
|
581
|
+
];
|
|
582
|
+
const ORGANIC_SEARCH_ENGINES = [
|
|
583
|
+
{ match: 'google', name: 'Google' },
|
|
584
|
+
{ match: 'bing', name: 'Bing' },
|
|
585
|
+
{ match: 'yahoo', name: 'Yahoo' },
|
|
586
|
+
{ match: 'duckduckgo', name: 'DuckDuckGo' },
|
|
587
|
+
{ match: 'baidu', name: 'Baidu' },
|
|
588
|
+
{ match: 'yandex', name: 'Yandex' },
|
|
589
|
+
{ match: 'brave', name: 'Brave' },
|
|
590
|
+
];
|
|
591
|
+
const KNOWN_REFERRAL_PLATFORMS = [
|
|
592
|
+
{ match: 'facebook', name: 'Facebook' },
|
|
593
|
+
{ match: 'instagram', name: 'Facebook' },
|
|
594
|
+
{ match: 'twitter', name: 'Twitter' },
|
|
595
|
+
{ match: 'x.com', name: 'Twitter' },
|
|
596
|
+
{ match: 'tiktok', name: 'TikTok' },
|
|
597
|
+
{ match: 'pinterest', name: 'Pinterest' },
|
|
598
|
+
{ match: 'linkedin', name: 'LinkedIn' },
|
|
599
|
+
{ match: 'youtube', name: 'YouTube' },
|
|
600
|
+
{ match: 'chatgpt', name: 'ChatGPT' },
|
|
601
|
+
{ match: 'claude', name: 'Claude' },
|
|
602
|
+
{ match: 'perplexity', name: 'Perplexity' },
|
|
603
|
+
{ match: 'shop.app', name: 'Shop App' },
|
|
604
|
+
{ match: 'amazon', name: 'Amazon' },
|
|
605
|
+
{ match: 'attentive', name: 'Attentive' },
|
|
606
|
+
];
|
|
607
|
+
const OFFLINE_TOUCH = 'Blotout_Offline';
|
|
608
|
+
new Set([
|
|
609
|
+
...CLICK_IDS.map((c) => c.label),
|
|
610
|
+
...Object.values(UTM_SOURCE_EXACT),
|
|
611
|
+
...UTM_SOURCE_PARTIAL.map((e) => e.name),
|
|
612
|
+
...ORGANIC_SEARCH_ENGINES.map((e) => `Organic Search - ${e.name}`),
|
|
613
|
+
...KNOWN_REFERRAL_PLATFORMS.map((e) => `Referral - ${e.name}`),
|
|
614
|
+
'Referral - Other',
|
|
615
|
+
'Direct Traffic',
|
|
616
|
+
'Other',
|
|
617
|
+
OFFLINE_TOUCH,
|
|
618
|
+
]);
|
|
619
|
+
|
|
465
620
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
466
621
|
const getParsedCategoryId = (category) => {
|
|
467
622
|
try {
|
|
@@ -677,7 +832,7 @@ const getEventData = ({ eventName, userData, data, defaultCategory, categoryMapp
|
|
|
677
832
|
|
|
678
833
|
const tag = ({ data, eventName, eventId, manifestVariables, userId, }) => {
|
|
679
834
|
const payload = {
|
|
680
|
-
sdkVersion: "1.
|
|
835
|
+
sdkVersion: "1.55.0" ,
|
|
681
836
|
};
|
|
682
837
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
683
838
|
try {
|