Skip to content

Commit

Permalink
chore: address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip committed Dec 3, 2024
1 parent 019da3a commit 4d8e27b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 4d8e27b

Please sign in to comment.