@blotoutio/providers-google-ads-clicks-sdk 1.69.2 → 1.70.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 +24 -17
- package/index.js +24 -17
- package/index.mjs +24 -17
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -911,7 +911,7 @@ const initGAds = (ID, consentData, executionContext, consentSkip, sdkUrl) => {
|
|
|
911
911
|
}
|
|
912
912
|
};
|
|
913
913
|
const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
914
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
914
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
915
915
|
const shouldLoadSDK = ((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['loadSDK']) === '1' ||
|
|
916
916
|
((_b = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _b === void 0 ? void 0 : _b['dynamicRemarketingEnabled']) === '1';
|
|
917
917
|
if (typeof window === 'undefined' ||
|
|
@@ -926,9 +926,12 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
|
926
926
|
if (resolvedPageUrl) {
|
|
927
927
|
customConfig['page_location'] = resolvedPageUrl;
|
|
928
928
|
}
|
|
929
|
-
//
|
|
930
|
-
|
|
931
|
-
|
|
929
|
+
// Must match tag.ts. Left on without it, gtag collects user data on its own.
|
|
930
|
+
const isDataManager = ((_e = manifest.variables) === null || _e === void 0 ? void 0 : _e['apiVersion']) === '2';
|
|
931
|
+
const allowEnhancedConversions = isDataManager
|
|
932
|
+
? ((_f = manifest.variables) === null || _f === void 0 ? void 0 : _f['dataManagerEnhancedConversions']) !== '0'
|
|
933
|
+
: ((_g = manifest.variables) === null || _g === void 0 ? void 0 : _g['enhancedConversionsSetting']) === 'gtag';
|
|
934
|
+
if (allowEnhancedConversions) {
|
|
932
935
|
customConfig['allow_enhanced_conversions'] = true;
|
|
933
936
|
}
|
|
934
937
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -940,7 +943,7 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
|
940
943
|
};
|
|
941
944
|
if (!window.google_tag_manager ||
|
|
942
945
|
!window.google_tag_manager[manifest.variables['tagId']]) {
|
|
943
|
-
initGAds(manifest.variables['tagId'], consentData, executionContext, (
|
|
946
|
+
initGAds(manifest.variables['tagId'], consentData, executionContext, (_h = manifest.variables) === null || _h === void 0 ? void 0 : _h['consentSkip'], (_j = manifest.variables) === null || _j === void 0 ? void 0 : _j['sdkUrl']);
|
|
944
947
|
}
|
|
945
948
|
if (window.gtag) {
|
|
946
949
|
window.gtag('config', manifest.variables['tagId'], customConfig);
|
|
@@ -1009,7 +1012,7 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1009
1012
|
var _a, _b;
|
|
1010
1013
|
const result = {
|
|
1011
1014
|
isFired: false,
|
|
1012
|
-
sdkVersion: "1.
|
|
1015
|
+
sdkVersion: "1.70.0" ,
|
|
1013
1016
|
};
|
|
1014
1017
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1015
1018
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1028,17 +1031,21 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1028
1031
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1029
1032
|
if (conversionLabel) {
|
|
1030
1033
|
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1034
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1035
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1036
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1037
|
+
const sendUserData = isDataManager
|
|
1038
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1039
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1040
|
+
if (sendUserData && destination) {
|
|
1041
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1042
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1043
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1044
|
+
// when the session store has no identifiers.
|
|
1045
|
+
const userData = getUserData(destination);
|
|
1046
|
+
if (Object.keys(userData).length) {
|
|
1047
|
+
window.gtag('set', 'user_data', userData);
|
|
1048
|
+
}
|
|
1042
1049
|
}
|
|
1043
1050
|
const cartData = getCartData(manifestVariables, data);
|
|
1044
1051
|
const fireConversion = (isNewCustomer) => {
|
package/index.js
CHANGED
|
@@ -912,7 +912,7 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
914
|
const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
915
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
915
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
916
916
|
const shouldLoadSDK = ((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['loadSDK']) === '1' ||
|
|
917
917
|
((_b = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _b === void 0 ? void 0 : _b['dynamicRemarketingEnabled']) === '1';
|
|
918
918
|
if (typeof window === 'undefined' ||
|
|
@@ -927,9 +927,12 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
927
927
|
if (resolvedPageUrl) {
|
|
928
928
|
customConfig['page_location'] = resolvedPageUrl;
|
|
929
929
|
}
|
|
930
|
-
//
|
|
931
|
-
|
|
932
|
-
|
|
930
|
+
// Must match tag.ts. Left on without it, gtag collects user data on its own.
|
|
931
|
+
const isDataManager = ((_e = manifest.variables) === null || _e === void 0 ? void 0 : _e['apiVersion']) === '2';
|
|
932
|
+
const allowEnhancedConversions = isDataManager
|
|
933
|
+
? ((_f = manifest.variables) === null || _f === void 0 ? void 0 : _f['dataManagerEnhancedConversions']) !== '0'
|
|
934
|
+
: ((_g = manifest.variables) === null || _g === void 0 ? void 0 : _g['enhancedConversionsSetting']) === 'gtag';
|
|
935
|
+
if (allowEnhancedConversions) {
|
|
933
936
|
customConfig['allow_enhanced_conversions'] = true;
|
|
934
937
|
}
|
|
935
938
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -941,7 +944,7 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
941
944
|
};
|
|
942
945
|
if (!window.google_tag_manager ||
|
|
943
946
|
!window.google_tag_manager[manifest.variables['tagId']]) {
|
|
944
|
-
initGAds(manifest.variables['tagId'], consentData, executionContext, (
|
|
947
|
+
initGAds(manifest.variables['tagId'], consentData, executionContext, (_h = manifest.variables) === null || _h === void 0 ? void 0 : _h['consentSkip'], (_j = manifest.variables) === null || _j === void 0 ? void 0 : _j['sdkUrl']);
|
|
945
948
|
}
|
|
946
949
|
if (window.gtag) {
|
|
947
950
|
window.gtag('config', manifest.variables['tagId'], customConfig);
|
|
@@ -1010,7 +1013,7 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
1010
1013
|
var _a, _b;
|
|
1011
1014
|
const result = {
|
|
1012
1015
|
isFired: false,
|
|
1013
|
-
sdkVersion: "1.
|
|
1016
|
+
sdkVersion: "1.70.0" ,
|
|
1014
1017
|
};
|
|
1015
1018
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1016
1019
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1029,17 +1032,21 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
1029
1032
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1030
1033
|
if (conversionLabel) {
|
|
1031
1034
|
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1035
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1036
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1037
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1038
|
+
const sendUserData = isDataManager
|
|
1039
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1040
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1041
|
+
if (sendUserData && destination) {
|
|
1042
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1043
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1044
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1045
|
+
// when the session store has no identifiers.
|
|
1046
|
+
const userData = getUserData(destination);
|
|
1047
|
+
if (Object.keys(userData).length) {
|
|
1048
|
+
window.gtag('set', 'user_data', userData);
|
|
1049
|
+
}
|
|
1043
1050
|
}
|
|
1044
1051
|
const cartData = getCartData(manifestVariables, data);
|
|
1045
1052
|
const fireConversion = (isNewCustomer) => {
|
package/index.mjs
CHANGED
|
@@ -909,7 +909,7 @@ const initGAds = (ID, consentData, executionContext, consentSkip, sdkUrl) => {
|
|
|
909
909
|
}
|
|
910
910
|
};
|
|
911
911
|
const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
912
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
912
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
913
913
|
const shouldLoadSDK = ((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['loadSDK']) === '1' ||
|
|
914
914
|
((_b = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _b === void 0 ? void 0 : _b['dynamicRemarketingEnabled']) === '1';
|
|
915
915
|
if (typeof window === 'undefined' ||
|
|
@@ -924,9 +924,12 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
|
924
924
|
if (resolvedPageUrl) {
|
|
925
925
|
customConfig['page_location'] = resolvedPageUrl;
|
|
926
926
|
}
|
|
927
|
-
//
|
|
928
|
-
|
|
929
|
-
|
|
927
|
+
// Must match tag.ts. Left on without it, gtag collects user data on its own.
|
|
928
|
+
const isDataManager = ((_e = manifest.variables) === null || _e === void 0 ? void 0 : _e['apiVersion']) === '2';
|
|
929
|
+
const allowEnhancedConversions = isDataManager
|
|
930
|
+
? ((_f = manifest.variables) === null || _f === void 0 ? void 0 : _f['dataManagerEnhancedConversions']) !== '0'
|
|
931
|
+
: ((_g = manifest.variables) === null || _g === void 0 ? void 0 : _g['enhancedConversionsSetting']) === 'gtag';
|
|
932
|
+
if (allowEnhancedConversions) {
|
|
930
933
|
customConfig['allow_enhanced_conversions'] = true;
|
|
931
934
|
}
|
|
932
935
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -938,7 +941,7 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
|
|
|
938
941
|
};
|
|
939
942
|
if (!window.google_tag_manager ||
|
|
940
943
|
!window.google_tag_manager[manifest.variables['tagId']]) {
|
|
941
|
-
initGAds(manifest.variables['tagId'], consentData, executionContext, (
|
|
944
|
+
initGAds(manifest.variables['tagId'], consentData, executionContext, (_h = manifest.variables) === null || _h === void 0 ? void 0 : _h['consentSkip'], (_j = manifest.variables) === null || _j === void 0 ? void 0 : _j['sdkUrl']);
|
|
942
945
|
}
|
|
943
946
|
if (window.gtag) {
|
|
944
947
|
window.gtag('config', manifest.variables['tagId'], customConfig);
|
|
@@ -1007,7 +1010,7 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1007
1010
|
var _a, _b;
|
|
1008
1011
|
const result = {
|
|
1009
1012
|
isFired: false,
|
|
1010
|
-
sdkVersion: "1.
|
|
1013
|
+
sdkVersion: "1.70.0" ,
|
|
1011
1014
|
};
|
|
1012
1015
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1013
1016
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1026,17 +1029,21 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1026
1029
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1027
1030
|
if (conversionLabel) {
|
|
1028
1031
|
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1032
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1033
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1034
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1035
|
+
const sendUserData = isDataManager
|
|
1036
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1037
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1038
|
+
if (sendUserData && destination) {
|
|
1039
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1040
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1041
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1042
|
+
// when the session store has no identifiers.
|
|
1043
|
+
const userData = getUserData(destination);
|
|
1044
|
+
if (Object.keys(userData).length) {
|
|
1045
|
+
window.gtag('set', 'user_data', userData);
|
|
1046
|
+
}
|
|
1040
1047
|
}
|
|
1041
1048
|
const cartData = getCartData(manifestVariables, data);
|
|
1042
1049
|
const fireConversion = (isNewCustomer) => {
|