{"action":"created","issue":{"url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/599","labels_url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/599/labels{/name}","comments_url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/599/comments","events_url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/599/events","html_url":"https://github.com/segmentio/analytics.js-integrations/pull/599","id":70514914,"number":599,"title":"Fix/send traits to mixpanel people","user":{"login":"lambtron","id":1080190,"avatar_url":"https://avatars.githubusercontent.com/u/1080190?v=3","gravatar_id":"","url":"https://api.github.com/users/lambtron","html_url":"https://github.com/lambtron","followers_url":"https://api.github.com/users/lambtron/followers","following_url":"https://api.github.com/users/lambtron/following{/other_user}","gists_url":"https://api.github.com/users/lambtron/gists{/gist_id}","starred_url":"https://api.github.com/users/lambtron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambtron/subscriptions","organizations_url":"https://api.github.com/users/lambtron/orgs","repos_url":"https://api.github.com/users/lambtron/repos","events_url":"https://api.github.com/users/lambtron/events{/privacy}","received_events_url":"https://api.github.com/users/lambtron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-23T21:15:37Z","updated_at":"2015-04-28T21:01:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/segmentio/analytics.js-integrations/pulls/599","html_url":"https://github.com/segmentio/analytics.js-integrations/pull/599","diff_url":"https://github.com/segmentio/analytics.js-integrations/pull/599.diff","patch_url":"https://github.com/segmentio/analytics.js-integrations/pull/599.patch"},"body":"Uncovered an unusual bug with Mixpanel with @DirtyAnalytics:\r\nhttp://screencast.com/t/VOqoVfipBAHj\r\n\r\nBasically, `.identify()`, then `.alias(userId)`, then `.identify(userId)` will create duplicate profiles in Mixpanel.\r\n\r\nWe are sending `traits` to mixpanel people even without a `userId`:\r\nhttps://github.com/segmentio/analytics.js-integrations/blob/master/lib/mixpanel/index.js#L143\r\n\r\nThis PR now requires `userId` in order to set `traits` to Mixpanel. However, this PR will also break many people's current client side segment/mixpanel integrations, even though this is the right way. if someone is calling `.identify()` without `userId` it creates a people profile in Mixpanel. but now it won't. its possible someone is using that way.\r\n\r\n/cc @amillet89 @sperand-io \r\n\r\nRelated ticket: https://segment.zendesk.com/agent/tickets/27509"},"comment":{"url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/comments/97205693","html_url":"https://github.com/segmentio/analytics.js-integrations/pull/599#issuecomment-97205693","issue_url":"https://api.github.com/repos/segmentio/analytics.js-integrations/issues/599","id":97205693,"user":{"login":"hadees","id":15341,"avatar_url":"https://avatars.githubusercontent.com/u/15341?v=3","gravatar_id":"","url":"https://api.github.com/users/hadees","html_url":"https://github.com/hadees","followers_url":"https://api.github.com/users/hadees/followers","following_url":"https://api.github.com/users/hadees/following{/other_user}","gists_url":"https://api.github.com/users/hadees/gists{/gist_id}","starred_url":"https://api.github.com/users/hadees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadees/subscriptions","organizations_url":"https://api.github.com/users/hadees/orgs","repos_url":"https://api.github.com/users/hadees/repos","events_url":"https://api.github.com/users/hadees/events{/privacy}","received_events_url":"https://api.github.com/users/hadees/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T21:01:42Z","updated_at":"2015-04-28T21:01:42Z","body":"@lambtron are you sure the aliasing isn't causing the duplicate profiles?  There is a known race condition with aliasing and mixpanel.  I've run into it myself.  \r\n\r\nI'm pretty sure your change will break our implementation although it's kind of a hack on our side.  At my company we are purposely identifying mixpanel using their javascript library but letting segment continue thinking the users are anonymous.  This allows us to track semi anonymous users in mixpanel without polluting our other services, like intercom, with our semi anonymous users.\r\n\r\nMaybe this could be a config option?"}}