Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Mixpanel name_tag should prefer using email over user ID #60

Merged
merged 2 commits into from
Jan 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1921,4 +1921,4 @@ analytics.addProvider('Vero', {
window._veroq.push(['track', event, properties]);
}

});
});
4 changes: 2 additions & 2 deletions src/providers/mixpanel/mixpanel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

spy.reset();
analytics.identify(userId, traits);
expect(spy.calledWith(userId)).to.be(true);
expect(spy.calledWith(traits.email)).to.be(true);

spy.restore();
});
Expand Down Expand Up @@ -176,4 +176,4 @@
spy.restore();
});

}());
}());
2 changes: 1 addition & 1 deletion src/providers/mixpanel/mixpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ analytics.addProvider('Mixpanel', {
// against settings to make sure they're enabled.
if (userId) {
window.mixpanel.identify(userId);
if (this.settings.nameTag) window.mixpanel.name_tag(userId);
if (this.settings.nameTag) window.mixpanel.name_tag(traits && traits.$email || userId);
}
if (traits) {
window.mixpanel.register(traits);
Expand Down