From 8e02b8311f28d0bda6744e5a836fc948a4a8aa02 Mon Sep 17 00:00:00 2001 From: Mo Mustafa Date: Mon, 20 Nov 2023 10:08:51 -0800 Subject: [PATCH 1/3] fix:add check and replace warn instead of error for setCustomNameStandardization --- packages/GA4Client/src/common.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/GA4Client/src/common.js b/packages/GA4Client/src/common.js index bf8ff43..6008f63 100644 --- a/packages/GA4Client/src/common.js +++ b/packages/GA4Client/src/common.js @@ -132,13 +132,15 @@ Common.prototype.standardizeParameters = function (parameters) { }; Common.prototype.standardizeName = function (name) { - try { - name = window.GoogleAnalytics4Kit.setCustomNameStandardization(name); - } catch (e) { - console.error( - 'Error calling setCustomNameStandardization callback. Check your callback. Data will still be sent without user-defined standardization. See our docs for proper use - https://docs.mparticle.com/integrations/google-analytics-4/event/', - e - ); + if (window.GoogleAnalytics4Kit.setCustomNameStandardization(name)) { + try { + name = window.GoogleAnalytics4Kit.setCustomNameStandardization(name); + } catch (e) { + console.warn( + 'Error calling setCustomNameStandardization callback. Check your callback. Data will still be sent without user-defined standardization. See our docs for proper use - https://docs.mparticle.com/integrations/google-analytics-4/event/', + e + ); + } } // names of events and parameters have the following requirements: From a49f107b69772e0a3590fbeb807bd3eee12cef20 Mon Sep 17 00:00:00 2001 From: Mo Mustafa Date: Mon, 20 Nov 2023 10:55:32 -0800 Subject: [PATCH 2/3] fix:add check and replace warn instead of error for setCustomNameStandardization --- packages/GA4Client/src/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/GA4Client/src/common.js b/packages/GA4Client/src/common.js index 6008f63..10db44c 100644 --- a/packages/GA4Client/src/common.js +++ b/packages/GA4Client/src/common.js @@ -132,7 +132,7 @@ Common.prototype.standardizeParameters = function (parameters) { }; Common.prototype.standardizeName = function (name) { - if (window.GoogleAnalytics4Kit.setCustomNameStandardization(name)) { + if (window.GoogleAnalytics4Kit.hasOwnProperty(setCustomNameStandardization)) { try { name = window.GoogleAnalytics4Kit.setCustomNameStandardization(name); } catch (e) { From 123e0410af5627dc9300641ea1106f0423963153 Mon Sep 17 00:00:00 2001 From: Mo Mustafa Date: Mon, 20 Nov 2023 13:22:08 -0800 Subject: [PATCH 3/3] fix:add check and replace warn instead of error for setCustomNameStandardization --- packages/GA4Client/src/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/GA4Client/src/common.js b/packages/GA4Client/src/common.js index 10db44c..ad3b236 100644 --- a/packages/GA4Client/src/common.js +++ b/packages/GA4Client/src/common.js @@ -132,7 +132,7 @@ Common.prototype.standardizeParameters = function (parameters) { }; Common.prototype.standardizeName = function (name) { - if (window.GoogleAnalytics4Kit.hasOwnProperty(setCustomNameStandardization)) { + if (window.GoogleAnalytics4Kit.hasOwnProperty('setCustomNameStandardization')) { try { name = window.GoogleAnalytics4Kit.setCustomNameStandardization(name); } catch (e) {