Comments (5)
@ttmdung203 The SDK does not send geolocation info. When useIPAddressForGeoLocation
is true
the server will use the IP address to add geo info to the event after it is received. Make sure you're not manually setting a city property anywhere in your code. For further assistance please reach out to [email protected]
from mixpanel-swift.
I set useIPAddressForGeoLocation = false
immediately as you see at below code, there's no manual city parameters for sure.
mixpanelInstance = Mixpanel.initialize(token: token, trackAutomaticEvents: true)
mixpanelInstance.delegate = self
mixpanelInstance.useIPAddressForGeoLocation = false
It happens randomly, I was looking into source code and found that there is a chance of flushing events immediately right after Mixpanel.initialize
, before I set delegate
and useIPAddressForGeoLocation
. (Version: 4.2.0)
init(apiToken: String?, flushInterval: Double, name: String, trackAutomaticEvents: Bool, optOutTrackingByDefault: Bool = false,
useUniqueDistinctId: Bool = false, superProperties: Properties? = nil,
serverURL: String? = nil) {
....
....
flushInstance.flushInterval = flushInterval
}
from mixpanel-swift.
@jaredmixpanel for visibility.
from mixpanel-swift.
@ttmdung203 That's not the correct way to initialize and use the Mixpanel instance. You don't need to store the instance. You should always use the shared instance provided by Mixpanel.mainInstance()
:
Mixpanel.initialize(token: token, trackAutomaticEvents: true)
Mixpanel.mainInstance().delegate = self
Mixpanel.mainInstance().useIPAddressForGeoLocation = false
...
Mixpanel.mainInstance().track(event: "My Event")
Try that and let me know if it makes a difference.
from mixpanel-swift.
Thanks for your quick response, @jaredmixpanel
I've just tried the way you suggested, the city sometimes is sent to Mixpanel when I open app.
Reproduce steps:
- Open app and open some screens (to track screen viewed event), then close and open app again (to flush events automatically).
- Repeat it until seeing the city in mixpanel. (It happens ~5-10% the time I do above steps).
Mixpanel.initialize(token: token, trackAutomaticEvents: true)
Mixpanel.mainInstance().useIPAddressForGeoLocation = false
Mixpanel.mainInstance().delegate = self
...
Mixpanel.mainInstance().track(event: "Event name")
```
from mixpanel-swift.
Related Issues (20)
- Support Privacy Manifest HOT 10
- -[NSProcessInfo isiOSAppOnMac]: unrecognized selector sent to instance
- Crash in unregisterSuperProperty and currentSuperProperties HOT 1
- Does Mixpanel Work with SwiftUI Widgets?
- MIxpanel in widget extension crashed
- Crashes with DecideRequest HOT 2
- No PrivacyInfo.xcprivacy as of v4.2.2 HOT 1
- Any support of Privacy Manifest? HOT 4
- Is the mixpanel_flutter package using the latest (4.2.4) Mixpanel-swift pod? HOT 1
- 'MixpanelType' is not a member type of class 'Mixpanel.Mixpanel' HOT 2
- Hang risk detected in Mixpanel Library
- Request in Swift Mixpanel XCFramework HOT 1
- Remove automatic Integration event (has also been removed at the android library) HOT 1
- EXC_BAD_ACCESS when starting app HOT 1
- Data loss in Mixpanel-Swift when used in mixed Project
- Event timestamps are tracked in seconds, not milliseconds HOT 1
- Block default swift properties HOT 1
- Would it be possible to have fine-grained controls on the geolocation tracking, to only include country for example? HOT 1
- Overriding Mixpanel Default Properties HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mixpanel-swift.