@blotoutio/providers-google-analytics-4-sdk 1.35.2 → 1.36.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/index.cjs.js +9 -2
- package/index.js +9 -2
- package/index.mjs +9 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -434,6 +434,13 @@ const usStates = new Map([
|
|
|
434
434
|
]);
|
|
435
435
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
436
436
|
|
|
437
|
+
/** This function will create a deep copy using JSON stringify/parse
|
|
438
|
+
* that will also remove all methods from the incoming objects. Use
|
|
439
|
+
* this function when cloning user-provided objects since structuredClone
|
|
440
|
+
* will throw an error if given an object with functions.
|
|
441
|
+
*/
|
|
442
|
+
const jsonClone = (json) => JSON.parse(JSON.stringify(json));
|
|
443
|
+
|
|
437
444
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
438
445
|
const getGoogleConsentFromCategories = (categories) => {
|
|
439
446
|
const analyticsConsent = isCategoryConsented(categories, 'analytics');
|
|
@@ -710,7 +717,7 @@ const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {
|
|
|
710
717
|
if (manifestVariables['debug'] === '1') {
|
|
711
718
|
eventData['debug_mode'] = true;
|
|
712
719
|
}
|
|
713
|
-
const rawData =
|
|
720
|
+
const rawData = jsonClone(data !== null && data !== void 0 ? data : {});
|
|
714
721
|
if ('items' in eventData) {
|
|
715
722
|
delete rawData['contents'];
|
|
716
723
|
}
|
|
@@ -776,7 +783,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
|
776
783
|
}
|
|
777
784
|
return {
|
|
778
785
|
loaded: isLoaded,
|
|
779
|
-
sdkVersion: "1.
|
|
786
|
+
sdkVersion: "1.36.1" ,
|
|
780
787
|
};
|
|
781
788
|
};
|
|
782
789
|
|
package/index.js
CHANGED
|
@@ -435,6 +435,13 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
435
435
|
]);
|
|
436
436
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
437
437
|
|
|
438
|
+
/** This function will create a deep copy using JSON stringify/parse
|
|
439
|
+
* that will also remove all methods from the incoming objects. Use
|
|
440
|
+
* this function when cloning user-provided objects since structuredClone
|
|
441
|
+
* will throw an error if given an object with functions.
|
|
442
|
+
*/
|
|
443
|
+
const jsonClone = (json) => JSON.parse(JSON.stringify(json));
|
|
444
|
+
|
|
438
445
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
439
446
|
const getGoogleConsentFromCategories = (categories) => {
|
|
440
447
|
const analyticsConsent = isCategoryConsented(categories, 'analytics');
|
|
@@ -711,7 +718,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
711
718
|
if (manifestVariables['debug'] === '1') {
|
|
712
719
|
eventData['debug_mode'] = true;
|
|
713
720
|
}
|
|
714
|
-
const rawData =
|
|
721
|
+
const rawData = jsonClone(data !== null && data !== void 0 ? data : {});
|
|
715
722
|
if ('items' in eventData) {
|
|
716
723
|
delete rawData['contents'];
|
|
717
724
|
}
|
|
@@ -777,7 +784,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
777
784
|
}
|
|
778
785
|
return {
|
|
779
786
|
loaded: isLoaded,
|
|
780
|
-
sdkVersion: "1.
|
|
787
|
+
sdkVersion: "1.36.1" ,
|
|
781
788
|
};
|
|
782
789
|
};
|
|
783
790
|
|
package/index.mjs
CHANGED
|
@@ -432,6 +432,13 @@ const usStates = new Map([
|
|
|
432
432
|
]);
|
|
433
433
|
new Set([...isoCountries.keys(), ...usStates.keys()]);
|
|
434
434
|
|
|
435
|
+
/** This function will create a deep copy using JSON stringify/parse
|
|
436
|
+
* that will also remove all methods from the incoming objects. Use
|
|
437
|
+
* this function when cloning user-provided objects since structuredClone
|
|
438
|
+
* will throw an error if given an object with functions.
|
|
439
|
+
*/
|
|
440
|
+
const jsonClone = (json) => JSON.parse(JSON.stringify(json));
|
|
441
|
+
|
|
435
442
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
436
443
|
const getGoogleConsentFromCategories = (categories) => {
|
|
437
444
|
const analyticsConsent = isCategoryConsented(categories, 'analytics');
|
|
@@ -708,7 +715,7 @@ const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {
|
|
|
708
715
|
if (manifestVariables['debug'] === '1') {
|
|
709
716
|
eventData['debug_mode'] = true;
|
|
710
717
|
}
|
|
711
|
-
const rawData =
|
|
718
|
+
const rawData = jsonClone(data !== null && data !== void 0 ? data : {});
|
|
712
719
|
if ('items' in eventData) {
|
|
713
720
|
delete rawData['contents'];
|
|
714
721
|
}
|
|
@@ -774,7 +781,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
|
774
781
|
}
|
|
775
782
|
return {
|
|
776
783
|
loaded: isLoaded,
|
|
777
|
-
sdkVersion: "1.
|
|
784
|
+
sdkVersion: "1.36.1" ,
|
|
778
785
|
};
|
|
779
786
|
};
|
|
780
787
|
|