react-native-analytics-segment-io icon indicating copy to clipboard operation
react-native-analytics-segment-io copied to clipboard

Nested properties not tracked?

Open davidruisinger opened this issue 6 years ago • 0 comments

I'm following Segment's analytics spec for ecommerce (see: https://segment.com/docs/spec/ecommerce/v2/#order-completed). So I'm calling the track method with properties like this:

{
  order_id: '123',
  ...
  products: [{
    product_id: 'xyz',
    quantity: 1,
    price: 99,
  }],
}

When I log out the properties in Xcode via NSLog I see them coming in:

"order_id" = "123";
products =     (
            {
        price = 99;
        "product_id" = "xyz";
        quantity = 1;
    }
);

But in Segment all product props are missing...

[[SEGAnalytics sharedAnalytics] track:@"Order Completed", properties: @{
    @"order_id" : @"123",
    ...,
    @"products" : @[
        @{
        }
    ]
}];

I noticed when I rename product_id property to just product the property seems to go through so there seems to be some parsing issue of the properties in objective-c.

davidruisinger avatar May 09 '18 07:05 davidruisinger