Use Amplitude for both your [Analytics](https://amplitude.com/amplitude-analytics) and [CDP](https://amplitude.com/customer-data-platform) needs. This document covers the steps to:

1. Migrate your Source and Destination configuration.
2. Update SDK implementation to send data to Amplitude.
3. Validate the migration is successful.

The following table maps mParticle offerings to their Amplitude equivalents.

| mParticle                                                                         | Amplitude |
|-----------------------------------------------------------------------------------| ----------- |
| [Connections](https://docs.mparticle.com/guides/platform-guide/connections/)      | [Sources](/docs/data/source-catalog) & [Destinations](/docs/data/destination-catalog/) |
| [Audiences](https://docs.mparticle.com/guides/platform-guide/audiences/overview/) | [Audiences](https://help.amplitude.com/hc/en-us/sections/360011146031-Amplitude-Audiences) |
|                                                                              | [Data Management](https://help.amplitude.com/hc/en-us/categories/5078631395227-Amplitude-CDP) |

{% callout type="info" heading="Recommended best practice" %}
Follow a strict release process and [configure multiple environments](/docs/data/amplitude-data-settings). Validate changes within each environment before deploying.
{% /callout %}

## Add a source

To add a [new source](/docs/data/source-catalog):

1. From Data, click **Sources** in the Connections section.
2. Click **Add Source**.
3. Browse or search for the source you want to add.
4. Follow the on-screen prompts.

For detailed instructions, refer to the documentation for the [source](/docs/data/source-catalog) you want to add.

## Update SDK implementation

Both mParticle and Amplitude SDKs capture first-party data by tracking user interactions. Aside from syntax differences, they work similarly. The following table maps concepts between mParticle and Amplitude.

| mParticle | Amplitude | Notes                                      |
|-----------|-----------|--------------------------------------------|
| app_key   | api_key   | Unique key to validate source of the data. |
| Workspace | Project   | [Projects](/docs/admin/account-management/manage-orgs-projects) allow you to organize your data.  |
| User      | User      | User who is performing action.             |
| Identify  | Identify  | Identify updates properties/attributes of the user.|
| Event     | Event     | Events track the action user is performing.|
| Screen    | Event     | Create an Event to track Screen views.|
| Page      | Event     | Create an Event to track Page views.|
|           | Group     | A Group is a collection of users. In Amplitude, one user can belong to multiple groups. Each group can have properties available to query or forward on actions performed by any user in the group.|
| Kits      | Plugins   | Plugins extend Amplitude by running custom code on every event.|


{% tabs tabs="Browser, iOS, Android" %}
{% tab name="Browser" %}
Documentation for [Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2).

### Identify

#### mParticle
```typescript
var identityRequest = {
userIdentities: { email: 'updated-email@example.com' }
}
mParticle.Identity.modify(identityRequest, identityCallback);
```

#### Amplitude
```typescript
setUserId('12091906-01011992');
identify(
  Identify()
    .set('email', 'updated-email@example.com')
);
```

### Track

#### mParticle

```typescript
mParticle.logEvent('Article Completed',
    mParticle.EventType.EVENT-TYPE,
    {
        'title':'How to Create a Tracking Plan',
        'course':'Intro to Analytics'}
);
``` 

#### Amplitude

```typescript
track('Article Completed', {
  title: 'How to Create a Tracking Plan',
  course: 'Intro to Analytics',
});
``` 

### Group  

#### Amplitude
Assign user to a group:
```typescript
amplitude.setGroup('Working Group', 'UNIVAC')
```

Update properties of a group:
```typescript
groupIdentify(
  'Working Group',
  'UNIVAC' ,
  new Identify()
    .set('principles', ['Eckert', 'Mauchly']);
    .set('site', 'Eckert–Mauchly Computer Corporation');
    .set('statedGoals', 'Develop the first commercial computer');
    .set('industry', 'Technology')
);
``` 

{% /tab %}
{% tab name="iOS" %}
Documentation for [iOS Swift SDK](/docs/sdks/analytics/ios/ios-swift-sdk).

### Identify

#### mParticle
```swift
currentUser?.setUserAttribute("top_region", value: "Europe")
```     

#### Amplitude
```swift
Amplitude.instance().setUserId("abc")
Amplitude.instance().identify(
  AMPIdentify()
    .set("top_region", value: "Europe")
)
```

### Track

#### mParticle

```swift
if let event = MPEvent(name: "Video Watched", type: MPEventType.navigation) {
event.customAttributes = ["category": "Destination Intro", "title": "Paris"]
MParticle.sharedInstance().logEvent(event)
}
``` 

#### Amplitude

```swift
Amplitude.instance().logEvent("Video Watched", withEventProperties: ["category": "Destination Intro", "title": "Paris"] )
``` 

### Group

#### Amplitude
Assign user to a group:
```swift
Amplitude.instance().setGroup("orgName", groupName:NSString(string:"xyz"))
```
Update properties of a group:
```swift
Amplitude.instance().groupIdentifyWithGroupType(
  "orgName",
  groupName:NSString(string:"xyz"),
  groupIdentify:AMPIdentify().set("plan", value: "enterprise")
)
```

{% /tab %}
{% tab name="Android" %}
Documentation for [Android Kotlin SDK](/docs/sdks/analytics/android/android-kotlin-sdk).

### Identify

#### mParticle
```kotlin
IdentityApiRequest modifyRequest = IdentityApiRequest.withEmptyUser()
    .email("updated-email@example.com")
    .build()

MParticle.getInstance().Identity().modify(modifyRequest)
```

#### Amplitude
```kotlin
amplitude.setUserId("abc")
amplitude.identify(Identify().set("email", "updated-email@example.com"))
```

### Track

#### mParticle
```kotlin
val customAttributes: MutableMap<String, String> = HashMap()
customAttributes["name"] = "Moto 360"
val event = MPEvent.Builder("Product Viewed", MParticle.EventType.Navigation)
            .customAttributes(customAttributes)
            .build()
MParticle.getInstance()?.logEvent(event)
``` 

#### Amplitude
```kotlin
amplitude.track(
  "Product Viewed",
  mutableMapOf<String, Any?>("name" to "Moto 360")
)
``` 

### Group

#### Amplitude
Assign user to a group:
```kotlin
amplitude.setGroup("orgName", "xyz");
```
Update properties of a group:
```kotlin
amplitude.groupIdentify("orgName", "xyz", Identify().set("plan", "enterprise"))
```

{% /tab %}
{% /tabs %}
 
For all other SDKs, refer to the relevant [SDK documentation](/docs/sdks/analytics).

## Validate events

Data validation is a critical step in the instrumentation process. Validate your event data using Amplitude's debugging [tools](/docs/analytics/debug-analytics).

## Add a destination

To add a [new destination](/docs/data/destination-catalog):

1. From Data, click **Destinations** in the Connections section. 
2. Click **Add Destination**.
3. Browse or search for the destination you want to add. 
4. Follow the on-screen prompts. 

For detailed instructions, refer to the documentation for the [destination](/docs/data/destination-catalog) you want to add. 

## Migration checklist

Validate the migration to minimize impact on downstream data consumers. 

- [x] Added all sources to Amplitude
- [x] Migrated existing tracking code to Amplitude SDKs
- [x] Validated events are flowing in to Amplitude correctly
- [x] Added all destinations to Amplitude
- [x] Validated data is flowing into destinations correctly
- [x] Validated downstream consumers aren't affected (for example, BI, Mktg, ML, Ops)

## Frequently asked questions


{% accordion title="How long does it take to migrate?" %}
Migration time depends on how you implemented your CDP. However, generally, plan a minimum of two month to complete the migration. Updating your taxonomy and tracking plan can require more upfront planning.
{% /accordion %}

{% accordion title="What if I don't see an integration that I need?" %}
Amplitude regularly adds new integrations. Add a request in the product or ask your CSM for a timeline.
{% /accordion %}

{% accordion title="What if I have an existing CDP contract?" %}
Contact your CSM or AE to discuss available options.
{% /accordion %}



