mod-build 3.7.34 → 3.7.35-beta.1
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-build",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.35-beta.1",
|
|
4
4
|
"description": "Share components for S3 sites.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
},
|
|
79
79
|
"overrides": {
|
|
80
80
|
"graceful-fs": "^4.2.9",
|
|
81
|
-
"eslint": "
|
|
81
|
+
"eslint": "8.57.0"
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const trafficChannels = window.updateMediaSpecificGtm;
|
|
2
|
+
// trafficChannels is an array of media channels to enable this feature, e.g. ['sem', 'avm'] - we are going to remove this param after testing
|
|
3
|
+
const gtmContainers = {
|
|
4
|
+
'sem': 'GTM-5WM2R5WC',
|
|
5
|
+
'avm': 'GTM-TBJV3H',
|
|
6
|
+
'pub': 'GTM-TBJV3H'
|
|
7
|
+
};
|
|
8
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
9
|
+
const queryParams = Object.fromEntries(urlParams.entries());
|
|
10
|
+
const url = window.location.href.replace(window.location.hash, '');
|
|
11
|
+
const hasSemIdentifiers = url.includes('gclid') || url.includes('msclkid') || url.includes('=SEM') || url.includes('=sem');
|
|
12
|
+
// const hasQuadlink = 'quadlink' in queryParams; - keeping it for future use
|
|
13
|
+
const hasCCIDorCLK = 'ccid' in queryParams || 'clk' in queryParams;
|
|
14
|
+
const hasAVMParam = queryParams.channel && queryParams.channel.toLowerCase() === 'avm';
|
|
15
|
+
let mediaChannel = 'pub';
|
|
16
|
+
|
|
17
|
+
if (hasAVMParam) {
|
|
18
|
+
mediaChannel = 'avm';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (hasSemIdentifiers && !hasCCIDorCLK && !hasAVMParam) {
|
|
22
|
+
mediaChannel = 'sem';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (trafficChannels.includes(mediaChannel) && gtmContainers[mediaChannel]) {
|
|
26
|
+
window.gtm_container_ID = gtmContainers[mediaChannel];
|
|
27
|
+
}
|