zevarito / mixpanel

Simple lib to track events in Mixpanel service. It can be used in any rack based framework.
MIT License
273 stars 84 forks source link

Visitor always identified as Guest #104

Closed felipeclopes closed 11 years ago

felipeclopes commented 11 years ago

Hello, I'm trying to setup the mixpanel, up to now, the only thing I could set up successfully was the tracking events, that are all working.

Now I want to add some information regarding the user legged in, but i am not being successful.

    #Works well
    MixPanel.track("Sign In", {:distinct_id => user.id}, @request_env)
    #Do not set the name of the user in mixpanel
    MixPanel.instance(@request_env).append "name_tag", user.username
    #Do not set the name of the user in mixpanel
    MixPanel.instance(@request_env).set user.id, {:name => user.username, :email => user.email}

I do not know if this is the correct approach, but can you give me a guide on how to do it?

Regards,

psynix commented 11 years ago

Ran into the same issue yesterday. Solved it by setting the 'name' property instead of 'name_tag' eg.:

mixpanel.append_set(:name => user.username)

Hope that helps.