Solved

In mixpanel-node IP is always 0 in query parameter

  • 19 March 2021
  • 1 reply
  • 29 views

In mixpanel-node IP is always set to 0 in query parameter and we are not able to change inside the code. Can anyone tell where we can update the IP as 1 by default to track our geo locations.

icon

Best answer by Rishi 8 April 2021, 00:25

Hi Santhosh! Sorry for the delay, I work on the Mixpanel Support team and would be happy to help out here. 

 

For the Mixpanel Node.js SDK to record IP you either need to pass the IP address in as an event property on the event or as a user property when setting a profile. I’ve provided samples of both below. Are you passing in the IP as properties and still not seeing geolocation data reflect in your project?

 

Event Sample: 

mixpanel.track('test event', {
distinct_id: 'unique_id',
ip: '127.0.0.1'});

User Profile Sample:

mixpanel.people.set('unique_id', {
$email: 'email@email.com'
}, {
$ip: '127.0.0.1'
});

 

View original

1 reply

Userlevel 1
Badge

Hi Santhosh! Sorry for the delay, I work on the Mixpanel Support team and would be happy to help out here. 

 

For the Mixpanel Node.js SDK to record IP you either need to pass the IP address in as an event property on the event or as a user property when setting a profile. I’ve provided samples of both below. Are you passing in the IP as properties and still not seeing geolocation data reflect in your project?

 

Event Sample: 

mixpanel.track('test event', {
distinct_id: 'unique_id',
ip: '127.0.0.1'});

User Profile Sample:

mixpanel.people.set('unique_id', {
$email: 'email@email.com'
}, {
$ip: '127.0.0.1'
});

 

Reply


Mixpanel