diff --git a/src/v1/sources/shopify/pixelTransform.js b/src/v1/sources/shopify/pixelTransform.js index 836d05abfa..4ad262708e 100644 --- a/src/v1/sources/shopify/pixelTransform.js +++ b/src/v1/sources/shopify/pixelTransform.js @@ -60,7 +60,7 @@ function extractCartToken(inputEvent) { } /** - * Handles storing cart token and anonymousId (clientId) in Redis, and updating the event with the anonymousId + * Handles storing cart token and anonymousId (clientId) in Redis * @param {Object} inputEvent * @param {String} clientId */ @@ -74,7 +74,6 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { writeKey: inputEvent.query_parameters.writeKey, }); } - inputEvent.anonymousId = clientId; } catch (error) { logger.error(`Error handling Redis operations for event: ${inputEvent.name}`, error); stats.increment('shopify_pixel_cart_token_redis_error', { diff --git a/src/v1/sources/shopify/pixelTransform.redisCartToken.test.js b/src/v1/sources/shopify/pixelTransform.redisCartToken.test.js index 0a4543932c..8f54efc373 100644 --- a/src/v1/sources/shopify/pixelTransform.redisCartToken.test.js +++ b/src/v1/sources/shopify/pixelTransform.redisCartToken.test.js @@ -71,28 +71,6 @@ describe('handleCartTokenRedisOperations', () => { jest.clearAllMocks(); }); - it('should set anonymousId in Redis and increment stats', async () => { - const inputEvent = { - name: 'cart_viewed', - properties: { - cart_id: '/checkout/cn/1234', - }, - query_parameters: { - writeKey: 'testWriteKey', - }, - }; - const clientId = 'testClientId'; - - await handleCartTokenRedisOperations(inputEvent, clientId); - - expect(RedisDB.setVal).toHaveBeenCalledWith('1234', ['anonymousId', clientId]); - expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_cart_token_set', { - event: 'cart_viewed', - writeKey: 'testWriteKey', - }); - expect(inputEvent.anonymousId).toBe(clientId); - }); - it('should handle undefined or null cart token gracefully', async () => { const inputEvent = { name: 'unknownEvent',