Skip to main content

How it works

The Location module captures location (with user consent) from your app and attaches it to a person’s profile in Zixflow. You can use this data for geo-aware messaging and audience segmentation with more accuracy than IP-based geolocation. When you identify a person, the SDK includes the latest location in the identify call. The SDK also sends a location update to the person’s activity timeline (ZIXFLOW Location Update), which you can use in campaigns and segments. To balance location updates with battery and data usage, the SDK limits location updates (at most once a day)—and only sends that update when the person has moved a meaningful distance since the last update. The SDK does not request location permission on its own—your app must handle the permission flow.

Add the dependency


Add permissions

Add location permissions to AndroidManifest.xml:

Request location permission


Initialize with location config

Add ModuleLocation to your ZixflowConfigBuilder. The trackingMode property controls how and when the SDK captures location.

Tracking modes

Using ModuleLocation() without a config uses MANUAL mode by default.

Location APIs

Access location services through the location module:
You can call these methods as often as you like. The SDK caches the latest coordinates for profile enrichment, but throttles outbound location updates so you do not overwhelm your workspace.

setLastKnownLocation

Pass coordinates from your app’s own location system. This does not require the SDK to manage location permissions—your app manages access independently.

requestLocationUpdate

Request a one-shot location from Play Services location APIs. Use this if your app does not have its own location system. Your app must request location permission before calling this method—the SDK will not prompt the user. If permission is denied or location services are disabled, the request is ignored (no crash).

Profile switch behavior

When you call Zixflow.instance().clearIdentify(), the SDK clears cached location data so one person’s location does not carry over to another profile. The next person you identify starts with a clean slate.