Closed EtienneDepaulis closed 11 years ago
Are you deploying in Heroku?
If that is the case, you should use request.env['HTTP_X_FORWARDED_FOR'] instead.
Thanks for this answer, I'm going to try Cheers
Hi @zevarito,
I'm using:
mixpanel.track 'New free user', {:distinct_id => current_user.email, ip: request.env['HTTP_X_FORWARDED_FOR']}
mixpanel.set({distinct_id: current_user.email, ip: request.env['HTTP_X_FORWARDED_FOR']}, {created_at: current_user.created_at, email: current_user.email})
But it's still not working :s Any idea ? Thx
@EtienneDepaulis maybe you can try this alternative:
mixpanel.set(distinct_id, {:attribute_1 => 'x', :attribute_2 => 'y'}, { "$ip".to_sym => request.env['HTTP_X_FORWARDED_FOR'] } )
This works for me. Try it!
@EtienneDepaulis I'm doing it your way and it's working for me
@client.set { distinct_id: user.id, ip: user.ip}, { email: user.email }
I'm also having this same problem. I'm using Heroku. Even when I call mixpanel.set from the console and pass in the right IP address, the location is still set to Ashburn, VA (where Heroku is hosted on AWS).
Hello,
I'm sending various events and setting certain variable but none of those actions seems to send properly the IP adress in order for Mixpanel to geolocate my users.
Here is the code i'm using:
In application_controller:
then in my registration controller:
Any help on that matter ? Cheers