Set up geofences

When someone enters or exits a physical location with your app, geofences let you trigger a journey, update a segment, or send a message.

Geofences help you meet your customers where they are—literally. Send retail and Quick Service Restaurant (QSR) promotions, travel information, parking reminders, venue welcome messages, or delivery notifications based on people’s locations.

How it works

A geofence is a virtual boundary you draw around a real-world place—like a store, gym, airport, or parking lot. A geofence can be a circle around a point or a polygon that follows a custom boundary. When someone with your app on their phone crosses that boundary, the SDK sends a Geofence Transition event. Customer.io records it as a Geofence activity that you can use to trigger an automation, create a segment, or control the flow of people’s journeys.

A pin appears on a map that matches the address.

You group geofences into geofence sets. A geofence set lets you treat many geofences as one target, so an automation or segment can act on all of them at once. For example, you might group all of your stores into a geofence set, and trigger an automation when a person enters any of the geofences in the set.

You create geofences in your workspace. Then our mobile SDKs detect when someone crosses one and they send the event back to Customer.io.

flowchart LR subgraph cio [Customer.io workspace] A[Create<br>geofence] end subgraph mobile [Mobile app] B[SDK syncs<br>geofence list] C[OS reports<br>geofence activity] D[SDK verifies if needed<br>and sends event] B --> C C --> D end subgraph cio2 [Customer.io workspace] E[Event tracked<br>on person's<br>activity log] end A --> B D --> E style cio fill:#e1f5fe,stroke:#01579b,stroke-width:2px style cio2 fill:#e1f5fe,stroke:#01579b,stroke-width:2px style mobile fill:#fff3e0,stroke:#e65100,stroke-width:2px

Geofence boundary detection happens on the device. When the SDK refreshes nearby geofences, it sends the device’s current coordinates without identifying the person. The transition event for the person does not include precise coordinates.

Geofence transitions are not instantaneous. Detection and delivery time varies with the operating system, device movement, location accuracy, background restrictions, and network availability. Many events arrive within tens of seconds, but delivery can take several minutes. Polygon transitions can take longer when the SDK needs to recover from a missed operating-system callback.

Choose a circle or polygon

Use a circle when a center point and radius describe the location well. Mobile operating systems monitor circular geofences directly, making them more reliable and less battery-intensive than polygons.

Use a polygon when you need the boundary to follow the shape of a campus, venue, parking area, or other property. Polygons must be convex and meet the other polygon requirements. Mobile operating systems only monitor circles, so the SDK uses the polygon’s enclosing circle as a wake-up boundary and takes additional location readings to check movement into or out of the polygon boundary. Depending on the platform and device state, these checks can happen after an operating-system wake, when the app returns to the foreground, or as part of a recovery check. They may use more battery. Background restrictions and location accuracy can also delay polygon detection or cause missed enter and exit events.

The SDK setup and Geofence Transition event are the same for both shapes. Polygon monitoring does not continuously track a person’s location, and transition events never include their precise coordinates.

Polygon support starts with Android SDK 4.22.0, iOS SDK 4.9.0, React Native 6.13.0, Flutter 4.7.0, and Expo plugin 3.11.0 with React Native 6.13.0. Older SDK versions continue to monitor circles, but they don’t receive polygons.

Refer to the mobile SDK documentation for version requirements, location permissions, and more.

Location permissions

Geofences depend on a permission your customers grant in your app: background location—Always on iOS, Allow all the time on Android. Without it, the device detects crossings only while your app is open in the foreground, so you miss most of them. People rarely have your app open at the moment they walk into a store.

Your app asks for that permission; our SDKs never prompt on their own. Neither platform grants background location in a single tap, so this is worth planning with your mobile team before you build automations around geofences—your reach depends on how many people grant it. Each mobile SDK guide covers the permissions to declare and how to stage the request.

Geofencing uses background location for background detection, not just for polygons. Polygon monitoring can use additional location readings while your app is in the background because mobile operating systems don’t report polygon transitions directly. iOS and Android may show people a system reminder that your app has used, or can access, their location in the background. The operating system controls the wording and timing of these reminders, so make sure your permission messaging clearly explains why your app needs background location.

Create a geofence set

In your workflows, you can add conditions for geofence sets, not individual geofences. So when you create geofences, first consider if you want to take action on them collectively. If not, that’s a signal to create multiple geofence sets to separate your geofences into.

Every geofence belongs to a geofence set. You either add a geofence to an existing set or create a geofence set followed by a geofence.

Under Configure data in the lefthand menu, go to Geofences, and then click Create a new geofence set. You only need to give it a name, but make sure it’s easy to understand so you can find it when creating automations, segments, and conditions.

After you create a geofence set, you can either import multiple geofences—names, boundaries, and any custom metadata—or add them manually.

Import multiple geofences

To import multiple geofences, first create a geofence set. Then create either a GeoJSON file or CSV file with the required fields. You can import up to 10,000 geofences per geofence set, and the file must be less than 32 MB. GeoJSON files, including GeoJSONL files, can contain circles, polygons, or both. CSV files only support circles.

  1. Select a geofence set.
  2. Click Import.
  3. Upload a GeoJSON or CSV file.
  4. Decide how to run the import:
  5. Click Import files.

You can preview the geofences after importing.

GeoJSON

GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). You can learn about the spec through the IETF and validate your spec before import at geojson.io.

