Skip to content

Commit 524257d

Browse files
authored
fix: fix product Id to match ecommerce spec (#803)
Co-authored-by: Alan Charles <[email protected]>
1 parent 12241e9 commit 524257d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/plugins/plugin-braze/src/methods/__tests__/track.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ describe('#track', () => {
245245
revenue: '399.99',
246246
products: [
247247
{
248-
productId: '123',
248+
product_id: '123',
249249
price: '399.99',
250250
quantity: 4,
251251
},

packages/plugins/plugin-braze/src/methods/track.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export default (payload: TrackEventType) => {
4242

4343
products.forEach((product) => {
4444
const productDict = Object.assign({}, product);
45-
const productId = productDict.productId;
45+
const productId = productDict.product_id;
4646
const productRevenue = extractRevenue(productDict, 'price');
4747
const productQuantity = productDict.quantity;
48-
delete productDict.productId;
48+
delete productDict.product_id;
4949
delete productDict.price;
5050
delete productDict.quantity;
5151
let productProperties = Object.assign(

0 commit comments

Comments
 (0)