diff --git a/integrations/klaviyo/lib/index.js b/integrations/klaviyo/lib/index.js index 262dd9221..33b60bb21 100644 --- a/integrations/klaviyo/lib/index.js +++ b/integrations/klaviyo/lib/index.js @@ -217,7 +217,8 @@ function formatItems(track) { ProductCategories: [product.category()], ProductURL: product.proxy('properties.productUrl'), ImageURL: product.proxy('properties.imageUrl'), - SKU: product.sku() + SKU: product.sku(), + ProductID: product.productId() || product.id() }); // ensure unique $event_id is associated with each Ordered Product event by combining Order Completed diff --git a/integrations/klaviyo/test/index.test.js b/integrations/klaviyo/test/index.test.js index 72c21607a..c51239fcc 100644 --- a/integrations/klaviyo/test/index.test.js +++ b/integrations/klaviyo/test/index.test.js @@ -322,12 +322,13 @@ describe('Klaviyo', function() { ProductCategories: ['Games'], ProductURL: 'http://www.example.com/path/to/product', ImageURL: 'http://www.example.com/path/to/product/image.png', - SKU: '45790-32' + SKU: '45790-32', + ProductID: '507f1f77bcf86cd799439011' } ]); }); - it('should have the correct $event_id for Ordered Product if id passed as product_id', function() { + it('should have correct $event_id for Ordered Product if id passed as product_id', function() { analytics.track('Completed Order', { order_id: '50314b8e9bcf000000000000', total: 30, @@ -362,7 +363,8 @@ describe('Klaviyo', function() { ProductCategories: ['Games'], ProductURL: 'http://www.example.com/path/to/product', ImageURL: 'http://www.example.com/path/to/product/image.png', - SKU: '45790-32' + SKU: '45790-32', + ProductID: '507f1f77bcf86cd799439011' } ]); });