From 4d8e27b9064860182e025310507aab834cfb625d Mon Sep 17 00:00:00 2001 From: ItsSudip Date: Tue, 3 Dec 2024 10:09:19 +0530 Subject: [PATCH] chore: address comment --- .../destinations/google_adwords_offline_conversions/utils.js | 4 +++- .../google_adwords_offline_conversions/utils.test.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 2243e50bff..a4edee7636 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -361,7 +361,9 @@ const getClickConversionPayloadAndEndpoint = ( set(payload, 'conversions[0].userIdentifiers[0].userIdentifierSource', UserIdentifierSource); // one of email or phone must be provided when none of gclid, wbraid and gbraid provided if (!email && !phone && !(gclid || wbraid || gbraid)) { - throw new InstrumentationError(`Either of email or phone is required for user identifier`); + throw new InstrumentationError( + `Either an email address or a phone number is required for user identification when none of gclid, wbraid, or gbraid is provided.`, + ); } } // we are deleting userIdentifiers if any one of gclid, wbraid and gbraid is there but email or phone is not present diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js index 2d1863413c..b6c6653782 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js @@ -244,7 +244,9 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { }; expect(() => getClickConversionPayloadAndEndpoint(fittingPayload, config, '9625812972'), - ).toThrow('Either of email or phone is required for user identifier'); + ).toThrow( + 'Either an email address or a phone number is required for user identification when none of gclid, wbraid, or gbraid is provided.', + ); }); it('finaliseConsent', () => {