> For the complete documentation index, see [llms.txt](https://docs.amply.tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amply.tools/integrations/amplitude.md).

# Amplitude

Send the events you already track in Amplitude to Amply, so campaigns can start from them.

The direction is one way: Amplitude to Amply. Campaign events do not flow back into Amplitude.

There is a plugin for each platform. You add it to your Amplitude client with one line, and you make no second `track` calls. The three plugins share the same options and the same rules. This page shows each code sample in three tabs, and says when a platform behaves differently.

**Use the plugin when** your app tracks with Amplitude and you want campaigns to react to the same events. **Don't use it when** you only need a few Amply-specific events: call Amply's `track` for those, see [Tracking events](https://docs.amply.tools/developer-guide/tracking-events.md).

## Install

{% tabs %}
{% tab title="React Native" %}

```ts
import * as amplitude from '@amplitude/analytics-react-native';
import {amplyPlugin} from '@amplytools/react-native-amply-sdk/amplitude';

amplitude.init('YOUR_AMPLITUDE_API_KEY');
amplitude.add(amplyPlugin());
```

The plugin ships inside the Amply package and has its own import path, `@amplytools/react-native-amply-sdk/amplitude`. An app that does not import it carries none of its code.

Add it next to `amplitude.init`. It does not have to wait for Amply: events wait in memory, up to 100, in order. If more arrive, the oldest events are dropped first; user changes are kept. If the app is killed during that wait, they are lost.

Adding the plugin twice to one client changes nothing. Amply has one user, so add the plugin to one Amplitude client. If several clients track the same user, call `amplyPlugin()` once per client and pass `syncUserId: false` to all but one. If clients track different users, keep the plugin on one of them: events from the others would land on that one's user.

Requirements:

* `@amplitude/analytics-react-native` 1.5.16 or newer.
* Amply React Native SDK 0.17.0 or newer. Lists in user properties and `forwardArraysAsSets` need 0.19.0 or newer.

Upgrading from an older Amply SDK in an app that keeps its `ios` folder: before React Native SDK 0.18.0, `Podfile.lock` pinned the old native SDK and `pod install` refused the new one. Run `pod update AmplySDK` once, or prebuild with `--clean` in Expo. From 0.18.0 on, `pod install` is enough.

The plugin adds no dependency. It works with the Amplitude package your app already has.

In Expo Go there is no Amply native module. The plugin warns once and does nothing, and your app keeps running. Test it in a development build or on a device.
{% endtab %}

{% tab title="iOS (Swift)" %}
The plugin is a Swift package. In Xcode: **File → Add Package Dependencies…**, enter the URL below and add the `AmplyAmplitude` product to your target.

```
https://github.com/amply-tools/amply-amplitude-ios
```

Or in `Package.swift`:

```swift
.package(url: "https://github.com/amply-tools/amply-amplitude-ios", from: "0.18.0")

// target dependency
.product(name: "AmplyAmplitude", package: "amply-amplitude-ios")
```

Create Amply as usual, then add the plugin to your Amplitude instance:

```swift
import AmplitudeSwift
import AmplyAmplitude
import AmplySDK

let amply = Amply(config: amplyConfig)
let amplitude = Amplitude(configuration: Configuration(apiKey: "YOUR_AMPLITUDE_API_KEY"))

amplitude.add(plugin: AmplyAmplitudePlugin(amply: amply))
```

The plugin takes your `Amply` instance, so create Amply first. The plugin has no start-up queue: from that line on, events reach Amply on Amplitude's own background queue, shortly after `track` returns.

Add the plugin once per Amplitude instance. Amply has one user, so add it to one instance; if several track the same user, turn `syncUserId` off on all but one.

Requirements:

* iOS 14 or newer.
* AmplitudeSwift 1.9.0 or newer.
* Amply iOS SDK 0.18.0 or newer. The package brings `AmplySDK` from its own Swift package.

The plugin is available through Swift Package Manager only, not CocoaPods.
{% endtab %}

{% tab title="Android (Kotlin)" %}
Add the plugin next to the Amply SDK in your app module's `build.gradle.kts`:

```kotlin
dependencies {
    implementation("tools.amply:sdk-android:0.18.0")
    implementation("tools.amply:sdk-android-amplitude:0.18.0")
}
```

Keep both at the same version. Create Amply as usual, then add the plugin to your Amplitude client:

```kotlin
import com.amplitude.android.Amplitude
import com.amplitude.android.Configuration
import tools.amply.sdk.amplitude.AmplyAmplitudePlugin

val amplitude = Amplitude(
    Configuration(apiKey = "YOUR_AMPLITUDE_API_KEY", context = applicationContext)
)
amplitude.add(AmplyAmplitudePlugin(amply))
```

The plugin takes your `Amply` instance, so create Amply first. The plugin has no start-up queue: from that line on, events reach Amply on Amplitude's own background queue, shortly after `track` returns.

Add the plugin once per Amplitude client. Amply has one user, so add it to one client; if several track the same user, turn `syncUserId` off on all but one.

Requirements:

* `com.amplitude:analytics-android` 1.16.0 or newer. The plugin adds no Amplitude dependency of its own; it runs with the version your app has.
* Amply Android SDK 0.18.0 or newer.
* Amplitude needs the `ACCESS_NETWORK_STATE` permission in your manifest. Older Amplitude versions crash without it.
  {% endtab %}
  {% endtabs %}

{% hint style="info" %}
**Kotlin Multiplatform apps** add the plugin on each side: the Maven artifact `tools.amply:sdk-android-amplitude` in the Android app, and the Swift package `amply-amplitude-ios` in the iOS app.
{% endhint %}

## Options

Every option has the same name on all three platforms, in that platform's style. All of them are optional.

| Option                | Default | What it does                                                                                         |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `events`              | all     | Which events go to Amply, by name. See [Choosing events](#choosing-events).                          |
| `eventProperties`     | all     | Which event properties go along, by key.                                                             |
| `filter`              | none    | A function that decides per event, after the lists. See [Filter](#filter).                           |
| `transform`           | none    | A function that renames an event or changes its properties. See [Renaming events](#renaming-events). |
| `autocapture`         | none    | Amplitude's automatic events to keep. See [Automatic events](#automatic-events).                     |
| `syncUserId`          | on      | Follow Amplitude's user id. See [User identity](#user-identity).                                     |
| `userProperties`      | none    | Which user properties to copy. See [User properties](#user-properties).                              |
| `forwardArraysAsSets` | off     | Send list event properties as sets of strings. See [List event properties](#list-event-properties).  |
| `debug`               | off     | Log what the plugin skipped and why.                                                                 |

On iOS and Android, pass them in `AmplyAmplitudeOptions`:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(amplyPlugin({debug: true}));
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
amplitude.add(plugin: AmplyAmplitudePlugin(amply: amply, options: AmplyAmplitudeOptions(debug: true)))
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
amplitude.add(AmplyAmplitudePlugin(amply, AmplyAmplitudeOptions(debug = true)))
```

{% endtab %}
{% endtabs %}

## What goes to Amply by default

* Every event your app tracks with Amplitude. Names and properties arrive unchanged: `Plan Selected` stays `Plan Selected`. Amply's convention is `PascalCase`; see [Renaming events](#renaming-events).
* Amplitude's own service events (`$identify`, `$groupidentify`, `session_start`, `session_end`) do not become Amply events.
* Amplitude's automatic events do not go, see [Automatic events](#automatic-events).
* User properties do not go, see [User properties](#user-properties).
* Nothing is sent while the user has opted out of Amplitude tracking.
* The plugin never changes or drops anything on Amplitude's side.

## Choosing events

Name the events to keep out of Amply with `exclude`. Everything else goes. Or name the only events that should go, with `include`.

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(
  amplyPlugin({
    events: {exclude: ['Scroll Tick', /^debug_/]},
  }),
);

amplitude.add(
  amplyPlugin({
    events: {include: ['Plan Selected', 'Purchase Completed', /^Onboarding /]},
  }),
);
```

An entry is an exact name or a regular expression, in the same list.
{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(
    events: NameLists(
        exclude: ["Scroll Tick"],
        excludePatterns: [try! NSRegularExpression(pattern: "^debug_")]
    )
)

AmplyAmplitudeOptions(
    events: NameLists(
        include: ["Plan Selected", "Purchase Completed"],
        includePatterns: [try! NSRegularExpression(pattern: "^Onboarding ")]
    )
)
```

Exact names and patterns go in separate fields: `include`, `includePatterns`, `exclude`, `excludePatterns`.
{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(
    events = NameLists(
        exclude = setOf("Scroll Tick"),
        excludePatterns = listOf(Regex("^debug_")),
    ),
)

AmplyAmplitudeOptions(
    events = NameLists(
        include = setOf("Plan Selected", "Purchase Completed"),
        includePatterns = listOf(Regex("^Onboarding ")),
    ),
)
```

Exact names and patterns go in separate fields: `include`, `includePatterns`, `exclude`, `excludePatterns`.
{% endtab %}
{% endtabs %}

A pattern matches anywhere in the name. Anchor it with `^` and `$` to match the whole name. Names are matched as you see them in Amplitude, before a `transform` renames anything. You can use both lists: `exclude` wins over `include`. An empty `include` sends nothing.

Keep chatty events out of Amply. Every event is stored on the device once it reaches Amply and counts toward [the limits below](#limits).

### Choosing properties

`eventProperties` takes the same lists, for property keys. Use it to keep a key out of Amply, or to send only the keys your campaigns use:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(
  amplyPlugin({
    eventProperties: {exclude: ['first_name', /phone/]},
  }),
);
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(
    eventProperties: NameLists(
        exclude: ["first_name"],
        excludePatterns: [try! NSRegularExpression(pattern: "phone")]
    )
)
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(
    eventProperties = NameLists(
        exclude = setOf("first_name"),
        excludePatterns = listOf(Regex("phone")),
    ),
)
```

{% endtab %}
{% endtabs %}

A key the lists drop is gone before `filter` and `transform` see the event.

### Filter

For a rule the lists cannot express, for example one that depends on a property value, use `filter`. Return `true` to let an event through. Anything else, or an error, keeps it out. `filter` runs after the lists.

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(
  amplyPlugin({
    filter: (e) => e.event_properties?.source !== 'test',
  }),
);
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(
    filter: { event in (event.eventProperties["source"] as? String) != "test" }
)
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(
    filter = { event -> event.eventProperties["source"] != "test" },
)
```

{% endtab %}
{% endtabs %}

`filter` and `transform` get a copy of the event. Changing it does not change what Amplitude sends.

## Automatic events

Amplitude's automatic events (names that start with `[Amplitude]` , such as screen views, clicks and network requests) are off by default. List the ones you want in `autocapture`, by full name:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(
  amplyPlugin({
    autocapture: ['[Amplitude] Screen Viewed'],
  }),
);
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(autocapture: ["[Amplitude] Screen Viewed"])
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(autocapture = setOf("[Amplitude] Screen Viewed"))
```

{% endtab %}
{% endtabs %}

The event reaches Amply as `Screen Viewed`. The `[Amplitude]` prefix is removed from the name and from the property keys, so `[Amplitude] Screen Name` becomes `Screen Name`. `filter` and `transform` see the event after the prefix is removed. The `events` and `eventProperties` lists match the full name, with the prefix: `exclude: ['[Amplitude] Screen Viewed']`.

## User identity

The plugin follows Amplitude's user id. When the app sets a user id in Amplitude, Amply switches to that user before the next event goes out, so a login needs nothing from you.

A logout needs two calls of yours next to `reset()`, to clear Amply's user and its custom properties:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.reset();
Amply.setUserId(null);
Amply.clearCustomProperties();
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
amplitude.reset()
amply.setUserId(userId: nil)
amply.clearCustomProperties()
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
amplitude.reset()
amply.setUserId(null)
amply.clearCustomProperties()
```

{% endtab %}
{% endtabs %}

The plugin does not pass the logout to Amply at the moment of `reset()`. Without your `setUserId(null)`, Amply learns about the logout with the next event in the same launch. If the app closes first, Amply keeps the old user until the next sign-in.

An empty user id in Amplitude does not log anyone out of Amply by itself. Only a logout the plugin saw does, or your own `setUserId(null)`.

Switching user clears the previous user's last campaign touches, see Last campaign touch in the [iOS](https://docs.amply.tools/reference/sdk-ios.md#last-campaign-touch), [Android](https://docs.amply.tools/reference/sdk-android.md#last-campaign-touch) or [React Native](https://docs.amply.tools/reference/sdk-react-native.md#last-campaign-touch) reference.

Turn `syncUserId` off when:

* your app sets Amply's user itself with `setUserId`, or
* your own Amplitude plugin rewrites the user id, or
* your logout does not clear Amplitude's user, for example you avoid `amplitude.reset()` because it rotates the device id other tools read. Otherwise the plugin and your code disagree about the user; in React Native the next event brings the old user back. Keep `setUserId` yourself.

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(amplyPlugin({syncUserId: false}));
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(syncUserId: false)
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(syncUserId = false)
```

{% endtab %}
{% endtabs %}

With `syncUserId` off, call `setUserId` yourself, see [User attributes](https://docs.amply.tools/developer-guide/user-attributes.md).

## User properties

Amplitude user properties are not copied by default. They often hold emails and names.

Opt in with a list of keys, with `include` / `exclude` lists, or with a function that gets the key and the value and returns `true` to copy it:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(amplyPlugin({userProperties: ['plan', 'subscription_status']}));

// every key except some
amplitude.add(amplyPlugin({userProperties: {exclude: ['email', 'name']}}));

// a function
amplitude.add(amplyPlugin({userProperties: (key) => key.startsWith('amply_')}));
```

`{include: [...]}` works like the plain list. Entries in `include` and `exclude` are exact keys or regular expressions, the same as for events.
{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(userProperties: .keys(["plan", "subscription_status"]))

// every key except some
AmplyAmplitudeOptions(userProperties: .lists(NameLists(exclude: ["email", "name"])))

// a function
AmplyAmplitudeOptions(userProperties: .matching { key, _ in key.hasPrefix("amply_") })
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(userProperties = UserProperties.Keys(setOf("plan", "subscription_status")))

// every key except some
AmplyAmplitudeOptions(userProperties = UserProperties.Lists(NameLists(exclude = setOf("email", "name"))))

// a function
AmplyAmplitudeOptions(userProperties = UserProperties.Matching { key, _ -> key.startsWith("amply_") })
```

{% endtab %}
{% endtabs %}

Amply stores what it copies as custom properties, which you can use in audiences, see [User attributes](https://docs.amply.tools/developer-guide/user-attributes.md). The plugin copies these Amplitude operations:

| Amplitude                                          | In Amply                                                                                                                    |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `$set` of a single value                           | sets the custom property                                                                                                    |
| `$set` of a list                                   | sets the custom property to a [set of strings](https://docs.amply.tools/developer-guide/user-attributes.md#sets-of-strings) |
| `$unset`                                           | removes the custom property                                                                                                 |
| `$append`, `$prepend`, `$preInsert`, `$postInsert` | adds the items to the set                                                                                                   |
| `$remove`                                          | removes the items from the set                                                                                              |
| `$setOnce`, `$add`, `$clearAll`                    | nothing                                                                                                                     |

An Amplitude `$clearAll` does nothing in Amply.

A single value is copied only if it is a string up to 255 characters, a finite number or a boolean, and its key is up to 32 characters. Anything else is dropped. Long values are not cut, because a cut value in targeting is worse than none.

A list is copied only if every item is text or a finite number. Numbers become text: `1`, not `1.0`. A list with anything else in it, such as a boolean or `null`, is not copied. The set then follows Amply's [rules for sets](https://docs.amply.tools/developer-guide/user-attributes.md#sets-of-strings): each item once, no order, at most 100 items. A list that breaks them is refused whole, and the property keeps its previous value.

A set in Amply differs from a list in Amplitude in two ways. It holds each item once, so two `$append` calls with the same item leave it in the set once. And it lives on the device: Amply does not merge it with the same user's lists from other devices.

A `userProperties` function gets the value as it would be copied. For a list operation such as `$append`, that is the items being added, not the whole list.

{% hint style="info" %}
**React Native SDK 0.19.0 changes what is copied.** Before 0.19.0 the plugin dropped `$set` with a list and ignored `$append`, `$prepend`, `$preInsert`, `$postInsert` and `$remove`. If your `userProperties` choice lets list keys through, those keys start arriving in Amply as sets after the update.
{% endhint %}

## List event properties

An event property that holds a list, such as `genres: ['jazz', 'rock']`, reaches Amply as one text: `jazz,rock`. Turn on `forwardArraysAsSets` to send it as a set of strings instead, so a campaign can check whether the list contains a value:

{% tabs %}
{% tab title="React Native" %}

```ts
amplitude.add(amplyPlugin({forwardArraysAsSets: true}));
```

Needs Amply React Native SDK 0.19.0 or newer.
{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(forwardArraysAsSets: true)
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(forwardArraysAsSets = true)
```

{% endtab %}
{% endtabs %}

Items that are numbers become text: `1`, not `1.0`. A list Amply cannot keep as a set is left out of the event, and the event still goes: more than 25 items, over 16 KB, an empty item, an item over 255 characters, or a boolean or `null` in it. See [sets of strings in events](https://docs.amply.tools/developer-guide/tracking-events.md#sets-of-strings).

The option is off by default because it changes what existing campaigns see. A campaign that compares such a property with a text like `jazz,rock` stops matching once the property arrives as a set. Check those campaigns before you turn it on.

## Renaming events

`transform` changes the name or the properties of an event.

{% tabs %}
{% tab title="React Native" %}
`transform` returns an object with `name`, `properties` or both. A field you leave out stays as it was. Returning `properties` replaces all of them, so merge the old ones in if you want to keep them:

```ts
amplitude.add(
  amplyPlugin({
    transform: (e) => ({
      name: e.event_type === 'Plan Selected' ? 'PlanSelected' : e.event_type,
      properties: {...e.event_properties, plan_id: e.event_properties?.planId},
    }),
  }),
);
```

If `transform` throws or returns a non-object, the event is dropped.
{% endtab %}

{% tab title="iOS (Swift)" %}
`transform` returns a `ForwardedEvent`, or `nil` to drop the event. Its `properties` replace the event's properties, and they are empty unless you pass them, so pass the old ones to keep them:

```swift
AmplyAmplitudeOptions(transform: { event in
    var properties = event.eventProperties
    properties["plan_id"] = event.eventProperties["planId"]
    let name = event.eventType == "Plan Selected" ? "PlanSelected" : event.eventType
    return ForwardedEvent(name: name, properties: properties)
})
```

If `transform` throws, the event is dropped.
{% endtab %}

{% tab title="Android (Kotlin)" %}
`transform` returns a `ForwardedEvent`, or `null` to drop the event. Its `properties` replace the event's properties, and they are empty unless you pass them, so pass the old ones to keep them:

```kotlin
AmplyAmplitudeOptions(
    transform = { event ->
        ForwardedEvent(
            name = if (event.eventType == "Plan Selected") "PlanSelected" else event.eventType,
            properties = event.eventProperties + ("plan_id" to event.eventProperties["planId"]),
        )
    },
)
```

If `transform` throws, the event is dropped.
{% endtab %}
{% endtabs %}

If your campaigns already listen for `PascalCase` names, use `pascalCaseEventName`. `Plan Selected` and `plan_selected` both become `PlanSelected`:

{% tabs %}
{% tab title="React Native" %}

```ts
import {amplyPlugin, pascalCaseEventName} from '@amplytools/react-native-amply-sdk/amplitude';

amplitude.add(
  amplyPlugin({
    transform: (e) => ({name: pascalCaseEventName(e.event_type)}),
  }),
);
```

{% hint style="warning" %}
Do not pass `pascalCaseEventName` as `transform` itself. `transform` must return an object, and a plain string makes the plugin drop the event.
{% endhint %}
{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
AmplyAmplitudeOptions(transform: { event in
    ForwardedEvent(name: pascalCaseEventName(event.eventType), properties: event.eventProperties)
})
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
AmplyAmplitudeOptions(
    transform = { event -> ForwardedEvent(pascalCaseEventName(event.eventType), event.eventProperties) },
)
```

{% endtab %}
{% endtabs %}

## If your app already forwards to Amply

If a wrapper already sends each Amplitude event to Amply, such as a `track` function that calls both SDKs, use the wrapper or the plugin, not both. Remove the wrapper's Amply call in the same change that adds the plugin. With both, every event reaches Amply twice.

Event names stay as your wrapper sent them. If the wrapper converted them to `PascalCase`, add `transform` with `pascalCaseEventName` so live campaigns keep matching.

Amply's own event names, such as `CampaignShown`, are dropped anyway (see [Limits](#limits)). If your app forwards them into Amplitude under other names, for example with an `Amply` prefix, those come back through the plugin as custom events. Exclude them, for example with the pattern `^Amply` in the `events` exclusions.

The plugin replaces only event forwarding. The logout call above, custom properties and gated calls stay in your wrapper.

Moving from a wrapper changes a few values:

* A string over 255 characters is cut.
* A key up to 100 characters stays whole, where your wrapper may have cut it. A campaign on a cut key name stops matching.
* A list with an object in it is dropped whole. If your wrapper turned such lists into text, do the same in [`transform`](#renaming-events) and return the converted properties.

Check one event in [Testing your integration](https://docs.amply.tools/developer-guide/testing-your-integration.md) before you ship.

## Limits

Amply protects itself and your campaigns from noisy event streams. Events that break a rule are dropped without an error in your app. `debug` logs what the plugin itself skips (by the lists, `filter`, `transform` or `autocapture`): to the console in React Native, to Logcat under the `Amply` tag on Android, and with an `[Amply]` prefix on iOS. Rejections by the limits below appear in the Amply debug log, and volume drops warn once per event name.

* **Reserved names.** Events named like Amply's own (for example `CampaignShown`) are dropped. Names are matched case-sensitively. This stops loops where Amply's events come back through Amplitude.
* **Name.** Names are trimmed first. An empty or whitespace-only name is rejected. A name over 255 characters or with control characters is rejected.
* **Property keys.** Empty keys and keys longer than 100 characters are dropped. These keys are dropped too, in any letter case: `email`, `phone`, `address`, `ip`, `full_name`, `firstname`, `lastname`. Other keys are forwarded, so drop them with `eventProperties` if they hold personal data.
* **Property values.** Strings are cut to 255 characters. Empty strings are kept. `null` (and `undefined` in JavaScript) is dropped. Finite numbers and booleans pass. Dates become epoch milliseconds. A list of simple values becomes one comma-separated string, or a set of strings with [`forwardArraysAsSets`](#list-event-properties). A list with a `null`, a non-finite number or a nested value is dropped whole. Nested objects, lists of objects and class instances are dropped.
* **Property count.** Up to 50 properties per event. The first 50 are kept.
* **Volume.** At most 60 events a minute with the same name, and 300 a minute in total. Events over the limit are dropped. The limit cannot be changed.

## Edge cases with timing

* **Track, then change the user right away.** Events reach Amply shortly after `amplitude.track` returns, on Amplitude's own queue. A direct Amply call right after a `track` overtakes that event. In React Native, for example, `track('Logged Out'); Amply.setUserId(null); Amply.clearCustomProperties()` records the event after the wipe, measured 11 to 16 ms later. The same holds for `amplitude.reset()` (the event reaches Amply after the logout, without a user) and for `setUserId`, `setCustomProperty` and `clearCustomProperties`. A campaign that fires on such an event should expect the wiped state unless you wait. If that matters, wait before changing the user:

  ```ts
  amplitude.track('Logged Out');
  await new Promise((r) => setTimeout(r, 500));
  amplitude.reset();
  Amply.setUserId(null);
  ```

  In React Native, do not wait for `amplitude.track(...).promise` instead. It settles only after Amplitude has uploaded the event to its own servers, which usually takes longer than any reasonable cap. Half a second is far more than the plugin needs.
* **Your own slow enrichment plugin.** If your own Amplitude plugin enriches events slowly and the user id, opt-out or a `flush()` changes meanwhile, the event can arrive without an id or under the new one. If that matters, turn `syncUserId` off and call `setUserId` yourself.
* **The result of `track` (React Native).** `amplitude.track(x).promise` resolves with the result of the first destination in the list, and Amply is usually first, so it can read `{code: 200, message: 'amply'}` even when Amplitude's upload failed. If your code reads that result, do not rely on it for delivery to Amplitude.

## What the plugin does not replace

* **Gated tracking.** Waiting for a campaign decision before the app continues needs `trackGated`, see [Gating actions](https://docs.amply.tools/developer-guide/gating-actions.md).
* **Deeplinks.** Campaign links still reach your app through Amply's listener, see [Handling deeplinks](https://docs.amply.tools/developer-guide/handling-deeplinks.md).

## Related

* [Tracking events](https://docs.amply.tools/developer-guide/tracking-events.md) — events you send to Amply directly
* [User attributes](https://docs.amply.tools/developer-guide/user-attributes.md) — user id, custom properties and sets of strings
* [React Native SDK reference](https://docs.amply.tools/reference/sdk-react-native.md) — the React Native plugin's options
* [Testing your integration](https://docs.amply.tools/developer-guide/testing-your-integration.md) — confirm events are landing
