mixpanel / mixpanel-android

Official Android Tracking Library for Mixpanel Analytics
http://mixpanel.com/
Apache License 2.0
1.02k stars 365 forks source link

MPConfig.UseIpAddressForGeolocation ignored when also using MPConfig.EventsEndpoint #772

Closed jensbostrom closed 2 years ago

jensbostrom commented 2 years ago

I'm required to use EU endpoints and have done as described here: https://developer.mixpanel.com/docs/android#eu-data-residency

I'm also required to disable ip collection for geo location and have done as described here: https://help.mixpanel.com/hc/en-us/articles/115004494803-Disable-Geolocation-Collection

When I do a test run with my app I can still see the City and Country for my event. I have looked at the source code and MPConfig.UseIpAddressForGeolocation seems to be used only if the MPConfig.EventsEndpoint isn't present. See code below.

        String eventsEndpoint = metaData.getString("com.mixpanel.android.MPConfig.EventsEndpoint");
        if (eventsEndpoint != null) {
            setEventsEndpoint(eventsEndpoint);
        } else {
            setEventsEndpointWithBaseURL(MPConstants.URL.MIXPANEL_API);
        }

setEventsEndpoint doesn't call the getter for MPConfig.UseIpAddressForGeolocation but setEventsEndpointWithBaseURL does.

My workaround is setting ip=0 instead of ip=1 for MPConfig.EventsEndpoint in the AndroidManifest and it seems to work!

zihejia commented 2 years ago

hi @jensbostrom , we will fix it.

georgekeenan commented 2 years ago

I’m seeing the same issue. Setting ip=0 seems to stop tracking altogether for me though.

This issue is quite serious as it affects the validity of our privacy documents. Can we get an idea of when there will be a fix?

jensbostrom commented 2 years ago

I’m seeing the same issue. Setting ip=0 seems to stop tracking altogether for me though.

This issue is quite serious as it affects the validity of our privacy documents. Can we get an idea of when there will be a fix?

Strange, it works for me. I'm using version 6.0.0 at the moment.

zihejia commented 2 years ago

hi @jensbostrom @georgekeenan , we have released 6.1.0 which contains the fix. I'm closing this one now, please feel free to reopen if the problem still exists.