diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index 1ac60f967d0..0afbf302770 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -46,8 +46,8 @@ const createPropertiesForEcomEventFromWebhook = (message) => { */ const getAnonymousIdFromAttributes = async (event) => { let anonymousId = null; - const noteAttributes = event.note_attributes; - if (isDefinedAndNotNull(event) && isDefinedAndNotNull(noteAttributes)) { + if (isDefinedAndNotNull(event) && isDefinedAndNotNull(event.note_attributes)) { + const noteAttributes = event.note_attributes; const rudderAnonymousIdObject = noteAttributes.find( (attr) => attr.name === 'rudderAnonymousId', );