segment-integrations / analytics-ios-integration-firebase

Segment's bundled integration for Firebase on iOS
MIT License
13 stars 92 forks source link

Add promotion viewed event #46

Closed niallzato closed 4 years ago

niallzato commented 5 years ago

Description: The mapping for the Promotion viewed event is currently not tracked, despite listed in the docs: https://segment.com/docs/destinations/firebase/#event-mappings

Pr to track kFIREventPresentOffer https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Constants#/c:FIREventNames.h@kFIREventPresentOffer

briemcnally commented 4 years ago

I end to end tested this solution with a test application.

Test event:


[[SEGAnalytics sharedAnalytics] track:@"Promotion Viewed"
                               properties: @{
                                              @"product_id" : @"507f1f77bcf86cd799439011",
                                              @"category" : @"Games",
                                              @"name" : @"Monopoly 3rd Edition",
                                              @"price" : @18.99,
                                              @"quantity" : @1,
                                              @"currency" : @"usd",
                                              }];

Expected Outcome: "Promotion Viewed" event will be mapped to present_offer Actual Outcome seen in DebugView in Google Firebase Console: image