sparkartgroup-archive / sparkart.js

Easily interact with Sparkart's APIs via Javascript.
1 stars 0 forks source link

[#inlf0SKo] Identify Mixpanel Users #55

Closed djiang closed 11 years ago

djiang commented 11 years ago

Branch: inlf0SKo-identify-mixpanel-users Issue: https://github.com/SparkartGroupInc/sparkart.js/issues/52

Timo614 commented 11 years ago

Sounds good -- I'm not really knowledgable on the mixpanel API but the logic here is consistent with the logic in the issue.

  1. If the customer is logged in track the customer and clear the distinct id
  2. Else set the distinct id

@pushred do you know of a way to test the distinct id logic? I haven't been following this work too closely so not really sure on the best way to confirm the existing bug has been fixed.

pushred commented 11 years ago

You mean in a unit test or manually?

We discovered this issue when looking at members who were logged in before they entered checkout to renew or upgrade a membership. The issue resulted in their new orders being attributed to a new distinct_id rather than their customer ID that we passed Mixpanel when originally creating their customer profile there.

So could use one of the Mixpanel development accounts to track on a test site manually. Just invited you & David to the site I setup for load testing, it's got all the widgets setup so you could just drop in this new version of sparkart.js and an API key for a fanclub with the dev account token.

djiang commented 11 years ago

Rebasing... then I'll drop in new version. It'll have to point to my machine for the latest version of sparkart-services

djiang commented 11 years ago

Should be all set up with my local machine. Production will be missing one endpoint, clear_distinct_id. That is for explicitly clearing the mixpanel_distinct_id from the session and consequently, disabling the call to Mixpanel.alias

I don't think you guys can properly test this as it is currently set up.

Timo614 commented 11 years ago

Yeah the code looks fine to me when I quickly took a look over. Sounds good re: it working on your machine. I figured it may be a bit difficult to set this up locally. If everything looks good on your end from testing it in that case I'd say it's probably safe.

jameslovejoy commented 11 years ago

Code looks good :thumbsup: