Skip to content

Commit

Permalink
mixpanel bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc committed Jul 26, 2021
1 parent 8ed9027 commit 3cb93b4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions integrations/Mixpanel/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,20 @@ class Mixpanel {
const { message } = rudderElement;
const eventIncrements = parseConfigArray(this.eventIncrements, "property");
const propIncrements = parseConfigArray(this.propIncrements, "property");
const event = get(message, "event.event");
const event = get(message, "event");
const revenue =
get(message, "event.properties.revenue") ||
get(message, "properties.total");
get(message, "properties.revenue") || get(message, "properties.total");
const sourceName = this.sourceName;
let props = get(message, "event.properties");
props = inverseObjectArrays(props);
if (sourceName) props.rudderstack_source_name = sourceName;
let props = get(message, "properties");
if (isNotEmpty(props)) {
props = inverseObjectArrays(props);
}
if (sourceName) {
props = { ...props };
props.rudderstack_source_name = sourceName;
}

// delete mixpanel's reserved properties, so they don't conflict
// delete mixpanel's reserved prosperties, so they don't conflict
delete props.distinct_id;
delete props.ip;
delete props.mp_name_tag;
Expand Down

0 comments on commit 3cb93b4

Please sign in to comment.