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

Issue with People Identify in controller after signup/sign in #57

Closed jeremybdk closed 11 years ago

jeremybdk commented 11 years ago

Hi,

I am trying to track actions, everything work fine using javascript but I have an issue with the gem. I would like to identify my user actions in the controller So I added in my devise controller after resource.save these line but could not figure the syntax to identify the user ....

mixpanel.set resource.id, { :created => resource.created_at, :name => resource.full_name, :age => resource.age, :adult => resource.adult? , :id => resource.id,:email => resource.email }

mixpanel.append_people_identify(resource.id)

mixpanel.track 'User Created and People Identified', { :email => resource.email, :name => resource.full_name } I might be doing something wrong somewhere but don't know what, I also tried with mixpanel.append_identify but same issue, it won't identify the user, the user is created on mixpanel, the action tracked but the user is not identifed

Thanks in advance for your help

zevarito commented 11 years ago

On Tue, Dec 4, 2012 at 4:11 PM, Jeremy Bod notifications@github.com wrote:

Hi,

I am trying to track actions, everything work fine using javascript but I have an issue with the gem. I would like to identify my user actions in the controller So I added in my devise controller after resource.save these line but could not figure the syntax to identify the user ....

mixpanel.set resource.id, { :created => resource.created_at, :name => resource.full_name, :age => resource.age, :adult => resource.adult? , :id => resource.id,:email => resource.email }

mixpanel.append_people_identify(resource.id)

Isn't enough to call mixpanel.set from the backend ?

mixpanel.track 'User Created and People Identified', { :email => resource.email, :name => resource.full_name } I might be doing something wrong somewhere but don't know what, I also tried with mixpanel.append_identify but same issue, it won't identify the user, the user is created on mixpanel, the action tracked but the user is not identifed

Thanks in advance for your help

— Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/57.

Alvaro

jeremybdk commented 11 years ago

No it's not working for me but woks fine with js...

On 4 d?c. 2012, at 19:22, "Alvaro Gil" notifications@github.com<mailto:notifications@github.com> wrote:

On Tue, Dec 4, 2012 at 4:11 PM, Jeremy Bod notifications@github.com<mailto:notifications@github.com> wrote:

Hi,

I am trying to track actions, everything work fine using javascript but I have an issue with the gem. I would like to identify my user actions in the controller So I added in my devise controller after resource.save these line but could not figure the syntax to identify the user ....

mixpanel.set resource.id, { :created => resource.created_at, :name => resource.full_name, :age => resource.age, :adult => resource.adult? , :id => resource.id,:email => resource.email }

mixpanel.append_people_identify(resource.id)

Isn't enough to call mixpanel.set from the backend ?

mixpanel.track 'User Created and People Identified', { :email => resource.email, :name => resource.full_name } I might be doing something wrong somewhere but don't know what, I also tried with mixpanel.append_identify but same issue, it won't identify the user, the user is created on mixpanel, the action tracked but the user is not identifed

Thanks in advance for your help

Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/57.

Alvaro

Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/57#issuecomment-11008576.

jeremybdk commented 11 years ago

I have done some more testing but still canot get it working. Using JS i can identify the user created with the gem. But I cannot identify an user using the gem ...

zevarito commented 11 years ago

what version of the Gem are you using?

On Tue, Dec 4, 2012 at 8:11 PM, Jeremy Bod notifications@github.com wrote:

I have done some more testing but still canot get it working. Using JS i can identify the user created with the gem. But I cannot identify an user using the gem ...

— Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/57#issuecomment-11018051.

Alvaro

jeremybdk commented 11 years ago

I am using version 3.1.0, is that ok ?

Thanks for your support ...

zevarito commented 11 years ago

On Wed, Dec 5, 2012 at 7:19 AM, Jeremy Bod notifications@github.com wrote:

I am using version 3.1.0, is that ok ?

Yep, that is the latest one.

Honestly I am not sure what can be happening, I am not using that feature my self. I know that there were people using it, and nobody have reported a bug yet.

I need to find time to set up a new project and find out if it is working. Tests at least are passing.

Meanwhile, I suggest you to debug what says the requests that are hitting mixpanel when you set properties. May be that could help.

Also please share a Gist or something showing the exactly code you are using, how are you initializing the lib etc.

Thanks for your support ...

You welcome, sorry I couldn't be more helpful.

— Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/57#issuecomment-11034572.

Alvaro

jeremybdk commented 11 years ago

Well actually I think I have found the issue ... mixpanel.track 'User Created and People Identified', { :email => resource.email, :distinct_id => resource.id , :name => resource.full_name }

mixpanel.set resource.id, { :created => resource.created_at, :name => resource.full_name, :age => resource.age, :adult => resource.adult? , :id => resource.id,:email => resource.email }

I was not tracking using disctinct_id so that was the issue ! Thanks for your help !