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

# AWS Pinpoint

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

Radar can send events and user attributes to [AWS Pinpoint](https://aws.amazon.com/pinpoint/).

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

## Configuration

In the Pinpoint console page, under *All projects*, find your Project name and the corresponding Project ID. You will also need to get your access key and secret access key, which you can find under the AWS Identity and Access Management (IAM) console under Access Keys. Note that you will need to provide AWS keys that have IAM permissions for Pinpoint operations.

Then, on the Radar [Integrations page](https://dashboard.radar.com/integrations) under *AWS Pinpoint*, set *Enabled* to *Yes* and paste your AWS access key, your AWS secret key, and your Pinpoint Project ID. You can set separate access keys and project IDs for each of your Radar *Test* and *Live* environments. Finally, select your AWS region.

Whenever events are generated, Radar will send custom events and user attributes to Pinpoint. Events and user attributes from iOS devices will be sent using your iOS app identifiers, and events and user attributes from Android devices will be sent using your Android app identifiers.

To map a Radar user to a Pinpoint endpoint ID, you must specify a custom mapping by setting Radar `metadata.awsPinpointEndpointId`. For example, on iOS:

```swift theme={null}
// track users with custom userId mapping (not required if using default mapping)
Radar.setMetadata(["awsPinpointEndpointId": endpointid])
```

## User mapping

Note that Radar uses the string `[]` to represent `null` user attribute values.

| Radar User Field                     | Pinpoint User Attribute                  | Type           | Example Value                              | Context Type                       |
| ------------------------------------ | ---------------------------------------- | -------------- | ------------------------------------------ | ---------------------------------- |
| `userId`                             | `UserId`                                 | string         | `"1"`                                      |                                    |
| `_id`                                | `RadarId`                                | array\[string] | `["5b2c0906f5874b001aecfd8d"]`             |                                    |
| `location.coordinates[1]`            | `RadarLocationLatitude`                  | array\[string] | `[39.525665]`                              |                                    |
| `location.coordinates[0]`            | `RadarLocationLongitude`                 | array\[string] | `[-76.350663]`                             |                                    |
| `locationAuthorization`              | `RadarLocationAuthorization`             | array\[string] | `["GRANTED_FOREGROUND"]`                   |                                    |
| `locationAccuracyAuthorization`      | `RadarLocationAccuracyAuthorization`     | array\[string] | `["FULL"]`                                 |                                    |
| `updatedAt`                          | `RadarUpdatedAt`                         | array\[string] | `["2018-06-22T15:23:39.000Z"]`             |                                    |
| `segments[*].externalId`             | `RadarSegmentExternalIds`                | array\[string] | `["starbucks-visitors"]`                   |                                    |
| `topChains[*].slug`                  | `RadarTopChainSlugs`                     | array\[string] | `["starbucks", "walmart"]`                 |                                    |
| `topChains[*].externalId`            | `RadarTopChainExternalIds`               | array\[string] | `["123", "456"]`                           |                                    |
| `geofences[*]._id`                   | `RadarGeofenceIds`                       | array\[string] | `["5b2c0906f5874b001aecfd8e"]`             | [Geofences](/geofencing/geofences) |
| `geofences[*].description`           | `RadarGeofenceDescriptions`              | array\[string] | `["Store #123"]`                           | [Geofences](/geofencing/geofences) |
| `geofences[*].tag`                   | `RadarGeofenceTags`                      | array\[string] | `["store"]`                                | [Geofences](/geofencing/geofences) |
| `geofences[*].externalId`            | `RadarGeofenceExternalIds`               | array\[string] | `["123"]`                                  | [Geofences](/geofencing/geofences) |
| `place._id`                          | `RadarPlaceId`                           | array\[string] | `["59302bcf8f27e8a156bd4f91"]`             | [Places](/geofencing/places)       |
| `place.name`                         | `RadarPlaceName`                         | array\[string] | `["Starbucks"]`                            | [Places](/geofencing/places)       |
| `place.categories`                   | `RadarPlaceCategories`                   | array\[string] | `["food-beverage", "cafe", "coffee-shop"]` | [Places](/geofencing/places)       |
| `place.chain.slug`                   | `RadarPlaceChainId`                      | array\[string] | `["starbucks"]`                            | [Places](/geofencing/places)       |
| `place.chain.name`                   | `RadarPlaceChainName`                    | array\[string] | `["Starbucks"]`                            | [Places](/geofencing/places)       |
| `country.code`                       | `RadarRegionCountryCode`                 | array\[string] | `["US"]`                                   | [Regions](/geofencing/regions)     |
| `country.name`                       | `RadarRegionCountryName`                 | array\[string] | `["United States"]`                        | [Regions](/geofencing/regions)     |
| `state.code`                         | `RadarRegionStateCode`                   | array\[string] | `["MD"]`                                   | [Regions](/geofencing/regions)     |
| `state.name`                         | `RadarRegionStateName`                   | array\[string] | `["Maryland"]`                             | [Regions](/geofencing/regions)     |
| `dma.code`                           | `RadarRegionDmaCode`                     | array\[string] | `["26"]`                                   | [Regions](/geofencing/regions)     |
| `dma.name`                           | `RadarRegionDmaName`                     | array\[string] | `["Baltimore"]`                            | [Regions](/geofencing/regions)     |
| `postalCode.code`                    | `RadarRegionPostalCode`                  | array\[string] | `["21014"]`                                | [Regions](/geofencing/regions)     |
| `trip.externalId`                    | `RadarTripExternalId`                    | array\[string] | `["299"]`                                  | [Trip Tracking](/geofencing/trips) |
| `trip.destinationGeofenceTag`        | `RadarTripDestinationGeofenceTag`        | array\[string] | `["store"]`                                | [Trip Tracking](/geofencing/trips) |
| `trip.destinationGeofenceExternalId` | `RadarTripDestinationGeofenceExternalId` | array\[string] | `["123"]`                                  | [Trip Tracking](/geofencing/trips) |
| `beacons[*]._id`                     | `RadarBeaconIds`                         | array\[string] | `["5b2c0906f5874b001aecfd8f"]`             | [Beacons](/geofencing/beacons)     |
| `beacons[*].description`             | `RadarBeaconDescriptions`                | array\[string] | `["Store #123 - Drive-Thru"]`              | [Beacons](/geofencing/beacons)     |
| `beacons[*].tag`                     | `RadarBeaconTags`                        | array\[string] | `["drive-thru"]`                           | [Beacons](/geofencing/beacons)     |
| `beacons[*].externalId`              | `RadarBeaconExternalIds`                 | array\[string] | `["123"]`                                  | [Beacons](/geofencing/beacons)     |

## Event mapping

### user.entered\_geofence

| Radar Event Field          | Pinpoint Event Attribute | Type    | Example Value                |
| -------------------------- | ------------------------ | ------- | ---------------------------- |
| `geofence._id`             | `GeofenceId`             | string  | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `GeofenceDescription`    | string  | `"Store #123"`               |
| `geofence.tag`             | `GeofenceTag`            | string  | `"store"`                    |
| `geofence.externalId`      | `GeofenceExternalId`     | string  | `"123"`                      |
| `geofence.metadata[{key}]` | `GeofenceMetadata{key}`  | string  | `"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 | Pinpoint Event Attribute | Type   | Example Value     |
| ----------------- | ------------------------ | ------ | ----------------- |
| `country.code`    | `CountryCode`            | string | `"US"`            |
| `country.name`    | `CountryName`            | string | `"United States"` |
| `state.code`      | `StateCode`              | string | `"MD"`            |
| `state.name`      | `StateName`              | string | `"Maryland"`      |
| `dma.code`        | `DmaCode`                | string | `"26"`            |
| `dma.name`        | `DmaName`                | string | `"Baltimore"`     |
| `postalCode.code` | `PostalCode`             | string | `"21014"`         |

### user.exited\_geofence

| Radar Event Field          | Pinpoint Event Attribute | Type    | Example Value                |
| -------------------------- | ------------------------ | ------- | ---------------------------- |
| `geofence._id`             | `GeofenceId`             | string  | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `GeofenceDescription`    | string  | `"Store #123"`               |
| `geofence.tag`             | `GeofenceTag`            | string  | `"store"`                    |
| `geofence.externalId`      | `GeofenceExternalId`     | string  | `"123"`                      |
| `geofence.metadata[{key}]` | `GeofenceMetadata{key}`  | string  | `"value"`                    |
| `confidence`               | `Confidence`             | string  | `"high"`                     |
| `duration`                 | `Duration`               | string  | `"42.1"`                     |
| `foreground`               | `Foreground`             | boolean | `true`                       |

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

| Radar Event Field | Pinpoint Event Attribute | Type   | Example Value     |
| ----------------- | ------------------------ | ------ | ----------------- |
| `country.code`    | `CountryCode`            | string | `"US"`            |
| `country.name`    | `CountryName`            | string | `"United States"` |
| `state.code`      | `StateCode`              | string | `"MD"`            |
| `state.name`      | `StateName`              | string | `"Maryland"`      |
| `dma.code`        | `DmaCode`                | string | `"26"`            |
| `dma.name`        | `DmaName`                | string | `"Baltimore"`     |
| `postalCode.code` | `PostalCode`             | string | `"21014"`         |

### user.dwelled\_in\_geofence

| Radar Event Field          | Pinpoint Event Attribute | Type    | Example Value                |
| -------------------------- | ------------------------ | ------- | ---------------------------- |
| `geofence._id`             | `GeofenceId`             | string  | `"5b2c0906f5874b001aecfd8e"` |
| `geofence.description`     | `GeofenceDescription`    | string  | `"Store #123"`               |
| `geofence.tag`             | `GeofenceTag`            | string  | `"store"`                    |
| `geofence.externalId`      | `GeofenceExternalId`     | string  | `"123"`                      |
| `geofence.metadata[{key}]` | `GeofenceMetadata{key}`  | string  | `"value"`                    |
| `confidence`               | `Confidence`             | string  | `"high"`                     |
| `duration`                 | `Duration`               | string  | `"5"`                        |
| `foreground`               | `Foreground`             | boolean | `true`                       |

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

| Radar Event Field | Pinpoint Event Attribute | Type   | Example Value     |
| ----------------- | ------------------------ | ------ | ----------------- |
| `country.code`    | `CountryCode`            | string | `"US"`            |
| `country.name`    | `CountryName`            | string | `"United States"` |
| `state.code`      | `StateCode`              | string | `"MD"`            |
| `state.name`      | `StateName`              | string | `"Maryland"`      |
| `dma.code`        | `DmaCode`                | string | `"26"`            |
| `dma.name`        | `DmaName`                | string | `"Baltimore"`     |
| `postalCode.code` | `PostalCode`             | string | `"21014"`         |

### user.entered\_place

| Radar Event Field             | Pinpoint Event Attribute  | Type                     | Example Value                      |
| ----------------------------- | ------------------------- | ------------------------ | ---------------------------------- |
| `place._id`                   | `PlaceId`                 | string                   | `"59302bcf8f27e8a156bd4f91"`       |
| `place.name`                  | `PlaceName`               | string                   | `"Starbucks"`                      |
| `place.chain.slug`            | `PlaceChainId`            | string                   | `"starbucks"`                      |
| `place.chain.name`            | `PlaceChainName`          | string                   | `"Starbucks"`                      |
| `place.chain.externalId`      | `PlaceChainExternalId`    | string                   | `"123"`                            |
| `place.chain.metadata[{key}]` | `PlaceChainMetadata{key}` | string                   | `"value"`                          |
| `place.categories`            | `PlaceCategories`         | 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 | Pinpoint Event Attribute | Type   | Example Value     |
| ----------------- | ------------------------ | ------ | ----------------- |
| `country.code`    | `CountryCode`            | string | `"US"`            |
| `country.name`    | `CountryName`            | string | `"United States"` |
| `state.code`      | `StateCode`              | string | `"MD"`            |
| `state.name`      | `StateName`              | string | `"Maryland"`      |
| `dma.code`        | `DmaCode`                | string | `"26"`            |
| `dma.name`        | `DmaName`                | string | `"Baltimore"`     |
| `postalCode.code` | `PostalCode`             | string | `"21014"`         |

### user.exited\_place

| Radar Event Field             | Pinpoint Event Attribute  | Type                     | Example Value                      |
| ----------------------------- | ------------------------- | ------------------------ | ---------------------------------- |
| `place._id`                   | `PlaceId`                 | string                   | `"59302bcf8f27e8a156bd4f91"`       |
| `place.name`                  | `PlaceName`               | string                   | `"Starbucks"`                      |
| `place.chain.slug`            | `PlaceChainId`            | string                   | `"starbucks"`                      |
| `place.chain.name`            | `PlaceChainName`          | string                   | `"Starbucks"`                      |
| `place.chain.externalId`      | `PlaceChainExternalId`    | string                   | `"123"`                            |
| `place.chain.metadata[{key}]` | `PlaceChainMetadata{key}` | string                   | `"string"`                         |
| `place.categories`            | `PlaceCategories`         | string (comma-separated) | `"food-beverage,cafe,coffee-shop"` |
| `confidence`                  | `Confidence`              | string                   | `"high"`                           |
| `duration`                    | `Duration`                | string                   | `"42.1"`                           |
| `foreground`                  | `Foreground`              | boolean                  | `true`                             |

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

| Radar Event Field | Pinpoint Event Attribute | Type   | Example Value     |
| ----------------- | ------------------------ | ------ | ----------------- |
| `country.code`    | `CountryCode`            | string | `"US"`            |
| `country.name`    | `CountryName`            | string | `"United States"` |
| `state.code`      | `StateCode`              | string | `"MD"`            |
| `state.name`      | `StateName`              | string | `"Maryland"`      |
| `dma.code`        | `DmaCode`                | string | `"26"`            |
| `dma.name`        | `DmaName`                | string | `"Baltimore"`     |
| `postalCode.code` | `PostalCode`             | string | `"21014"`         |

### user.entered\_region\_country

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value     |
| --------------------- | ------------------------ | ------- | ----------------- |
| `region.code`         | `RegionCode`             | string  | `"US"`            |
| `region.name`         | `RegionName`             | string  | `"United States"` |
| `confidence`          | `Confidence`             | string  | `"high"`          |
| `foreground`          | `Foreground`             | boolean | `true`            |

### user.exited\_region\_country

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value     |
| --------------------- | ------------------------ | ------- | ----------------- |
| `region.code`         | `RegionCode`             | string  | `"US"`            |
| `region.name`         | `RegionName`             | string  | `"United States"` |
| `confidence`          | `Confidence`             | string  | `"high"`          |
| `foreground`          | `Foreground`             | boolean | `true`            |

### user.entered\_region\_state

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value |
| --------------------- | ------------------------ | ------- | ------------- |
| `region.code`         | `RegionCode`             | string  | `"MD"`        |
| `region.name`         | `RegionName`             | string  | `"Maryland"`  |
| `confidence`          | `Confidence`             | string  | `"high"`      |
| `foreground`          | `Foreground`             | boolean | `true`        |

### user.exited\_region\_state

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value |
| --------------------- | ------------------------ | ------- | ------------- |
| `region.code`         | `RegionCode`             | string  | `"MD"`        |
| `region.name`         | `RegionName`             | string  | `"Maryland"`  |
| `confidence`          | `Confidence`             | string  | `"high"`      |
| `foreground`          | `Foreground`             | boolean | `true`        |

### user.entered\_region\_dma

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value |
| --------------------- | ------------------------ | ------- | ------------- |
| `region.code`         | `RegionCode`             | string  | `"26"`        |
| `region.name`         | `RegionName`             | string  | `"Baltimore"` |
| `confidence`          | `Confidence`             | string  | `"high"`      |
| `foreground`          | `Foreground`             | boolean | `true`        |

### user.exited\_region\_dma

| Radar Event Attribute | Pinpoint Event Attribute | Type    | Example Value |
| --------------------- | ------------------------ | ------- | ------------- |
| `region.code`         | `RegionCode`             | string  | `"26"`        |
| `region.name`         | `RegionName`             | string  | `"Baltimore"` |
| `confidence`          | `Confidence`             | string  | `"high"`      |
| `foreground`          | `Foreground`             | boolean | `true`        |

### user.started\_trip

| Radar Event Attribute                | Pinpoint Event Attribute            | Type    | Example Value |
| ------------------------------------ | ----------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `TripExternalId`                    | string  | `"299"`       |
| `trip.metadata[{key}]`               | `TripMetadata{key}`                 | string  | `"value"`     |
| `trip.destinationGeofenceTag`        | `TripDestinationGeofenceTag`        | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `TripDestinationGeofenceExternalId` | string  | `"123"`       |
| `foreground`                         | `Foreground`                        | boolean | `true`        |

### user.approaching\_trip\_destination

| Radar Event Attribute                | Pinpoint Event Attribute            | Type    | Example Value |
| ------------------------------------ | ----------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `TripExternalId`                    | string  | `"299"`       |
| `trip.metadata[{key}]`               | `TripMetadata{key}`                 | string  | `"value"`     |
| `trip.destinationGeofenceTag`        | `TripDestinationGeofenceTag`        | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `TripDestinationGeofenceExternalId` | string  | `"123"`       |
| `foreground`                         | `Foreground`                        | boolean | `true`        |

### user.arrived\_at\_trip\_destination

| Radar Event Attribute                | Pinpoint Event Attribute            | Type    | Example Value |
| ------------------------------------ | ----------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `TripExternalId`                    | string  | `"299"`       |
| `trip.metadata[{key}]`               | `TripMetadata{key}`                 | string  | `"value"`     |
| `trip.destinationGeofenceTag`        | `TripDestinationGeofenceTag`        | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `TripDestinationGeofenceExternalId` | string  | `"123"`       |
| `foreground`                         | `Foreground`                        | boolean | `true`        |

### user.stopped\_trip

| Radar Event Attribute                | Pinpoint Event Attribute            | Type    | Example Value |
| ------------------------------------ | ----------------------------------- | ------- | ------------- |
| `trip.externalId`                    | `TripExternalId`                    | string  | `"299"`       |
| `trip.metadata[{key}]`               | `TripMetadata{key}`                 | string  | `"value"`     |
| `trip.destinationGeofenceTag`        | `TripDestinationGeofenceTag`        | string  | `"store"`     |
| `trip.destinationGeofenceExternalId` | `TripDestinationGeofenceExternalId` | string  | `"123"`       |
| `foreground`                         | `Foreground`                        | boolean | `true`        |

### user.entered\_beacon

| Radar Event Attribute    | Pinpoint Event Attribute | Type    | Example Value                |
| ------------------------ | ------------------------ | ------- | ---------------------------- |
| `beacon._id`             | `BeaconId`               | string  | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `BeaconDescription`      | string  | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `BeaconTag`              | string  | `"drive-thru"`               |
| `beacon.externalId`      | `BeaconExternalId`       | string  | `"123"`                      |
| `beacon.metadata[{key}]` | `BeaconMetadata{key}`    | type    | `{value}`                    |
| `confidence`             | `Confidence`             | string  | `"high"`                     |
| `foreground`             | `Foreground`             | boolean | `true`                       |

### user.exited\_beacon

| Radar Event Attribute    | Pinpoint Event Attribute | Type             | Example Value                |
| ------------------------ | ------------------------ | ---------------- | ---------------------------- |
| `beacon._id`             | `BeaconId`               | string           | `"5b2c0906f5874b001aecfd8f"` |
| `beacon.description`     | `BeaconDescription`      | string           | `"Store #123 - Drive-Thru"`  |
| `beacon.tag`             | `BeaconTag`              | string           | `"drive-thru"`               |
| `beacon.externalId`      | `BeaconExternalId`       | string           | `"123"`                      |
| `beacon.metadata[{key}]` | `BeaconMetadata{key}`    | type             | `{value}`                    |
| `confidence`             | `Confidence`             | string           | `"high"`                     |
| `duration`               | `Duration`               | number (minutes) | `1.42`                       |
| `foreground`             | `Foreground`             | boolean          | `true`                       |
