What is a Moving Geofence?

Traditional static geofences help you to understand how users interact with a fixed geographical location such as a retail store, event space or warehouse. We created Moving Geofences to help you understand how users interact with each other. Instead of placing a virtual fence around a physical place, our exciting new API allows you to assign dynamic geofences to a user’s device as it moves around the world.  

With the new feature, you can set a circular Geofence with a radius of your choice around your users. A nearby event is triggered when one user comes into proximity with another user and an away event is triggered when geofences move apart. This event can be used to push notifications to the device or collect data about how your users interact with each other.

What use cases do Moving Geofences enable?

Ride-sharing / ride-hailing

A geofence can be created around a user and around a driver. The user can be notified when a driver is at a set distance nearby and the driver can be notified when the user is approaching their vehicle. This can also be used to help users find nearby drivers in their vicinity and be notified as such.

Social apps

Allow users to check and be notified if they are in proximity to other users. This can be done with multiple users. For example, use roaming geofences in dating apps to inform users when they have crossed paths.

Mobile advertising

Complement traditional transit advertising by assigning geofences to public transport and taxis so users will receive personalized notifications based on their location. For example, based on your settings a user can receive a notification when they are within 500m proximity of another user.

How does it work?

If you want to create a social app in which users are notified when they come into 500m proximity of another user, you can set your desired geofence radius and users as seen below.

curl --location --request POST 'https://api.geospark.co/v3/api/moving-geofence/' \
--header 'Api-Key: e566c098cc6b441a9c3453b6fcf76e88' \
--header 'Content-Type: application/json' \
--data-raw '{
	"geometry_type": "circle",
	"geometry_radius": 500,
	"is_enabled": true,
	"only_once": true,
	"users": ["5f520949e3872b0341bcf3e7","5f520955e3872b0341bcf3e8","5f083247b3611453c98a726f"]
}'

In response, an event will be triggered showing which two  users came into a 500m proximity of each other and at what time:

 {
    "status": true,
    "msg": "Geofence Added successfully.",
    "code": 201,
    "data": {
        "id": "5f9801aeffb3fb0de55e863d",
        "account_id": "5bda16a2ea00845b3b419160",
        "project_id": "5bda16edea00845b3b419163",
        "geometry_type": "circle",
        "geometry_radius": 500,
        "is_enabled": true,
        "is_deleted": false,
        "created_at": "2020-10-27T11:17:02.956",
        "updated_at": "2020-10-27T11:17:02.959",
        "only_once": true,
        "users": [
            "5f520949e3872b0341bcf3e7",
            "5f520955e3872b0341bcf3e8"
        ]
    }
}

To find out how you can integrate Moving Geofences into your app, check out our documentation.

What next?

Sign up to explore the features in our free tier and start testing Moving Geofences in your app today.

Questions? Talk to an expert.