mixpanel/mixpanel-js

`register` for a single instance

Opened this issue · 1 comments

I want to add some common properties to all uses of "track". But I have several Mixpanel instances on the same page, and when I call the register function from one instance, it attaches the custom property to all instances.

Based on that comment/issue I've tried the following:

Example:

const project1 = mixpanel.init('token', { some: 'config' }, 'project1');
const project2 = mixpanel.init('token2', { some: 'config' }, 'project2');

project1.register({ some: 'property' });

project1.track('some event');
project2.track('other event');

When I look at the Mixpanel logs, I see the some: 'property' in both track events instead of just in the project1 track.
Is it possible to register custom properties to just one single instance?

Hmm sounds like a bug. Calling register on one instance should not affect any others.