Geofences represent custom regions or places monitored in your mobile app project. Depending on your use case, a geofence might represent a retail store, a neighborhood, and so on.
Cloud4Wi geofencing is more powerful than native iOS or Android geofencing, with cross-platform support for unlimited geofences.
Geofences allow to track the following events:
- a user enter in a geofence (
geo-arriving
) - a user dwell in a geofence (
geo-dwell
) - a user exits a geofence (
geo-leave
)
You can receive events server-side via webhooks or by leveraging Cloud4Wi Connectors
You can create geofences via the dashboard, via CSV import or via APIs (coming soon)
How it works
Geofencing works in the foreground and in the background. Event tracking happens on the client side. Cloud4Wi Location SDK syncs with each app instance the list of relevant geofences to track nearby the user location and keeps it synchronized in an effective way as the mobile user change position.
For stationary users, not moving more than 10km per day, the Location SDK still refreshes the list of geofences to track at least once per day. If you create a new geofence, it won't be distributed right away to stationary users, so you need to wait not more than 24 hours to start seeing geofencing events
Cloud4Wi generates a geofence entry event if a user enters a geofence, stops in a geofence (if dwell time is configured) with sufficient confidence, then a geofence exit event when the user leaves the geofence with sufficient confidence. A device must exit a geofence before a subsequent entry into that same geofence.
Create geofences
You can create geofences via the dashboard, CSV import, and in the future via API (still in internal beta).
You specify the metadata for geofences when you create them, including the tag (a group for the geofence, e.g., store
), external ID (an external ID for the geofence that maps to your internal database, e.g., 123
), and description (a display name for the geofence, e.g., Store #123
).
Geofences should be uniquely referenced by tag and external ID, assigned by you when a geofence is created. To disable or update metadata for a geofence, re-import the geofence with the same tag and external ID.
Dashboard
To create a geofence via the dashboard, go to the Geofences page and click the New button. Enter a Name description, tag, external ID, and optional metadata. Enter a value, in minutes, for the Dwell time if you want to also track the event of a user dwelling a certain time in the geofence.
Choose circle to create a circle geofence. (Polygon geofences are in roadmap).
Click Create to create the geofence.
CSV import
To create geofences via CSV import, go to the Geofences page and click the Import from file option on the New button.
The Import geofences from file dialog appear. Here you can template CSV file.
The CSV may have the following columns:
name
(string, required): A name for the geofence.type
(string, required): The type of geofence. Onlycustom
is supported at this time.status
(string, required):enabled
group for the geofence.disabled
to do no track geofecing eventstag
(string, required): A group for the geofence.externalId
(string, required): An external ID for the geofence that maps to your internal database.metadata
(dictionary, optional): An optional set of custom key-value pairs for the geofence. A dictionary or JSON string with up to 16 keys and values of type string, boolean, or number.externalId
(number, optional): a time in minutes, to track the dwell event in the geofence.geometry
(string, required): onlycircle
supported at this timecoordinates
(array, required): A JSON string representing a center for typecircle
in the format[longitude,latitude]
.radius
(number, required for typecircle
): The radius in meters for typecircle