This example contains a circular geofence and a polygon geofence:

JSON
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "hq-sf",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -122.4194,
          37.7749
        ]
      },
      "properties": {
        "name": "HQ",
        "radius": 250,
        "promo_code": "HQ10"
      }
    },
    {
      "type": "Feature",
      "id": "campus-sf",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [-122.394, 37.794],
            [-122.39, 37.794],
            [-122.39, 37.798],
            [-122.394, 37.798],
            [-122.394, 37.794]
          ]
        ]
      },
      "properties": {
        "name": "Campus",
        "promo_code": "CAMPUS10"
      }
    }
  ]
}

The following fields are required unless noted otherwise:

FieldDescription
typeMust be “FeatureCollection”
featuresAn array of objects, where each object is a geofence
features.typeMust be “Feature”
features.idA unique identifier for the feature; if you leave this blank, Customer.io generates a UUID
features.geometryAn object with a type and coordinates
features.geometry.typeUse Point for a circle or Polygon for a polygon. You can’t use other geometry types, including MultiPolygon.
features.geometry.coordinatesFor a circle, use [<longitude>, <latitude>]. For a polygon, use one array of coordinate pairs that meets the polygon requirements.
features.propertiesAn object with a name and any additional custom properties you want to store with the geofence. Circles also require a radius.
features.properties.nameThe name of your geofence
features.properties.radiusRequired for circles. Integer representing the radius in meters, from 100–10,000. Remove this property from polygons; otherwise, validation rejects the feature. Customer.io calculates the enclosing circle from the polygon boundary.
features.properties.<custom>(Optional) Any additional properties—like a location ID, category, or deeplink slug—are stored as the geofence’s attributes. Use GeoJSON if you want to import metadata alongside your geofences; the CSV format doesn’t support custom fields.

Importing metadata

To import metadata with your geofences, add your own keys to each feature’s properties object. Customer.io stores those custom properties as geofence attributes. For polygons, don’t add latitude, longitude, or radius to properties; validation rejects a polygon that contains any of those reserved properties. The CSV format only supports the fixed columns below, so use GeoJSON when you need custom metadata.

You can also upload a GeoJSONL file (.geojsonl), which puts one Feature object on each line instead of wrapping features in a FeatureCollection. Each line uses the same features.* fields as the preceding table. When you export a geofence set, Customer.io writes the export in this format, so you can edit an export and import it again without converting it.

CSV

To import multiple geofences from a CSV file, create a CSV file with these fields. All fields are required except where noted:

FieldDescription
nameThe name of your geofence
radiusInteger. Represents radius in meters. Must be within 100–10,000.
longitudeThe longitude of your geofence
latitudeThe latitude of your geofence
external_id(Optional) A unique identifier for the feature; if you leave this blank, Customer.io generates a UUID

From the import UI, you can download a CSV template to help you create your file.

Polygon requirements

Whether you draw a polygon in Customer.io or import it with GeoJSON, it must meet these requirements:

  • Use one boundary with 3–500 points.
  • Use a convex shape. The boundary can’t turn inward or include a cut-out, such as an L or T shape. To exclude a building at the corner of a larger area, use two rectangular geofences to cover the remaining space. Customer.io tracks each rectangle as a separate geofence.
  • Don’t use holes, crossing edges, or duplicate adjacent points.
  • The enclosing radius of the polygon must be no smaller than 100 meters and no larger than 10 kilometers.
  • Keep every point between -85° and 85° latitude, and don’t draw a polygon across the 180° longitude line.

For GeoJSON imports, you must also:

  • Close the boundary by repeating its first point at the end. The repeated closing point does not count toward the 500-point limit.
  • Start each coordinate with longitude followed by latitude. Customer.io ignores additional numeric values such as altitude, but rejects non-numeric values.
  • Remove latitude, longitude, and radius from the feature’s properties. Customer.io calculates the center and enclosing circle from the polygon boundary.

If a GeoJSON file contains at least one polygon, every feature in the file must be valid before you can import it.

Polygons must be convex

Mobile operating systems don’t report polygon crossings, so the SDK works out for itself which side of the boundary a person is on. Each location reading comes with an accuracy radius: how far off the real position might be. A reading that lands within that distance of the boundary could belong on either side, so it’s less reliable than one that lands well inside or well outside.

