> ## 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.

# Cordial

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

Radar can send events and user attributes to [Cordial](https://cordial.com).

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

## Configuration

On the Cordial *API Keys* page, create and copy a new API key with *Contact Activities* permissions. Additionally, ask the Cordial team to create a secondary key for contacts (e.g., `emailHash`) that you can pass to Radar.

Then, on the Radar [Integrations page](https://dashboard.radar.com/integrations#cordial) under *Cordial*, set *Enabled* to *Yes* and paste your API key. Note that you can set separate API keys and app identifiers for the *Test* and *Live* environments. Then, paste your async API endpoint, like `https://integrations-ingest-svc.usw2.cordial.com`. Finally, enter the secondary key.

Whenever events are generated, Radar will send custom events and user attributes to Cordial.

Set `metadata[cordial:{secondaryKey}]` to map Radar users to the secondary key on Cordial contacts. For example, if your secondary key is `emailHash`:

<CodeGroup>
  ```swift Swift theme={null}
  Radar.setMetadata(["cordial:emailHash": emailHash])
  ```

  ```kotlin Kotlin theme={null}
  Radar.setMetadata(JSONObject().put("cordial:emailHash", emailHash))
  ```
</CodeGroup>

## User mapping

| Radar User Field                     | Cordial Contact Attribute                     | Type           | Example Value                                | Context Type                       |
| ------------------------------------ | --------------------------------------------- | -------------- | -------------------------------------------- | ---------------------------------- |
| `metadata[cordial:{secondaryKey}]`   | `{secondaryKey}`                              | string         | `"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"` |                                    |
| `_id`                                | `radar_id`                                    | string         | `"5b2c0906f5874b001aecfd8d"`                 |                                    |
| `location`                           | `current_location`                            | location       | `(39.525665, -76.350663)`                    |                                    |
| `locationAuthorization`              | `radar_location_authorization`                | string         | `"GRANTED_FOREGROUND"`                       |                                    |
| `locationAccuracyAuthorization`      | `radar_location_accuracy_authorization`       | string         | `"FULL"`                                     |                                    |
| `updatedAt`                          | `radar_updated_at`                            | timestamp      | `"2018-06-22T15:23:39.000Z"`                 |                                    |
| `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_id`                        | string         | `"starbucks"`                                | [Places](/geofencing/places)       |
| `place.chain.name`                   | `radar_place_chain_name`                      | string         | `"Starbucks"`                                | [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"`                                      | [Trips](/geofencing/trips)         |
| `trip.destinationGeofenceTag`        | `radar_trip_destination_geofence_tag`         | string         | `"store"`                                    | [Trips](/geofencing/trips)         |
| `trip.destinationGeofenceExternalId` | `radar_trip_destination_geofence_external_id` | string         | `"123"`                                      | [Trips](/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                       | Cordial Event                  |
| ----------------------------------- | ---------------------------------- | ------------------------------ |
| `user.entered_geofence`             | [Geofences](/geofencing/geofences) | `entered_geofence`             |
| `user.exited_geofence`              | [Geofences](/geofencing/geofences) | `exited_geofence`              |
| `user.dwelled_in_geofence`          | [Geofences](/geofencing/geofences) | `dwelled_in_geofence`          |
| `user.entered_place`                | [Places](/geofencing/places)       | `entered_place`                |
| `user.exited_place`                 | [Places](/geofencing/places)       | `exited_place`                 |
| `user.entered_region_country`       | [Regions](/geofencing/regions)     | `entered_country`              |
| `user.exited_region_country`        | [Regions](/geofencing/regions)     | `exited_country`               |
| `user.entered_region_state`         | [Regions](/geofencing/regions)     | `entered_state`                |
| `user.exited_region_state`          | [Regions](/geofencing/regions)     | `exited_state`                 |
| `user.entered_region_dma`           | [Regions](/geofencing/regions)     | `entered_dma`                  |
| `user.exited_region_dma`            | [Regions](/geofencing/regions)     | `exited_dma`                   |
| `user.started_trip`                 | [Trips](/geofencing/trips)         | `started_trip`                 |
| `user.updated_trip`                 | [Trips](/geofencing/trips)         | `updated_trip`                 |
| `user.approaching_trip_destination` | [Trips](/geofencing/trips)         | `approaching_trip_destination` |
| `user.arrived_at_trip_destination`  | [Trips](/geofencing/trips)         | `arrived_at_trip_destination`  |
| `user.stopped_trip`                 | [Trips](/geofencing/trips)         | `stopped_trip`                 |
| `user.entered_beacon`               | [Beacons](/geofencing/beacons)     | `entered_beacon`               |
| `user.exited_beacon`                | [Beacons](/geofencing/beacons)     | `exited_beacon`                |

### entered\_geofence

| Radar Event Field          | Cordial Event Property    | Type    | Example Value                |
| -------------------------- | ------------------------- | ------- | ---------------------------- |
| `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`                       |

If [Regions](/geofencing/regions) is enabled, Radar will also send the following attributes:

| Radar Event Field | Cordial Event Property | Type   | Example Value     |
| ----------------- | ---------------------- | ------ | ----------------- |
| `country.code`    | `country_code`         | string | `"US"`            |
| `country.name`    | `country_name`         | string | `"United States"` |
| `state.code`      | `state_code`           | string | `"MD"`            |
| `state.name`      | `state_name`           | string | `"Maryland"`      |
| `dma.code`        | `dma_code`             | string | `"26"`            |
| `dma.name`        | `dma_name`             | string | `"Baltimore"`     |
| `postalCode.code` | `postal_code`          | string | `"21014"`         |

### exited\_geofence

| Radar Event Field          | Cordial Event Property    | Type             | Example Value                |
| -------------------------- | ------------------------- | ---------------- | ---------------------------- |
| `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`                       |

If [Regions](/geofencing/regions) is enabled, Radar will also send the following attributes:

| Radar Event Field | Cordial Event Property | Type   | Example Value     |
| ----------------- | ---------------------- | ------ | ----------------- |
| `country.code`    | `country_code`         | string | `"US"`            |
| `country.name`    | `country_name`         | string | `"United States"` |
| `state.code`      | `state_code`           | string | `"MD"`            |
| `state.name`      | `state_name`           | string | `"Maryland"`      |
| `dma.code`        | `dma_code`             | string | `"26"`            |
| `dma.name`        | `dma_name`             | string | `"Baltimore"`     |
| `postalCode.code` | `postal_code`          | string | `"21014"`         |

### dwelled\_in\_geofence

| Radar Event Field          | Cordial Event Property    | Type             | Example Value                |
| -------------------------- | ------------------------- | ---------------- | ---------------------------- |
| `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`                       |

If [Regions](/geofencing/regions) is enabled, Radar will also send the following attributes:

| Radar Event Field | Cordial Event Property | Type   | Example Value     |
| ----------------- | ---------------------- | ------ | ----------------- |
| `country.code`    | `country_code`         | string | `"US"`            |
| `country.name`    | `country_name`         | string | `"United States"` |
| `state.code`      | `state_code`           | string | `"MD"`            |
| `state.name`      | `state_name`           | string | `"Maryland"`      |
| `dma.code`        | `dma_code`             | string | `"26"`            |
| `dma.name`        | `dma_name`             | string | `"Baltimore"`     |
| `postalCode.code` | `postal_code`          | string | `"21014"`         |

### entered\_place

| Radar Event Field             | Cordial Event Property       | Type                     | Example Value                      |
| ----------------------------- | ---------------------------- | ------------------------ | ---------------------------------- |
| `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.chain.externalId`      | `place_chain_external_id`    | string                   | `"123"`                            |
| `place.chain.metadata[{key}]` | `place_chain_metadata_{key}` | type                     | `{value}`                          |
| `place.categories`            | `place_categories`           | string (comma-separated) | `"food-beverage,cafe,coffee-shop"` |
| `confidence`                  | `confidence`                 | string                   | `"high"`                           |
| `foreground`                  | `foreground`                 | boolean                  | `true`                             |

If [Regions](/geofencing/regions) is enabled, Radar will also send the following attributes:

| Radar Event Field | Cordial Event Property | Type   | Example Value     |
| ----------------- | ---------------------- | ------ | ----------------- |
| `country.code`    | `country_code`         | string | `"US"`            |
| `country.name`    | `country_name`         | string | `"United States"` |
| `state.code`      | `state_code`           | string | `"MD"`            |
| `state.name`      | `state_name`           | string | `"Maryland"`      |
| `dma.code`        | `dma_code`             | string | `"26"`            |
| `dma.name`        | `dma_name`             | string | `"Baltimore"`     |
| `postalCode.code` | `postal_code`          | string | `"21014"`         |

### exited\_place

| Radar Event Field             | Cordial Event Property       | Type                     | Example Value                      |
| ----------------------------- | ---------------------------- | ------------------------ | ---------------------------------- |
| `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.chain.externalId`      | `place_chain_external_id`    | string                   | `"123"`                            |
| `place.chain.metadata[{key}]` | `place_chain_metadata_{key}` | type                     | `{value}`                          |
| `place.categories`            | `place_categories`           | string (comma-separated) | `"food-beverage,cafe,coffee-shop"` |
| `confidence`                  | `confidence`                 | string                   | `"high"`                           |
| `duration`                    | `duration`                   | number (minutes)         | `42.1`                             |
| `foreground`                  | `foreground`                 | boolean                  | `true`                             |

If [Regions](/geofencing/regions) is enabled, Radar will also send the following attributes:

| Radar Event Field | Cordial Event Property | Type   | Example Value     |
| ----------------- | ---------------------- | ------ | ----------------- |
| `country.code`    | `country_code`         | string | `"US"`            |
| `country.name`    | `country_name`         | string | `"United States"` |
| `state.code`      | `state_code`           | string | `"MD"`            |
| `state.name`      | `state_name`           | string | `"Maryland"`      |
| `dma.code`        | `dma_code`             | string | `"26"`            |
| `dma.name`        | `dma_name`             | string | `"Baltimore"`     |
| `postalCode.code` | `postal_code`          | string | `"21014"`         |

### entered\_country

| Radar Event Attribute | Cordial Event Property | Type    | Example Value     |
| --------------------- | ---------------------- | ------- | ----------------- |
| `region.code`         | `region_code`          | string  | `"US"`            |
| `region.name`         | `region_name`          | string  | `"United States"` |
| `confidence`          | `confidence`           | string  | `"high"`          |
| `foreground`          | `foreground`           | boolean | `true`            |

### exited\_country

| Radar Event Attribute | Cordial Event Property | Type    | Example Value     |
| --------------------- | ---------------------- | ------- | ----------------- |
| `region.code`         | `region_code`          | string  | `"US"`            |
| `region.name`         | `region_name`          | string  | `"United States"` |
| `confidence`          | `confidence`           | string  | `"high"`          |
| `foreground`          | `foreground`           | boolean | `true`            |

### entered\_state

| Radar Event Attribute | Cordial Event Property | Type    | Example Value |
| --------------------- | ---------------------- | ------- | ------------- |
| `region.code`         | `region_code`          | string  | `"MD"`        |
| `region.name`         | `region_name`          | string  | `"Maryland"`  |
| `confidence`          | `confidence`           | string  | `"high"`      |
| `foreground`          | `foreground`           | boolean | `true`        |

### exited\_state

| Radar Event Attribute | Cordial Event Property | Type    | Example Value |
| --------------------- | ---------------------- | ------- | ------------- |
| `region.code`         | `region_code`          | string  | `"MD"`        |
| `region.name`         | `region_name`          | string  | `"Maryland"`  |
| `confidence`          | `confidence`           | string  | `"high"`      |
| `foreground`          | `foreground`           | boolean | `true`        |

### entered\_dma

| Radar Event Attribute | Cordial Event Property | Type    | Example Value |
| --------------------- | ---------------------- | ------- | ------------- |
| `region.code`         | `region_code`          | string  | `"26"`        |
| `region.name`         | `region_name`          | string  | `"Baltimore"` |
| `confidence`          | `confidence`           | string  | `"high"`      |
| `foreground`          | `foreground`           | boolean | `true`        |

### exited\_dma

| Radar Event Attribute | Cordial Event Property | Type    | Example Value |
| --------------------- | ---------------------- | ------- | ------------- |
| `region.code`         | `region_code`          | string  | `"26"`        |
| `region.name`         | `region_name`          | string  | `"Baltimore"` |
| `confidence`          | `confidence`           | string  | `"high"`      |
| `foreground`          | `foreground`           | boolean | `true`        |

### started\_trip

| Radar Event Attribute                | Cordial Event Property                  | 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`        |

### updated\_trip

| Radar Event Attribute                | Cordial Event Property                  | 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`        |

### approaching\_trip\_destination

| Radar Event Attribute                | Cordial Event Property                  | 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`        |

### arrived\_at\_trip\_destination

| Radar Event Attribute                | Cordial Event Property                  | 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`        |

### stopped\_trip

| Radar Event Attribute                | Cordial Event Property                  | 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`        |

### entered\_beacon

| Radar Event Attribute    | Cordial Event Property       | Type    | Example Value                |
| ------------------------ | ---------------------------- | ------- | ---------------------------- |
| `beacon._id`             | `beacon_id`                  | string  | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `radar_beacon_description`   | string  | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `radar_beacon_tag`           | string  | `"drive-thru"`               |
| `beacon.externalId`      | `radar_beacon_external_id`   | string  | `"123"`                      |
| `beacon.metadata[{key}]` | `radar_beacon_metadata{key}` | type    | `{value}`                    |
| `confidence`             | `confidence`                 | string  | `"high"`                     |
| `foreground`             | `foreground`                 | boolean | `true`                       |

### exited\_beacon

| Radar Event Attribute    | Cordial Event Property       | Type             | Example Value                |
| ------------------------ | ---------------------------- | ---------------- | ---------------------------- |
| `beacon._id`             | `beacon_id`                  | string           | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `radar_beacon_description`   | string           | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `radar_beacon_tag`           | string           | `"drive-thru"`               |
| `beacon.externalId`      | `radar_beacon_external_id`   | string           | `"123"`                      |
| `beacon.metadata[{key}]` | `radar_beacon_metadata{key}` | type             | `{value}`                    |
| `confidence`             | `confidence`                 | string           | `"high"`                     |
| `duration`               | `radar_duration`             | number (minutes) | `1.42`                       |
| `foreground`             | `foreground`                 | boolean          | `true`                       |
