Skip to main content

Trip Tracking

Use our industry-leading SDK to build experiences for curbside and in-store pickup, delivery tracking, and more.

Quickstart#

Want to get started quickly? Follow these three steps:

  1. Create geofences. Import geofences for your locations. Depending on your use case, a geofence might represent a retail store, a restaurant, a hotel, and so on.

  2. Integrate the Radar SDK into your app. Integrate the SDK into your app or website. When a customer places an order or taps "I'm on my way," start tracking and start a trip with custom metadata (like order ID, license plate, or car model).

  3. Display live trips and ETAs. Display live ETAs on the trip tracking dashboard, available on the Enterprise plan. Or, display live ETAs in your own UI by polling the list trips API or listening for trip events sent to a webhook.

Starting and stopping trips#

Integrate the SDK into your app or website. When a customer places an order or taps "I'm on my way," start tracking and start a trip with an ID, a destination geofence, a travel mode, and custom metadata (e.g., customer name, car model, or license plate) depending on your use case.

When the order is picked up or a customer taps "I'm here," stop tracking and stop the trip.

For example, on iOS:

// order placed or user taps "I'm on my way"
let tripOptions = RadarTripOptions(externalId: "299")
tripOptions.destinationGeofenceTag = "store"
tripOptions.destinationGeofenceExternalId = "123"
tripOptions.mode = .car
tripOptions.metadata = [
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
]
Radar.startTrip(options: tripOptions)
Radar.startTracking(trackingOptions: .continuous)
// order picked up or user taps "I'm here"
Radar.completeTrip()
Radar.stopTracking()

Trip events#

Radar calculates ETAs and generates events when trips are updated:

  • user.started_trip
  • user.updated_trip
  • user.approaching_trip_destination (configurable ETA threshold)
  • user.arrived_at_trip_destination (destination geofence entered)
  • user.stopped_trip

ETAs are calculated based on travel mode using the same routing engine that powers our distance API.

You can receive events client-side via the SDK or server-side via event integrations, including webhooks.

{
"events": [
{
"_id": "56db1f4613012711002229f6",
"type": "user.updated_trip",
"createdAt": "2020-08-20T10:30:55.837Z",
"live": true,
"trip": {
"_id": "5f3e50491c2b7d005c81f5d9",
"live": true,
"externalId": "299",
"metadata": {
"Customer Name": "Jacob Pena",
"Car Model": "Green Honda Civic"
},
"mode": "car",
"destinationGeofenceTag": "store",
"destinationGeofenceExternalId": "123",
"destinationLocation": {
"coordinates": [
-105.061198,
39.779366
],
"type": "Point"
},
"eta": {
"duration": 5.5,
"distance": 1331
},
"createdAt": "2020-08-20T10:27:55.830Z",
"updatedAt": "2020-08-20T10:30:55.837Z",
"status": "started"
},
},
],
"user": {
"_id": "56db1f4613012711002229f4",
"live": true,
"userId": "1",
"deviceId": "C305F2DB-56DC-404F-B6C1-BC52F0B680D8",
...
}
}

Display live trips and ETAs#

In the Radar trip tracking dashboard#

The Radar trip tracking dashboard displays active trips for a specific destination geofence, including ID, custom metadata, and ETA.

The trip tracking dashboard is available on the Enterprise plan.

Ask your customer success manager for a distribution of the app specific to your organization.

In your own UI#

Poll the list trips API to retrieve active trips for a specific destination geofence, including ID, custom metadata, and ETA. For example, you might poll the list trips API from an internal dashboard.

Or, listen for trip events sent to a webhook. From there, forward trip information, including ID, custom metadata, and ETA, to other systems. For example, you might set up a webhook that sends ETA to an order management or kitchen display system.

Analytics#

Radar offers analytics on trip data and location opt-in rates from users in your project. Analytics on trip data is grouped under the Trips tab, and analytics on location permission opt-in rates is grouped under the Permissions tab. Read more about Permissions here.

  • Median wait time: the median duration of time that it takes between the moment when a user arrives at a destination (user.arrived_at_trip_destination) and the moment when the trip is marked complete (completed).
  • Number of trips: the total count of all trips for a specific project which is live and has a status of completed.
  • Median trip time: the median duration of time that it takes between the moment when the user starts a trip (user.started_trip) and the moment when they arrive at the destination (user.arrived_at_trip_destination).

Calculations#

Wait time and trip time are only calculated for trips that have a status of completed and have timestamp entries for started_at, arrived_at, and completed_at. These calculations exclude expired trips.

How to filter your data#

Date Range: Select a date from the drop-down date picker. Make sure that the date in the left-hand box falls before the date in the right-hand box.

Radar User ID: This field requires the unique Radar-generated ID and does not accept "external ID" or "device ID" in its place. You can find the unique Radar-generated ID for each user by navigating to the Users page and clicking "View" in the corresponding row of the user.

Destination Geofence Tag: Each geofence has a geofence tag. You can find the tag to a specific geofence in the "Tag" column on the Geofences page in the sidebar, or you can navigate to the trips page in the sidebar and click on the external ID listed under "Destination", which will show the details of the destination geofence. This field can be used alone or in tandem with the Destination Geofence External ID field.

Destination Geofence External ID: Each geofence has an external ID. You can find the external ID for a specific geofence in the "External ID" column on the Geofences page in the sidebar, or you can navigate to the Trips page and click on the external ID listed under "Destination". This field can be used alone or in tandem with the Destination Geofence Tag field.

Trip stats apply to the environment in which you view the metrics. For example, when viewing the metrics in the test environment, the metrics only include trip data from the test environment.

Data retention settings and frequency of updates#

Data retention settings (a setting on the project level) apply to the data in Analytics as well. The default data retention settings for trip data is 90 days.

Median wait time, trip count, and median trip duration metrics are all updated nightly, so all calculations do not include the current day's data.

If your project does not have any past trips, you will not see any data in the analytics section of your dashboard. Take your first trip to see the statistics populate!

Support#

Have questions? We're here to help! Email us at [email protected].