Skip to main content

Overview

Radar’s trip tracking feature enables you to track journeys from origin to destination with real-time ETAs, status updates, and approaching/arrival events. Perfect for delivery, ride-sharing, and on-demand services.

Understanding Trips

A trip represents a journey to a destination geofence. Trips include:
  • External ID: Your unique identifier for the trip
  • Destination: A geofence tag or external ID
  • Metadata: Custom key-value pairs
  • Mode: Travel mode (car, bike, foot)
  • Status: Current trip state (started, approaching, arrived, etc.)
  • ETA: Real-time distance and duration to destination
  • Scheduled arrival: Optional expected arrival time
  • Multi-destination support: Multiple legs for complex routes

Trip Lifecycle

Trips progress through the following statuses:
1

Started

Trip has been created and tracking has begun.Status: RadarTripStatusStartedEvent: RadarEventTypeUserStartedTrip
2

Approaching

User is approaching the destination (within threshold).Status: RadarTripStatusApproachingEvent: RadarEventTypeUserApproachingTripDestination
3

Arrived

User has arrived at the destination geofence.Status: RadarTripStatusArrivedEvent: RadarEventTypeUserArrivedAtTripDestination
4

Completed or Canceled

Trip has been completed or canceled.Status: RadarTripStatusCompleted or RadarTripStatusCanceledEvent: RadarEventTypeUserStoppedTrip

Starting a Trip

Start a trip with destination geofence tag or external ID:
Either destinationGeofenceTag or destinationGeofenceExternalId is required. Both can be provided for additional matching.

Starting with Custom Tracking Options

You can specify custom tracking options for the trip duration:
When you start a trip, Radar automatically starts tracking if not already enabled. You can pass custom tracking options or set startTracking to false to manage tracking separately.

Trip Options Reference

Updating a Trip

Manually update a trip’s options or status:
Pass RadarTripStatusUnknown to avoid updating the trip status when you only want to update other properties.

Completing a Trip

Mark a trip as completed:

Canceling a Trip

Cancel an active trip:
Completing or canceling a trip does not automatically stop tracking. Call Radar.stopTracking() if you want to stop location updates.

Getting Current Trip

Retrieve the current active trip:

Trip Events

Receive trip events through the RadarDelegate:

Multi-Destination Trips

For trips with multiple stops, use trip legs:

Creating Multi-Destination Trips

Updating Trip Legs

Update the status of individual legs:

Update Current Leg

Update the current active leg:

Reordering Trip Legs

Reorder legs in a multi-destination trip:

Trip Properties

Access trip properties from the RadarTrip object:

Use Cases

Food Delivery

Track delivery driver location and provide customers with real-time ETAs and approaching notifications.

Ride-Sharing

Monitor driver progress to pickup location and notify passengers when the driver is approaching.

Package Delivery

Track couriers across multiple delivery stops with multi-destination trip legs.

Field Services

Track technicians traveling to service appointments with arrival notifications.

Best Practices

1

Use Unique External IDs

Use your own unique identifiers (order IDs, delivery IDs) as the trip’s external ID for easy reference.
2

Set Appropriate Travel Modes

Choose the correct travel mode (car, bike, foot) for accurate ETA calculations.
3

Include Rich Metadata

Store order details, customer information, and other context in trip metadata for personalization.
4

Handle Approaching Events

Listen for approaching events to send timely notifications to recipients.
5

Complete or Cancel Trips

Always complete or cancel trips when finished to maintain clean trip state.
For more details on trip tracking, visit the Radar documentation.