Concave shapes have pockets of outside space that reach into the boundary. The U below is an extreme example, but any inward turn creates a smaller pocket. A reading in a narrow pocket can land near both walls, and it can be tough to determine whether someone is in or out of the boundary. Because these pockets make detection less reliable, Customer.io only supports convex polygons for now.

Convex boundary

Uncertainty stays in a thin strip along the edge, and a straight walk across the inside never crosses the boundary.

Concave boundary

A gap that reaches into the shape puts a reading near two walls at once, and the same walk leaves the boundary and comes back.

location reading accuracy radius someone walking past too close to the edge to be sure

Create a geofence manually

To create a geofence through the UI, first create a geofence set.

  1. Select your geofence set.
  2. Click Create geofence.
  3. Choose Circle or Polygon for the shape.
  4. Define the boundary:
    • For a circle, search for the place, business, or address, or select Coordinates to specify a longitude and latitude. Then set the Radius in meters.
    • For a polygon, find the area on the map and draw its boundary. The boundary must meet the polygon requirements.
    A pin appears on a map that matches the address.
  5. Add a Name to easily identify your geofence and use it across your workflows.
  6. (Optional) Add an identifier; otherwise, your workspace generates one for you.

Sync shared geofences across geofence sets

You can share a geofence across geofence sets so the same physical location stays in sync across your sets.

For example, imagine you have two geofence sets, one is for grocery stores and another is for convenience stores. Sometimes a grocery store is also a convenience store so you create a geofence around the same store in both sets. You tie them together by giving them the same ID. If later you update the radius of the geofence, every geofence that shares that ID updates to match the new settings.

To share a geofence with another set, import it into that set using the same external_id. Customer.io keeps one fence record, so later edits apply everywhere it’s used. For example, if you update the geofence, like its radius, in the UI, that updates the radius across geofence sets.

Use geofences in your workflows

You can use geofences in a variety of ways:

Track geofence events

When people move in or out of your geofences, Customer.io logs Geofence Enter and Geofence Exit in your activity logs. Filter for the behavioral event type Geofence to see all geofence transitions in your workspace.

A geofence enter event with the payload expanded.

Each event carries the geofence_id of the geofence boundary that was crossed and the geoset_id that the geofence belongs to. The activities do not send back exact coordinates of your customers, only data for the geofence they crossed.

A geofence enter or exit event fires when a person enters or exits any geofence within a geofence set. However, keep the following in mind:

  • Geofence transitions are not instantaneous. Detection and delivery time varies with the operating system, device movement, location accuracy, background restrictions, and network availability. Many events arrive within tens of seconds, but delivery can take several minutes. Polygon transitions can take longer when the SDK needs to recover from a missed operating-system callback.
  • There is a cool down period of 1 hour. This means if a person enters, exits, then re-enters the same geofence within an hour, the SDKs only send one geofence enter event.

Report on geofence events

You can export geofence events through data warehouse syncs. They come with the Events schema in your export files with type = geofence.

Geofence events don’t currently come with destination actions in other data out integrations.

Export a list of geofences

You can export geofence metadata by going to a geofence set and clicking Export.

Edit a geofence in use

When you edit geofences in use in your workspace—as an automation trigger, segment condition, or wait until condition—changes reach devices on their next SDK refresh. Depending on the platform and the device’s current location, a geometry change may produce a transition after it is applied.

For example, if you expand the radius of a geofence that’s part of an automation trigger, the automation could suddenly trigger for more people in the area. Similarly, if you shrink the radius, people could suddenly exit the automation.

You can filter for automations triggered by geofences from the Automations page.

Delete a geofence in use

You can’t delete a geofence set in use; you first have to remove it from any automation or segment that uses it.

However, you can delete individual geofences from a geofence set that’s in use. Deleting a geofence does not trigger a geofence transition event, which is what causes people to enter or exit automations. Deleting a geofence does not log a Geofence Exited event for the person.

So if you have an automation triggered by entering a geofence set and then deleted one of its geofences, people who entered the geofence initially would not exit the automation, even if the exit condition was “Exited Geofence Set”.

Current limitations

The following are not part of the initial release. Reach out to product@customer.io with your use case if you want to request a feature.

  • Duplicating polygon geofences in the workspace
  • Dwell-time triggers (time spent inside a region)
  • Import of address-to-coordinate geocoding (This is available when creating geofences in the UI, just not through bulk import.)
  • Scheduling based on time of day
  • A/B testing for geofence triggers
  • Anonymous profiles

Troubleshooting

To troubleshoot issues with geofences, like entrances and exits not triggering as you’d expect, start with the SDK docs. Missing background location permission is the most common reason transitions don’t arrive:

Updated September 25, 2026