@@ -116,14 +116,14 @@ - (MPKitExecStatus *)routeCommerceEvent:(MPCommerceEvent *)commerceEvent {
116
116
eventName = kFIREventViewPromotion ;
117
117
}
118
118
for (MPPromotion *promotion in commerceEvent.promotionContainer .promotions ) {
119
- parameters = [self getParameterForPromotionCommerceEvent : promotion];
119
+ parameters = [self getParameterForPromotion : promotion commerceEvent: commerceEvent ];
120
120
121
121
[FIRAnalytics logEventWithName: eventName parameters: parameters];
122
122
}
123
123
} else if (commerceEvent.impressions ) {
124
124
eventName = kFIREventViewItemList ;
125
125
for (NSString *impressionKey in commerceEvent.impressions ) {
126
- parameters = [self getParameterForImpressionCommerceEvent : impressionKey products: commerceEvent.impressions[impressionKey]];
126
+ parameters = [self getParameterForImpression : impressionKey commerceEvent: commerceEvent products: commerceEvent.impressions[impressionKey]];
127
127
128
128
[FIRAnalytics logEventWithName: eventName parameters: parameters];
129
129
}
@@ -365,8 +365,9 @@ - (NSString *)getEventNameForCommerceEvent:(MPCommerceEvent *)commerceEvent para
365
365
}
366
366
}
367
367
368
- - (NSDictionary <NSString *, id> *)getParameterForPromotionCommerceEvent : (MPPromotion *)promotion {
369
- NSMutableDictionary <NSString *, id > *parameters = [[NSMutableDictionary alloc ] init ];
368
+ - (NSDictionary <NSString *, id> *)getParameterForPromotion : (MPPromotion *)promotion commerceEvent : (MPCommerceEvent *)commerceEvent {
369
+ NSMutableDictionary <NSString *, id > *parameters = [[self standardizeValues: commerceEvent.customAttributes forEvent: YES ] mutableCopy ];
370
+
370
371
371
372
if (promotion.promotionId ) {
372
373
[parameters setObject: promotion.promotionId forKey: kFIRParameterPromotionID ];
@@ -384,8 +385,8 @@ - (NSString *)getEventNameForCommerceEvent:(MPCommerceEvent *)commerceEvent para
384
385
return parameters;
385
386
}
386
387
387
- - (NSDictionary <NSString *, id> *)getParameterForImpressionCommerceEvent : (NSString *)impressionKey products : (NSSet <MPProduct *> *)products {
388
- NSMutableDictionary <NSString *, id > *parameters = [[NSMutableDictionary alloc ] init ];
388
+ - (NSDictionary <NSString *, id> *)getParameterForImpression : (NSString *)impressionKey commerceEvent : (MPCommerceEvent *) commerceEvent products : (NSSet <MPProduct *> *)products {
389
+ NSMutableDictionary <NSString *, id > *parameters = [[self standardizeValues: commerceEvent.customAttributes forEvent: YES ] mutableCopy ];
389
390
390
391
[parameters setObject: impressionKey forKey: kFIRParameterItemListID ];
391
392
[parameters setObject: impressionKey forKey: kFIRParameterItemListName ];
@@ -423,7 +424,7 @@ - (NSString *)getEventNameForCommerceEvent:(MPCommerceEvent *)commerceEvent para
423
424
}
424
425
425
426
- (NSDictionary <NSString *, id> *)getParameterForCommerceEvent : (MPCommerceEvent *)commerceEvent {
426
- NSMutableDictionary <NSString *, id > *parameters = [[NSMutableDictionary alloc ] init ];
427
+ NSMutableDictionary <NSString *, id > *parameters = [[self standardizeValues: commerceEvent.customAttributes forEvent: YES ] mutableCopy ];
427
428
428
429
NSMutableArray *itemArray = [[NSMutableArray alloc ] init ];
429
430
for (MPProduct *product in commerceEvent.products ) {
0 commit comments