From 7ff286de1b50d69d3725b831edfa0eb06e995492 Mon Sep 17 00:00:00 2001 From: Katie Noonan Date: Mon, 29 Mar 2021 12:18:14 -0600 Subject: [PATCH 1/4] Clarify Segment<>Iterable ecommerce connection Per this ticket: https://segment.zendesk.com/agent/tickets/420194, our docs are pretty unclear on exactly what Iterable requires for the ecommerce events we map for customers. Based on https://github.com/segmentio/integrations/blob/master/integrations/iterable/lib/index.js#L163-L206 and https://github.com/segmentio/integrations/blob/master/integrations/iterable/lib/mapper.js, we pretty much just send the `products` array we are given to Iterable, but turns out, the endpoints we hit requires some basic fields in each product object: https://api.iterable.com/api/docs#commerce_trackPurchase and https://api.iterable.com/api/docs#commerce_updateCart. I tried to clarify these requirements better for less confusion in the future. --- src/connections/destinations/catalog/iterable/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/destinations/catalog/iterable/index.md b/src/connections/destinations/catalog/iterable/index.md index 93b63b18e8..c99f14d158 100644 --- a/src/connections/destinations/catalog/iterable/index.md +++ b/src/connections/destinations/catalog/iterable/index.md @@ -67,7 +67,7 @@ Subsequent `track` with `userId` Iterable also supports Segment's [ecommerce events](/docs/connections/spec/ecommerce/v2/). This works just as you would expect, using the `track` method. -There is one important difference from the Segment documentation. If you are using the `Product Added` / `Product Removed` events, you must also pass along the "products" field with the cart info, just like Segment's example for the `Order Completed` event. You must include all required fields for the Purchase events in Iterable, which includes the total value of the purchase with the property: `total`. This value works best as a float, double, and possibly an integer. An example might look like this: +There is one important difference from the Segment documentation. If you are using the `Product Added` / `Product Removed`/ `Order Completed` events, you must also pass along the "products" field with the cart info, just like Segment's example for the `Order Completed` event. You must include all required fields for the Purchase events in Iterable (see their [docs](https://api.iterable.com/api/docs#commerce_trackPurchase) for more info): an array of objects called `products` that includes an `id` or `productId` as a string, `name`, `price`, and `quantity` on each product object in the array which will be used to map to Iterable's expected `items` array, and the total value of the purchase: `total`. This value works best as a float, double, and possibly an integer. An example might look like this: ```js analytics.track("Order Completed", { From f8a8cdbe8b83c6c9fc4e8b3651c13191040206bc Mon Sep 17 00:00:00 2001 From: Katie Noonan Date: Wed, 31 Mar 2021 11:50:40 -0600 Subject: [PATCH 2/4] Update src/connections/destinations/catalog/iterable/index.md Co-authored-by: LRubin --- src/connections/destinations/catalog/iterable/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/destinations/catalog/iterable/index.md b/src/connections/destinations/catalog/iterable/index.md index c99f14d158..4b642cd4c5 100644 --- a/src/connections/destinations/catalog/iterable/index.md +++ b/src/connections/destinations/catalog/iterable/index.md @@ -67,7 +67,7 @@ Subsequent `track` with `userId` Iterable also supports Segment's [ecommerce events](/docs/connections/spec/ecommerce/v2/). This works just as you would expect, using the `track` method. -There is one important difference from the Segment documentation. If you are using the `Product Added` / `Product Removed`/ `Order Completed` events, you must also pass along the "products" field with the cart info, just like Segment's example for the `Order Completed` event. You must include all required fields for the Purchase events in Iterable (see their [docs](https://api.iterable.com/api/docs#commerce_trackPurchase) for more info): an array of objects called `products` that includes an `id` or `productId` as a string, `name`, `price`, and `quantity` on each product object in the array which will be used to map to Iterable's expected `items` array, and the total value of the purchase: `total`. This value works best as a float, double, and possibly an integer. An example might look like this: +Iterable has one important difference from the Segment Ecommerce spec. If you use the `Product Added` / `Product Removed`/ `Order Completed` events, you must include the "products" field with the cart info, as in the `Order Completed` example event. You must include [all required fields for the Purchase events in Iterable](https://api.iterable.com/api/docs#commerce_trackPurchase). This includes the total value of the purchase as `total` (best as a float, double, and possibly an integer), and an array of objects called `products`. Each product must include an `id` or `productId` as a string, `name`, `price`, and a `quantity` on each product object in the array, which is used to map to Iterable's expected `items` array. An example might look like this: ```js analytics.track("Order Completed", { From bd2f92e9cdeacbb58173ea652803557daf9d4870 Mon Sep 17 00:00:00 2001 From: Katie Noonan Date: Wed, 31 Mar 2021 11:52:56 -0600 Subject: [PATCH 3/4] Expanding "Order Completed" example event --- .../destinations/catalog/iterable/index.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/connections/destinations/catalog/iterable/index.md b/src/connections/destinations/catalog/iterable/index.md index 4b642cd4c5..b87fcc03de 100644 --- a/src/connections/destinations/catalog/iterable/index.md +++ b/src/connections/destinations/catalog/iterable/index.md @@ -71,7 +71,21 @@ Iterable has one important difference from the Segment Ecommerce spec. If you us ```js analytics.track("Order Completed", { - total: 100.00 + total: 100.00, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + price: 19, + quantity: 1 + }, + { + product_id: '505bd76785ebb509fc183733', + name: 'Uno Card Game', + price: 3, + quantity: 2 + } + ] }); ``` From b1accf9e7ebdfafd5ba4717d72a5a4a570765198 Mon Sep 17 00:00:00 2001 From: LRubin Date: Wed, 7 Apr 2021 15:49:35 -0700 Subject: [PATCH 4/4] Update src/connections/destinations/catalog/iterable/index.md --- src/connections/destinations/catalog/iterable/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/destinations/catalog/iterable/index.md b/src/connections/destinations/catalog/iterable/index.md index b87fcc03de..6826f93610 100644 --- a/src/connections/destinations/catalog/iterable/index.md +++ b/src/connections/destinations/catalog/iterable/index.md @@ -67,7 +67,7 @@ Subsequent `track` with `userId` Iterable also supports Segment's [ecommerce events](/docs/connections/spec/ecommerce/v2/). This works just as you would expect, using the `track` method. -Iterable has one important difference from the Segment Ecommerce spec. If you use the `Product Added` / `Product Removed`/ `Order Completed` events, you must include the "products" field with the cart info, as in the `Order Completed` example event. You must include [all required fields for the Purchase events in Iterable](https://api.iterable.com/api/docs#commerce_trackPurchase). This includes the total value of the purchase as `total` (best as a float, double, and possibly an integer), and an array of objects called `products`. Each product must include an `id` or `productId` as a string, `name`, `price`, and a `quantity` on each product object in the array, which is used to map to Iterable's expected `items` array. An example might look like this: +Iterable has one important difference from the Segment Ecommerce spec. If you use the `Product Added` / `Product Removed`/ `Order Completed` events, you must include the "products" field with the cart info, as in the `Order Completed` example event. You must include [all required fields for the Purchase events in Iterable](https://api.iterable.com/api/docs#commerce_trackPurchase). This includes the total value of the purchase as `total` (best as a float, double, and possibly an integer), and an array of objects called `products`. Each product must include an `id` or `productId` as a string, and a `name`, `price`, and `quantity` on each product object in the array. These are used to map to Iterable's expected `items` array. An example might look like this: ```js analytics.track("Order Completed", {