Skip to content

Support for geolocation and library version property

Compare
Choose a tag to compare
@tdumitrescu tdumitrescu released this 02 Jun 22:57
· 25 commits to master since this release

The configuration option geolocate can be used to take advantage of Mixpanel's automatic geolocation properties (converting the source IP address into properties for country/region/city). This is generally useful when the NodeJS SDK is used in a client application, such as an Electron app or IoT device; whereas in a server application (e.g. an Express application server), the IP address will be that of the server rather than the user. To turn on geolocation, initialize the library with geolocate: true:

const mixpanel = Mixpanel.init('<YOUR_TOKEN>', {
  geolocate: true,
});

The SDK also now sends the current library version as a property with every event, like Mixpanel's other SDKs.