Giter VIP home page Giter VIP logo

posthog-plugin-geoip's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

posthog-plugin-geoip's Issues

Same day, same user, different IPs

I was doing some testing in PostHog that involves IP addresses, and noticed that my location was indicated as San Francisco (when it should be New York).

Some events on PostHog also had an IP address that was not my own. (There are at least 2 other IPs besides my own home address). I would also be surprised if these were "hops" on my ISP because I would assume that based on my physical location, I would be connected to a server in N. Virginia or similar.

No proxies or VPNs that I know of are configured on my network.

Bug: subdivisions edge case

There is an edge case in which because there's a variable amount of subdivision information for a given IP/country, GeoIP data is stored inconsistently. Given that we only override GeoIP attributes if there are new attributes, consider this very typical flow:

  1. User connects from the US (where at least subdivision 1 is available).
  2. User connects from KE (where no subdivision information is available).

The user will then have a profile that looks like this, which is wrong:

  • Country Name: Kenya
  • City Name: Nairobi
  • Subdivision 1 Code: VA
  • Subdivision 1 Name: Virginia

We should probably override all GeoIP attributes when the country/city changes.

Dump GeoIP data by event name or other property

I've got segment as a library sending events into PostHog, but not all libraries within segment are created equal and server events are firing with fixed American IP address (we're in Australia), giving me questionable data in PostHog.

I'd like to enable GeoIP for strictly either a fixed set of events, or a sub-library of segment. Maybe if PostHog ingested Segment library as an object then I could enable client, and drop server.

In general this plugin is fantastic but somewhat unusable if half of the sources are getting 'wrong' information.

Doesn't work when setting "Discard client IP data"

Due to the GDPR I use the setting "Discard client IP data". However, I am not getting any results from the plugin.

Not sure if it would be possible to discard the client IP after the plugin fetched the geoip?

Set these properties on users

Would be nice to set these properties on the user as well as on events (at least country/city etc) so you can create cohorts based on location.

Skip Geolocation and/or Custom IP override

It would be great if we can opt-out of GeoIP classification on an as-needed basis. In our use case, we record some events from the browser side (Posthog JS) and some events from our server side (Posthog Ruby). All server-side events end up appearing from Ashburn, Virginia (eg: AWS us-east-1) and we are unable to prevent the data from being tainted for the Person profiles. I think it would be great if the following could be added:

  • Guard clause to skip GeoIP lookup if the $geoip_enabled event property is set to false $geoip_disable event property is set to true.
  • Attempt to lookup the IP to geolocate based on the $ip property and fallback to event.ip if IP address is not explicitly set.

[Feature Request] Support IPinfo MMDB databases

Hi PostHog team,

I am the DevRel of IPinfo, an IP data company. I have some experience with Posthog and tried to implement the feature myself, but I think the scale is just too big.

We have users who have reached out to us about using IPinfo MMDB databases in an analytics platform. The problem is that we do not have any off-the-shelf solutions to support this request. We would like to request that Posthog support the MMDB reader functionality and data update mechanism as a solution for IPinfo.

Our database is in MMDB format and is tabular in nature. While the existing provider's data is unpredictable and nested in nature, our data is tabular with a clear structure. We return an empty string when a value is not present. The MMDB reader library will work perfectly with our data. Additionally, our data can be updated via the storage URI, which accepts the access token as a parameter.

Users requested database support for:

If you can cover only one database, we can reuse the code to write for the rest of our databases.

The documentation of the IP databases is available here:

You can find the sample MMDB databases here: https://github.com/ipinfo/sample-database

Please let me know what you think. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.