@blotoutio/providers-google-ads-clicks-sdk 1.69.2 → 1.70.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 +44 -12
- package/index.js +44 -12
- package/index.mjs +44 -12
- 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.1" ,
|
|
1013
1016
|
};
|
|
1014
1017
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1015
1018
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1017,7 +1020,18 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1017
1020
|
}
|
|
1018
1021
|
const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
|
|
1019
1022
|
(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
|
|
1020
|
-
|
|
1023
|
+
const isDataManager = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['apiVersion']) === '2';
|
|
1024
|
+
/*
|
|
1025
|
+
* v1 has to know gtag.js actually loaded. Google does no cross-source dedup
|
|
1026
|
+
* there, so the hybrid flow sends each conversion from one side only: the edge
|
|
1027
|
+
* skips its server conversion whenever isFired is true, and a queued event that
|
|
1028
|
+
* never flushed would be lost on both paths. v2 removes that reason — both
|
|
1029
|
+
* sides always send and Google dedups on transactionId — so we hand the event
|
|
1030
|
+
* to the gtag queue and let it flush whenever gtag.js arrives, rather than
|
|
1031
|
+
* dropping every conversion that lands while the script is still in flight.
|
|
1032
|
+
*/
|
|
1033
|
+
if (!shouldLoadSDK ||
|
|
1034
|
+
(!isDataManager && !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId]))) {
|
|
1021
1035
|
return result;
|
|
1022
1036
|
}
|
|
1023
1037
|
const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
|
|
@@ -1025,9 +1039,16 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1025
1039
|
sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
|
|
1026
1040
|
// Fire conversion event if loadSDK is enabled and conversion label exists
|
|
1027
1041
|
if ((manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1') {
|
|
1042
|
+
/*
|
|
1043
|
+
* No label means the row is mapped to an import-for-clicks conversion
|
|
1044
|
+
* action, which has no tag snippet and so nothing for gtag to send to. Those
|
|
1045
|
+
* rows are server-only by design (they are how a v1 server-only mapping
|
|
1046
|
+
* migrates to v2), so skip the browser conversion and leave the upload to
|
|
1047
|
+
* the edge. Dynamic remarketing above is keyed to the tag id, not a label,
|
|
1048
|
+
* and still fires.
|
|
1049
|
+
*/
|
|
1028
1050
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1029
1051
|
if (conversionLabel) {
|
|
1030
|
-
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1031
1052
|
/*
|
|
1032
1053
|
* On v2 the browser is the primary source of user data: Google now accepts
|
|
1033
1054
|
* user-provided data from the tag, Data Manager and the API at once, so
|
|
@@ -1035,10 +1056,21 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1035
1056
|
* handled by Consent Mode — `init` sets ad_user_data/ad_personalization
|
|
1036
1057
|
* from the user's consent, and gtag withholds user data when they're denied.
|
|
1037
1058
|
*/
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1059
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1060
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1061
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1062
|
+
const sendUserData = isDataManager
|
|
1063
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1064
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1065
|
+
if (sendUserData && destination) {
|
|
1066
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1067
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1068
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1069
|
+
// when the session store has no identifiers.
|
|
1070
|
+
const userData = getUserData(destination);
|
|
1071
|
+
if (Object.keys(userData).length) {
|
|
1072
|
+
window.gtag('set', 'user_data', userData);
|
|
1073
|
+
}
|
|
1042
1074
|
}
|
|
1043
1075
|
const cartData = getCartData(manifestVariables, data);
|
|
1044
1076
|
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.1" ,
|
|
1014
1017
|
};
|
|
1015
1018
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1016
1019
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1018,7 +1021,18 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
1018
1021
|
}
|
|
1019
1022
|
const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
|
|
1020
1023
|
(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
|
|
1021
|
-
|
|
1024
|
+
const isDataManager = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['apiVersion']) === '2';
|
|
1025
|
+
/*
|
|
1026
|
+
* v1 has to know gtag.js actually loaded. Google does no cross-source dedup
|
|
1027
|
+
* there, so the hybrid flow sends each conversion from one side only: the edge
|
|
1028
|
+
* skips its server conversion whenever isFired is true, and a queued event that
|
|
1029
|
+
* never flushed would be lost on both paths. v2 removes that reason — both
|
|
1030
|
+
* sides always send and Google dedups on transactionId — so we hand the event
|
|
1031
|
+
* to the gtag queue and let it flush whenever gtag.js arrives, rather than
|
|
1032
|
+
* dropping every conversion that lands while the script is still in flight.
|
|
1033
|
+
*/
|
|
1034
|
+
if (!shouldLoadSDK ||
|
|
1035
|
+
(!isDataManager && !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId]))) {
|
|
1022
1036
|
return result;
|
|
1023
1037
|
}
|
|
1024
1038
|
const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
|
|
@@ -1026,9 +1040,16 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
1026
1040
|
sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
|
|
1027
1041
|
// Fire conversion event if loadSDK is enabled and conversion label exists
|
|
1028
1042
|
if ((manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1') {
|
|
1043
|
+
/*
|
|
1044
|
+
* No label means the row is mapped to an import-for-clicks conversion
|
|
1045
|
+
* action, which has no tag snippet and so nothing for gtag to send to. Those
|
|
1046
|
+
* rows are server-only by design (they are how a v1 server-only mapping
|
|
1047
|
+
* migrates to v2), so skip the browser conversion and leave the upload to
|
|
1048
|
+
* the edge. Dynamic remarketing above is keyed to the tag id, not a label,
|
|
1049
|
+
* and still fires.
|
|
1050
|
+
*/
|
|
1029
1051
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1030
1052
|
if (conversionLabel) {
|
|
1031
|
-
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1032
1053
|
/*
|
|
1033
1054
|
* On v2 the browser is the primary source of user data: Google now accepts
|
|
1034
1055
|
* user-provided data from the tag, Data Manager and the API at once, so
|
|
@@ -1036,10 +1057,21 @@ var ProvidersGoogleAdsClicksSdk = (function () {
|
|
|
1036
1057
|
* handled by Consent Mode — `init` sets ad_user_data/ad_personalization
|
|
1037
1058
|
* from the user's consent, and gtag withholds user data when they're denied.
|
|
1038
1059
|
*/
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1060
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1061
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1062
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1063
|
+
const sendUserData = isDataManager
|
|
1064
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1065
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1066
|
+
if (sendUserData && destination) {
|
|
1067
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1068
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1069
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1070
|
+
// when the session store has no identifiers.
|
|
1071
|
+
const userData = getUserData(destination);
|
|
1072
|
+
if (Object.keys(userData).length) {
|
|
1073
|
+
window.gtag('set', 'user_data', userData);
|
|
1074
|
+
}
|
|
1043
1075
|
}
|
|
1044
1076
|
const cartData = getCartData(manifestVariables, data);
|
|
1045
1077
|
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.1" ,
|
|
1011
1014
|
};
|
|
1012
1015
|
const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
|
|
1013
1016
|
if (!eventName || !window.gtag || !tagId) {
|
|
@@ -1015,7 +1018,18 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1015
1018
|
}
|
|
1016
1019
|
const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
|
|
1017
1020
|
(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
|
|
1018
|
-
|
|
1021
|
+
const isDataManager = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['apiVersion']) === '2';
|
|
1022
|
+
/*
|
|
1023
|
+
* v1 has to know gtag.js actually loaded. Google does no cross-source dedup
|
|
1024
|
+
* there, so the hybrid flow sends each conversion from one side only: the edge
|
|
1025
|
+
* skips its server conversion whenever isFired is true, and a queued event that
|
|
1026
|
+
* never flushed would be lost on both paths. v2 removes that reason — both
|
|
1027
|
+
* sides always send and Google dedups on transactionId — so we hand the event
|
|
1028
|
+
* to the gtag queue and let it flush whenever gtag.js arrives, rather than
|
|
1029
|
+
* dropping every conversion that lands while the script is still in flight.
|
|
1030
|
+
*/
|
|
1031
|
+
if (!shouldLoadSDK ||
|
|
1032
|
+
(!isDataManager && !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId]))) {
|
|
1019
1033
|
return result;
|
|
1020
1034
|
}
|
|
1021
1035
|
const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
|
|
@@ -1023,9 +1037,16 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1023
1037
|
sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
|
|
1024
1038
|
// Fire conversion event if loadSDK is enabled and conversion label exists
|
|
1025
1039
|
if ((manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1') {
|
|
1040
|
+
/*
|
|
1041
|
+
* No label means the row is mapped to an import-for-clicks conversion
|
|
1042
|
+
* action, which has no tag snippet and so nothing for gtag to send to. Those
|
|
1043
|
+
* rows are server-only by design (they are how a v1 server-only mapping
|
|
1044
|
+
* migrates to v2), so skip the browser conversion and leave the upload to
|
|
1045
|
+
* the edge. Dynamic remarketing above is keyed to the tag id, not a label,
|
|
1046
|
+
* and still fires.
|
|
1047
|
+
*/
|
|
1026
1048
|
const conversionLabel = getConversionLabel(eventName, manifestVariables);
|
|
1027
1049
|
if (conversionLabel) {
|
|
1028
|
-
const isDataManager = manifestVariables['apiVersion'] === '2';
|
|
1029
1050
|
/*
|
|
1030
1051
|
* On v2 the browser is the primary source of user data: Google now accepts
|
|
1031
1052
|
* user-provided data from the tag, Data Manager and the API at once, so
|
|
@@ -1033,10 +1054,21 @@ const tag = ({ data, eventName, eventId, manifestVariables, destination, pageUrl
|
|
|
1033
1054
|
* handled by Consent Mode — `init` sets ad_user_data/ad_personalization
|
|
1034
1055
|
* from the user's consent, and gtag withholds user data when they're denied.
|
|
1035
1056
|
*/
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1057
|
+
// On unless a super admin turns it off for the channel — setting user data
|
|
1058
|
+
// here appears to cost the account's v1 conversion actions their enhanced
|
|
1059
|
+
// conversions coverage. v1 keeps following the customer's own EC setting.
|
|
1060
|
+
const sendUserData = isDataManager
|
|
1061
|
+
? manifestVariables['dataManagerEnhancedConversions'] !== '0'
|
|
1062
|
+
: manifestVariables['enhancedConversionsSetting'] === 'gtag';
|
|
1063
|
+
if (sendUserData && destination) {
|
|
1064
|
+
// Sending an empty object still marks the conversion as carrying
|
|
1065
|
+
// user-provided data, so Google counts it as eligible and then finds
|
|
1066
|
+
// nothing, which costs us enhanced conversions coverage. Stay quiet
|
|
1067
|
+
// when the session store has no identifiers.
|
|
1068
|
+
const userData = getUserData(destination);
|
|
1069
|
+
if (Object.keys(userData).length) {
|
|
1070
|
+
window.gtag('set', 'user_data', userData);
|
|
1071
|
+
}
|
|
1040
1072
|
}
|
|
1041
1073
|
const cartData = getCartData(manifestVariables, data);
|
|
1042
1074
|
const fireConversion = (isNewCustomer) => {
|