segmentio/analytics.js-integrations

Mixpanel Integration Group Properties can't be overwritten due to .set_once() call

rpatel05 opened this issue · 0 comments

if (traits && Object.keys(traits).length) {
for (var ind = 0; ind < groupIdentifierTraits.length; ind++) {
window.mixpanel
.get_group(groupIdentifierTraits[ind], groupId)
.set_once(traits);
}
}

Mixpanel integration Group properties call is passed in as set_once(traits) making it so that group props can never be overwritten if the value changes. Suggest changing it to a .set(traits) call or I know a Segment team member considered adding a toggle such as:

if (useSetInGroupCalls === true) {
        window.mixpanel
        .get_group(groupIdentifierTraits[ind], groupId)
        .set(traits);
} else {
      window.mixpanel
        .get_group(groupIdentifierTraits[ind], groupId)
        .set_once(traits);
}