segment-integrations / analytics.js-integration-kissmetrics

The Kissmetrics analytics.js integration.
https://segment.com/docs/integrations/kissmetrics/
MIT License
0 stars 2 forks source link

send products and revenue like server side int #20

Closed hankim813 closed 8 years ago

hankim813 commented 8 years ago

This resolves https://github.com/segment-integrations/analytics.js-integration-kissmetrics/issues/12

This PR will replicate the mapping behavior that is present on the server side.

issue: the revenue property is not being appended as Billing Amount like it is for server side. We are also superfluously sending products array even though we iterate through it and make individual and separate requests for each product in the array. Server side omits the products array from the first call to record the actual Completed Order. We will do the same for client side. Kissmetrics doesn't parse nested objects so they are seen in the UI as [object Object][object Object].

solution: map revenue property as Billing Amount. Won't remove it as its own revenue property albeit duplicative, since it would break reports. Remove products property from the first call that records the top level transaction event since we already send product info later.

@f2prateek @ladanazita

codecov-io commented 8 years ago

Current coverage is 98.48% (diff: 100%)

Merging #20 into master will increase coverage by 0.05%

@@             master        #20   diff @@
==========================================
  Files             1          1          
  Lines           127        132     +5   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            125        130     +5   
  Misses            2          2          
  Partials          0          0          

Powered by Codecov. Last update 7579298...20c5d06

f2prateek commented 8 years ago

LGTM