Insights

Contents

Introduction

Radar can learn a user's approximate home and work locations and tell you when a user is at home, at work, or traveling.

Insights is a premium context type, available only to Enterprise customers.

Enable Insights to receive the following events:

  • user.entered_home
  • user.exited_home
  • user.entered_office
  • user.exited_office
  • user.started_traveling
  • user.stopped_traveling

You can enable Insights on the Settings page, under Insights.

Quickstart

Want to get started quickly? Follow these three steps:

  1. Start tracking. Integrate the SDK to start tracking users. Or, test with our toolkit apps for iOS or Android.

  2. Add context. Enable Insights on the Settings page, under Insights.

  3. Handle events. Wait until Radar learns a user's approximate home and office locations, usually after a few days. Then, handle insights events client-side or server-side via webhooks or integrations.

How it works

When Insights is on, Radar stores and clusters historical location data for each user. Based on the size, location, and time distribution of clusters, Radar learns each user's approximate home and office locations.

After Radar learns approximate home and office locations, Radar generates events when a user enters or exits their home, enters or exits their office, and starts or stops traveling. If Radar is unsure, Radar may not generate an event. Insights works in the foreground and in the background.

For example, to do something when a user exits their home, via a webhook:

app.post('/webhooks/radar', (req, res, next) => {
    const event = req.body.event;
    if (event.type === 'user.exited_home') {
        const userId = event.user.userId;
        // do something
    }
}

Confidence

All insights events have confidence levels. Confidence levels range from 1 (low) to 3 (high). Confidence is based on the size and time distribution of clusters.

On average, Radar learns a user's approximate home and office locations after a few days. In the foreground, Radar needs location data from a few app opens. In the background, Radar needs location data from a few days of activity.

When confidence is low, a user's approximate home and office locations may be the same until they start to diverge over time.

You can ignore insights based on confidence levels. For example, to do something if a user is at home, but only with high confidence, on iOS:

Radar.trackOnce { (status, location, events, user) in
    if let insights = user?.insights,
       insights.state?.home == true,
       insights.homeLocation?.confidence == .high {
        // do something
    }
}

Verify events

You can accept or reject insights events after user check-ins or other forms of verification. Event verifications will be used to improve the accuracy and confidence level of future events.

For example, to accept an event on iOS:

Radar.acceptEventId(event._id, verifiedPlaceId: nil)

To reject an event on Android:

Radar.rejectEvent(event._id);

Support

Have questions after reading the documentation? We're here to help! Click the button on the bottom right of any page to chat with us, or email us at [email protected].