> ## Documentation Index
> Fetch the complete documentation index at: https://radarlabs-rob-onesignal-api-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Leanplum

<Info>
  The Leanplum integration is available on the [**Enterprise plan**](https://radar.com/pricing).
</Info>

Radar can send events and user attributes to [Leanplum](https://www.leanplum.com).

Use the Leanplum integration to send location-triggered and location-targeted messages to increase engagement and conversion.

## Configuration

On the Leanplum *App Settings* page, click *Keys & Settings* and copy the *App ID*, *Production Key*, and *Development Key*.

Then, on the Radar [Integrations page](https://dashboard.radar.com/integrations) under *Leanplum*, set *Enabled* to *Yes* and paste the app ID and API keys. The Radar *Test* environment automatically maps to the *Development* environment in Leanplum, and the Radar *Live* environment automatically maps to the *Production* environment in Leanplum.

Whenever events are generated, Radar will call `track` and `setUserAttributes` to send events and user attributes to Leanplum.

## User mapping

Note that Radar uses the special string `"(null)"` to represent `null` user attribute values.

| Radar User Field                     | Leanplum User Attribute                       | Type           | Example Value                              | Context Type                       |
| ------------------------------------ | --------------------------------------------- | -------------- | ------------------------------------------ | ---------------------------------- |
| `userId`                             | `Distinct ID`                                 | string         | `"1"`                                      |                                    |
| `location.coordinates[0]`            | `Radar Location Longitude`                    | number         | `-76.350663`                               |                                    |
| `location.coordinates[1]`            | `Radar Location Latitude`                     | number         | `39.525665`                                |                                    |
| `locationAuthorization`              | `Radar Location Authorization`                | string         | `"GRANTED_FOREGROUND"`                     |                                    |
| `locationAccuracyAuthorization`      | `Radar Location Accuracy Authorization`       | string         | `"FULL"`                                   |                                    |
| `_id`                                | `Radar ID`                                    | string         | `"5b2c0906f5874b001aecfd8d"`               |                                    |
| `segments[*].externalId`             | `Radar Segment External IDs`                  | array\[string] | `["starbucks-visitors"]`                   |                                    |
| `topChains[*].slug`                  | `Radar Top Chain Slugs`                       | array\[string] | `["starbucks", "walmart"]`                 |                                    |
| `topChains[*].externalId`            | `Radar Top Chain External IDs`                | array\[string] | `["123", "456"]`                           |                                    |
| `geofences[*]._id`                   | `Radar Geofence IDs`                          | array\[string] | `["5b2c0906f5874b001aecfd8e"]`             | [Geofences](/geofencing/geofences) |
| `geofences[*].description`           | `Radar Geofence Descriptions`                 | array\[string] | `["Store #123"]`                           | [Geofences](/geofencing/geofences) |
| `geofences[*].tag`                   | `Radar Geofence Tags`                         | array\[string] | `["store"]`                                | [Geofences](/geofencing/geofences) |
| `geofences[*].externalId`            | `Radar Geofence External IDs`                 | array\[string] | `["123"]`                                  | [Geofences](/geofencing/geofences) |
| `place._id`                          | `Radar Place ID`                              | string         | `"59302bcf8f27e8a156bd4f91"`               | [Places](/geofencing/places)       |
| `place.name`                         | `Radar Place Name`                            | string         | `"Starbucks"`                              | [Places](/geofencing/places)       |
| `place.categories`                   | `Radar Place Categories`                      | array\[string] | `["food-beverage", "cafe", "coffee-shop"]` | [Places](/geofencing/places)       |
| `place.chain.slug`                   | `Radar Place Chain Slug`                      | string         | `"starbucks"`                              | [Places](/geofencing/places)       |
| `place.chain.name`                   | `Radar Place Chain Name`                      | string         | `"Starbucks"`                              | [Places](/geofencing/places)       |
| `place.chain.externalId`             | `Radar Place Chain External ID`               | string         | `"123"`                                    | [Places](/geofencing/places)       |
| `country.code`                       | `Radar Region Country Code`                   | string         | `"US"`                                     | [Regions](/geofencing/regions)     |
| `country.name`                       | `Radar Region Country Name`                   | string         | `"United States"`                          | [Regions](/geofencing/regions)     |
| `state.code`                         | `Radar Region State Code`                     | string         | `"MD"`                                     | [Regions](/geofencing/regions)     |
| `state.name`                         | `Radar Region State Name`                     | string         | `"Maryland"`                               | [Regions](/geofencing/regions)     |
| `dma.code`                           | `Radar Region DMA Code`                       | string         | `"26"`                                     | [Regions](/geofencing/regions)     |
| `dma.name`                           | `Radar Region DMA Name`                       | string         | `"Baltimore"`                              | [Regions](/geofencing/regions)     |
| `postalCode.code`                    | `Radar Region Postal Code`                    | string         | `"21014"`                                  | [Regions](/geofencing/regions)     |
| `trip.externalId`                    | `Radar Trip External ID`                      | string         | `"299"`                                    | [Trip Tracking](/geofencing/trips) |
| `trip.destinationGeofenceTag`        | `Radar Trip Destination Geofence Tag`         | string         | `"store"`                                  | [Trip Tracking](/geofencing/trips) |
| `trip.destinationGeofenceExternalId` | `Radar Trip Destination Geofence External ID` | string         | `"123"`                                    | [Trip Tracking](/geofencing/trips) |
| `beacons[*]._id`                     | `Radar Beacon IDs`                            | array\[string] | `["5b2c0906f5874b001aecfd8f"]`             | [Beacons](/geofencing/beacons)     |
| `beacons[*].description`             | `Radar Beacon Descriptions`                   | array\[string] | `["Store #123 - Drive-Thru"]`              | [Beacons](/geofencing/beacons)     |
| `beacons[*].tag`                     | `Radar Beacon Tags`                           | array\[string] | `["drive-thru"]`                           | [Beacons](/geofencing/beacons)     |
| `beacons[*].externalId`              | `Radar Beacon External IDs`                   | array\[string] | `["123"]`                                  | [Beacons](/geofencing/beacons)     |

## Event mapping

| Radar Event                         | Context Type                       | Leanplum Event                       |
| ----------------------------------- | ---------------------------------- | ------------------------------------ |
| `user.entered_geofence`             | [Geofences](/geofencing/geofences) | `Radar Geofence Entered`             |
| `user.exited_geofence`              | [Geofences](/geofencing/geofences) | `Radar Geofence Exited`              |
| `user.dwelled_in_geofence`          | [Geofences](/geofencing/geofences) | `Radar Dwelled in Geofence`          |
| `user.entered_place`                | [Places](/geofencing/places)       | `Radar Place Entered`                |
| `user.exited_place`                 | [Places](/geofencing/places)       | `Radar Place Exited`                 |
| `user.entered_region_country`       | [Regions](/geofencing/regions)     | `Radar Country Entered`              |
| `user.exited_region_country`        | [Regions](/geofencing/regions)     | `Radar Country Exited`               |
| `user.entered_region_state`         | [Regions](/geofencing/regions)     | `Radar State Entered`                |
| `user.exited_region_state`          | [Regions](/geofencing/regions)     | `Radar State Exited`                 |
| `user.entered_region_dma`           | [Regions](/geofencing/regions)     | `Radar DMA Entered`                  |
| `user.exited_region_dma`            | [Regions](/geofencing/regions)     | `Radar DMA Exited`                   |
| `user.started_trip`                 | [Trip Tracking](/geofencing/trips) | `Radar Started Trip`                 |
| `user.updated_trip`                 | [Trip Tracking](/geofencing/trips) | `Radar Updated Trip`                 |
| `user.approaching_trip_destination` | [Trip Tracking](/geofencing/trips) | `Radar Approaching Trip Destination` |
| `user.arrived_at_trip_destination`  | [Trip Tracking](/geofencing/trips) | `Radar Arrived at Trip Destination`  |
| `user.stopped_trip`                 | [Trip Tracking](/geofencing/trips) | `Radar Stopped Trip`                 |
| `user.entered_beacon`               | [Beacons](/geofencing/beacons)     | `Radar Beacon Entered`               |
| `user.exited_beacon`                | [Beacons](/geofencing/beacons)     | `Radar Beacon Exited`                |

### Radar Geofence Entered

| Radar Event Field          | Leanplum Event Parameter  | Type    | Example                      |
| -------------------------- | ------------------------- | ------- | ---------------------------- |
| `geofence._id`             | `Geofence ID`             | string  | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `Geofence Description`    | string  | `"Store #123"`               |
| `geofence.tag`             | `Geofence Tag`            | string  | `"store"`                    |
| `geofence.externalId`      | `Geofence External ID`    | string  | `"123"`                      |
| `geofence.metadata[{key}]` | `Geofence Metadata {key}` | type    | `{value}`                    |
| `confidence`               | `Confidence`              | string  | `"high"`                     |
| `foreground`               | `Foreground`              | boolean | `true`                       |

### Radar Geofence Exited

| Radar Event Field          | Leanplum Event Parameter  | Type             | Example                      |
| -------------------------- | ------------------------- | ---------------- | ---------------------------- |
| `geofence._id`             | `Geofence ID`             | string           | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `Geofence Description`    | string           | `"Store #123"`               |
| `geofence.tag`             | `Geofence Tag`            | string           | `"store"`                    |
| `geofence.externalId`      | `Geofence External ID`    | string           | `"123"`                      |
| `geofence.metadata[{key}]` | `Geofence Metadata {key}` | type             | `{value}`                    |
| `confidence`               | `Confidence`              | string           | `"high"`                     |
| `duration`                 | `Duration`                | number (minutes) | `42.1`                       |
| `foreground`               | `Foreground`              | boolean          | `true`                       |

### Radar Dwelled in Geofence

| Radar Event Field          | Leanplum Event Parameter  | Type             | Example                      |
| -------------------------- | ------------------------- | ---------------- | ---------------------------- |
| `geofence._id`             | `Geofence ID`             | string           | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `Geofence Description`    | string           | `"Store #123"`               |
| `geofence.tag`             | `Geofence Tag`            | string           | `"store"`                    |
| `geofence.externalId`      | `Geofence External ID`    | string           | `"123"`                      |
| `geofence.metadata[{key}]` | `Geofence Metadata {key}` | type             | `{value}`                    |
| `confidence`               | `Confidence`              | string           | `"high"`                     |
| `duration`                 | `Duration`                | number (minutes) | `5`                          |
| `foreground`               | `Foreground`              | boolean          | `true`                       |

### Radar Place Entered

| Radar Event Field  | Leanplum Event Parameter | Type           | Example                                    |
| ------------------ | ------------------------ | -------------- | ------------------------------------------ |
| `place._id`        | `Place ID`               | string         | `"59302bcf8f27e8a156bd4f91"`               |
| `place.name`       | `Place Name`             | string         | `"Starbucks"`                              |
| `place.chain.slug` | `Place Chain ID`         | string         | `"starbucks"`                              |
| `place.chain.name` | `Place Chain Name`       | string         | `"Starbucks"`                              |
| `place.categories` | `Place Categories`       | array\[string] | `["food-beverage", "cafe", "coffee-shop"]` |
| `confidence`       | `Confidence`             | string         | `"high"`                                   |
| `foreground`       | `Foreground`             | boolean        | `true`                                     |

### Radar Place Exited

| Radar Event Field  | Leanplum Event Parameter | Type             | Example                                    |
| ------------------ | ------------------------ | ---------------- | ------------------------------------------ |
| `place._id`        | `Place ID`               | string           | `"59302bcf8f27e8a156bd4f91"`               |
| `place.name`       | `Place Name`             | string           | `"Starbucks"`                              |
| `place.chain.slug` | `Place Chain ID`         | string           | `"starbucks"`                              |
| `place.chain.name` | `Place Chain Name`       | string           | `"Starbucks"`                              |
| `place.categories` | `Place Categories`       | array\[string]   | `["food-beverage", "cafe", "coffee-shop"]` |
| `confidence`       | `Confidence`             | string           | `"high"`                                   |
| `duration`         | `Duration`               | number (minutes) | `42.1`                                     |
| `foreground`       | `Foreground`             | boolean          | `true`                                     |

### Radar Country Entered

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value     |
| ----------------- | ------------------------ | ------- | ----------------- |
| `region.code`     | `Region Code`            | string  | `"US"`            |
| `region.name`     | `Region Name`            | string  | `"United States"` |
| `confidence`      | `Confidence`             | string  | `"high"`          |
| `foreground`      | `Foreground`             | boolean | `true`            |

### Radar Country Exited

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value     |
| ----------------- | ------------------------ | ------- | ----------------- |
| `region.code`     | `Region Code`            | string  | `"US"`            |
| `region.name`     | `Region Name`            | string  | `"United States"` |
| `confidence`      | `Confidence`             | string  | `"high"`          |
| `foreground`      | `Foreground`             | boolean | `true`            |

### Radar State Entered

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value |
| ----------------- | ------------------------ | ------- | ------------- |
| `region.code`     | `Region Code`            | string  | `"MD"`        |
| `region.name`     | `Region Name`            | string  | `"Maryland"`  |
| `confidence`      | `Confidence`             | string  | `"high"`      |
| `foreground`      | `Foreground`             | boolean | `true`        |

### Radar State Exited

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value |
| ----------------- | ------------------------ | ------- | ------------- |
| `region.code`     | `Region Code`            | string  | `"MD"`        |
| `region.name`     | `Region Name`            | string  | `"Maryland"`  |
| `confidence`      | `Confidence`             | string  | `"high"`      |
| `foreground`      | `Foreground`             | boolean | `true`        |

### Radar DMA Entered

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value |
| ----------------- | ------------------------ | ------- | ------------- |
| `region.code`     | `Region Code`            | string  | `"26"`        |
| `region.name`     | `Region Name`            | string  | `"Baltimore"` |
| `confidence`      | `Confidence`             | string  | `"high"`      |
| `foreground`      | `Foreground`             | boolean | `true`        |

### Radar DMA Exited

| Radar Event Field | Leanplum Event Parameter | Type    | Example Value |
| ----------------- | ------------------------ | ------- | ------------- |
| `region.code`     | `Region Code`            | string  | `"26"`        |
| `region.name`     | `Region Name`            | string  | `"Baltimore"` |
| `confidence`      | `Confidence`             | string  | `"high"`      |
| `foreground`      | `Foreground`             | boolean | `true`        |

### Radar Started Trip

| Radar Event Attribute                | Leanplum Event Parameter                | Type    | Example Value |
| ------------------------------------ | --------------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `Trip External ID`                      | string  | `"299"`       |
| `trip.metadata[{key}]`               | `Trip Metadata {key}`                   | type    | `{value}`     |
| `trip.destinationGeofenceTag`        | `Trip Destination Geofence Tag`         | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `Trip Destination Geofence External ID` | string  | `"123"`       |
| `foreground`                         | `Foreground`                            | boolean | `true`        |

### Radar Approaching Trip Destination

| Radar Event Attribute                | Leanplum Event Parameter                | Type    | Example Value |
| ------------------------------------ | --------------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `Trip External ID`                      | string  | `"299"`       |
| `trip.metadata[{key}]`               | `Trip Metadata {key}`                   | type    | `{value}`     |
| `trip.destinationGeofenceTag`        | `Trip Destination Geofence Tag`         | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `Trip Destination Geofence External ID` | string  | `"123"`       |
| `foreground`                         | `Foreground`                            | boolean | `true`        |

### Radar Arrived at Trip Destination

| Radar Event Attribute                | Leanplum Event Parameter                | Type    | Example Value |
| ------------------------------------ | --------------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `Trip External ID`                      | string  | `"299"`       |
| `trip.metadata[{key}]`               | `Trip Metadata {key}`                   | type    | `{value}`     |
| `trip.destinationGeofenceTag`        | `Trip Destination Geofence Tag`         | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `Trip Destination Geofence External ID` | string  | `"123"`       |
| `foreground`                         | `Foreground`                            | boolean | `true`        |

### Radar Stopped Trip

| Radar Event Attribute                | Leanplum Event Parameter                | Type    | Example Value |
| ------------------------------------ | --------------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `Trip External ID`                      | string  | `"299"`       |
| `trip.metadata[{key}]`               | `Trip Metadata {key}`                   | type    | `{value}`     |
| `trip.destinationGeofenceTag`        | `Trip Destination Geofence Tag`         | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `Trip Destination Geofence External ID` | string  | `"123"`       |
| `foreground`                         | `Foreground`                            | boolean | `true`        |

### Radar Beacon Entered

| Radar Event Attribute    | Leanplum Event Parameter | Type    | Example Value                |
| ------------------------ | ------------------------ | ------- | ---------------------------- |
| `beacon._id`             | `Beacon ID`              | string  | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `Beacon Description`     | string  | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `Beacon Tag`             | string  | `"drive-thru"`               |
| `beacon.externalId`      | `Beacon External ID`     | string  | `"123"`                      |
| `beacon.metadata[{key}]` | `Beacon Metadata {key}`  | type    | `{value}`                    |
| `confidence`             | `Confidence`             | string  | `"high"`                     |
| `foreground`             | `Foreground`             | boolean | `true`                       |

### Radar Beacon Exited

| Radar Event Attribute    | Leanplum Event Parameter | Type             | Example Value                |
| ------------------------ | ------------------------ | ---------------- | ---------------------------- |
| `beacon._id`             | `Beacon ID`              | string           | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `Beacon Description`     | string           | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `Beacon Tag`             | string           | `"drive-thru"`               |
| `beacon.externalId`      | `Beacon External ID`     | string           | `"123"`                      |
| `beacon.metadata[{key}]` | `Beacon Metadata {key}`  | type             | `{value}`                    |
| `confidence`             | `Confidence`             | string           | `"high"`                     |
| `duration`               | `Duration`               | number (minutes) | `1.42`                       |
| `foreground`             | `Foreground`             | boolean          | `true`                       |
