diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index 05525b4..79ab1af 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -534,6 +534,11 @@ - (MPKitExecStatus *)routeCommerceEvent:(MPCommerceEvent *)commerceEvent { } } + NSDictionary *commerceCustomAttribues = [commerceEvent.customAttributes transformValuesToString]; + for (NSString *key in commerceCustomAttribues) { + baseProductAttributes[key] = commerceCustomAttribues[key]; + } + NSArray *products = commerceEvent.products; NSString *currency = commerceEvent.currency ? : @"USD"; NSMutableDictionary *properties; diff --git a/mParticle_AppboyTests/mParticle_AppboyTests.m b/mParticle_AppboyTests/mParticle_AppboyTests.m index dde3bcb..0e1cd34 100644 --- a/mParticle_AppboyTests/mParticle_AppboyTests.m +++ b/mParticle_AppboyTests/mParticle_AppboyTests.m @@ -667,7 +667,8 @@ - (void)testlogPurchaseCommerceEvent { @"Tax Amount" : @3, @"Transaction Id" : @"foo-transaction-id", @"Name" : @"product1", - @"Category" : @"category1" + @"Category" : @"category1", + @"testKey" : @"testCustomAttValue" }]; MPKitExecStatus *execStatus = [kit logBaseEvent:event]; @@ -715,7 +716,8 @@ - (void)testlogPurchaseCommerceEventSendingProductName { @"Tax Amount" : @3, @"Transaction Id" : @"foo-transaction-id", @"Name" : @"product1", - @"Category" : @"category1" + @"Category" : @"category1", + @"testKey" : @"testCustomAttValue" }]; MPKitExecStatus *execStatus = [kit logBaseEvent:event];