> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/activate/event-streaming/destinations/analytics/amplitude.md).

# Amplitude

Amplitude is a product analytics platform. Chord sends events to Amplitude from the browser and from the server. The two versions share the same default event routing and custom action mappings.

## What each version does

* [**Amplitude browser**](/activate/event-streaming/destinations/analytics/amplitude/amplitude-browser.md) loads the Amplitude SDK in the shopper's browser. It enables session tracking and real-time event capture. In the destination catalog in Chord, you add it as **Amplitude (Device Mode)**.
* [**Amplitude server**](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md) uses Amplitude's HTTP API v2. Events are sent from Chord's servers directly to Amplitude. In the destination catalog in Chord, you add it as **Amplitude (Cloud Mode)**.

## Why use both

The browser version catches on-page behavior and passes the shopper's session along to the server version. The server version survives ad blockers and closed tabs.

Turn on the browser version even if you only send events from the server version. It is needed for accurate session tracking. With it on, each Chord event carries `context.clientIds.amplitudeSessionId`, which holds the shopper's current session ID.

{% hint style="warning" %}
If you want to use Amplitude's advanced features, such as [Autocapture](https://amplitude.com/docs/data/autocapture) and [Visual Labeling](https://amplitude.com/docs/data/visual-labeling), reach out to <help@chord.co> first. The implementation varies.
{% endhint %}

## Default event routing

Both versions use the same default routing. The version pages say how each one carries it out.

| Chord event                                                       | Amplitude event     | Notes                                                                                                 |
| ----------------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
| track                                                             | `logEventV2`        | All track events except Order Completed                                                               |
| [Order Completed](/collect-data/tracking-plan/order-completed.md) | `logPurchase`       | Includes revenue tracking                                                                             |
| identify                                                          | `identifyUser`      | Updates user properties                                                                               |
| page / screen                                                     | `logEventV2`        | The server version sends "Viewed \[name]". The browser version names page events by its page settings |
| group                                                             | `groupIdentifyUser` | The server version needs the Project Secret Key and the Amplitude Accounts add-on                     |
| alias                                                             | `mapUser`           | Server version only. Needs the Project Secret Key. The browser version ignores alias events           |

Field mappings differ by version. See [Amplitude browser](/activate/event-streaming/destinations/analytics/amplitude/amplitude-browser.md#event-mapping) and [Amplitude server](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md#default-field-mappings).

## Amplitude actions reference

| Action              | Description                                                                         |
| ------------------- | ----------------------------------------------------------------------------------- |
| `logEventV2`        | Track a standard event with properties                                              |
| `identifyUser`      | Update user properties without tracking an event                                    |
| `logPurchase`       | Track a revenue event (includes revenue, price, quantity, productId)                |
| `mapUser`           | Merge two user identities (alias). Server version only. Requires Project Secret Key |
| `groupIdentifyUser` | Update group properties. The server version requires the Project Secret Key         |
| `logEvent`          | Legacy name. Chord handles it the same way as `logEventV2`                          |

## Custom action mappings

Override the default routing or add field transformations using **Custom Action Mappings**. The setting works the same way on both versions.

**Use cases**

* **Route specific events**: send Subscription Started to `logPurchase` instead of `logEventV2`.
* **Rename events**: transform Button Clicked into CTA Interaction.
* **Map custom fields**: map any property to an Amplitude field. Use dot notation in the source path.
* **Filter events**: use `$drop` as the target event name to exclude events.

**Mapping fields**

| Field                 | Description                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| **Source Event(s)**   | Event(s) to match. Comma-separated for multiple (for example Purchase,Subscription). Use `*` for all. |
| **Amplitude Action**  | Which Amplitude API to call                                                                           |
| **Target Event Name** | Override the event name. Leave empty for the original. Use `$drop` to filter it out.                  |
| **Field Mappings**    | Map source properties to Amplitude fields                                                             |

**Property path examples**

```
properties.product_id           → Access a top-level property
properties.products[0].sku      → Access first item in an array (the [*] wildcard isn't supported for Amplitude)
context.campaign.source         → Access nested context fields
traits.email                    → Access user traits (for identify events)
```

**Target property**

The **Target Property** names the field Chord sets. What it sets depends on the version.

* **Browser version**: an event property added to the event, or a user property on an identify event. For example, `order_id` adds an `order_id` property. On an Order Completed event, `revenue`, `productId`, `quantity` and `revenueType` also feed the revenue call.
* **Server version**: a top-level field on the Amplitude event, such as `revenue`, `productId`, `price`, `quantity` or `revenueType`.

A name with dots, such as `event_properties.item_id`, is used as one name. It is not a path into nested fields.

**Which entry applies**

1. The first entry in your list that matches the event decides the Amplitude action.
2. Among the entries with that action, Chord then picks the field mappings and **Target Event Name** like this:
   1. **Exact match**: the event name matches exactly (for example Order Completed).
   2. **Type match**: the event type matches (for example track matches all track events).
   3. **Wildcard**: `*` matches all events (lowest priority).

## Examples

**Route subscription events to revenue tracking**

```
Source Event: Subscription Started, Subscription Renewed
Action: logPurchase
```

**Rename an event**

```
Source Event: Button Clicked
Action: logEventV2
Target Event: CTA Interaction
```

**Map the order total to revenue**

```
Source Event: Order Completed
Action: logPurchase
Field Mappings:
  - properties.total → revenue
```

**Add a custom property (browser version)**

```
Source Event: Order Completed
Action: logPurchase
Field Mappings:
  - properties.order_id → order_id
```

**Drop unwanted events**

```
Source Event: Internal Debug Event
Action: logEventV2
Target Event: $drop
```

## Set up

* [Amplitude browser](/activate/event-streaming/destinations/analytics/amplitude/amplitude-browser.md)
* [Amplitude server](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/activate/event-streaming/destinations/analytics/amplitude.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
