diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0e09ac0f..0ee4007dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.54.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.54.3...v1.54.4) (2024-01-31) + + +### Bug Fixes + +* purchsse events for reddit ([56d24ec](https://github.com/rudderlabs/rudder-transformer/commit/56d24ec74c0c21bcdcdf262b4feec6edd1dff51c)) + ### [1.54.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.54.2...v1.54.3) (2024-01-30) diff --git a/package-lock.json b/package-lock.json index fe1874f679..e690e650c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index d5b58745a1..98640af1e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { diff --git a/src/cdk/v2/destinations/reddit/procWorkflow.yaml b/src/cdk/v2/destinations/reddit/procWorkflow.yaml index 65b466bc7c..e6c05ef86d 100644 --- a/src/cdk/v2/destinations/reddit/procWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/procWorkflow.yaml @@ -56,13 +56,13 @@ steps: const event_type = (eventNames.length === 0 || eventNames[0]==="") ? ({"tracking_type": "Custom", "custom_event_name": event}): ({tracking_type: eventNames[0]}); - name: customFields - condition: $.outputs.eventType.tracking_type === "Purchase" + condition: $.outputs.prepareTrackPayload.eventType.tracking_type === "Purchase" template: | const customFields = .message.().({ "currency": .properties.currency, - "value": .properties.revenue !== undefined ? Number(.properties.revenue) : undefined, + "value_decimal": .properties.revenue !== undefined ? Number(.properties.revenue) : undefined, "item_count": (Array.isArray(.properties.products) && .properties.products.length) || (.properties.itemCount && Number(.properties.itemCount)), - "value_decimal": .properties.revenue !== undefined ? Number(.properties.revenue)/100 : undefined, + "value": .properties.revenue !== undefined ? Number(.properties.revenue)*100 : undefined, "conversion_id": .properties.conversionId || .messageId, }); $.removeUndefinedAndNullValues(customFields) diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts index 91da5fbe67..f3cd4ebf7b 100644 --- a/test/integrations/destinations/reddit/processor/data.ts +++ b/test/integrations/destinations/reddit/processor/data.ts @@ -126,7 +126,10 @@ export const data = [ screen_dimensions: {}, }, event_metadata: { - item_count: 3, + item_count: 2, + currency: 'USD', + value: 1500, + value_decimal: 15, products: [ { id: '123', diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts index 2f96e27ef7..723afff374 100644 --- a/test/integrations/destinations/reddit/router/data.ts +++ b/test/integrations/destinations/reddit/router/data.ts @@ -205,7 +205,10 @@ export const data = [ screen_dimensions: {}, }, event_metadata: { - item_count: 3, + item_count: 2, + currency: 'USD', + value: 1500, + value_decimal: 15, products: [ { id: '123', name: 'Monopoly', category: 'Games' }, { id: '345', name: 'UNO', category: 'Games' },