segment-boneyard / integration-amplitude

Amplitude server-side integration
segment.com
MIT License
4 stars 7 forks source link

update platform value #10

Closed djih closed 8 years ago

djih commented 8 years ago

This PR addresses https://github.com/segmentio/integration-amplitude/issues/9. Sometimes we will see events with platform = 'analytics-ruby', or 'analytics-php', and we expect values like 'iOS', 'Web', or 'Android'. Following suggestions from @f2prateek, we map the segment library to a platform, or fallback on the device / os. Also sometimes Segment's values are all lowercase (like device type), so I added another layer of sanitization to format the values.

f2prateek commented 8 years ago

I think we should update the test for the 3 important cases - iOS/Android/Web. LGTM otherwise!

djih commented 8 years ago

Updated the tests, PTAL @f2prateek thanks!

djih commented 8 years ago

@f2prateek @sperand-io can you guys release the new platform logic? Thanks!