> 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/amplitude-browser.md).

# Amplitude browser

This destination loads the Amplitude SDK in the shopper's browser. It enables session tracking and real-time event capture, and it passes the session ID to the [Amplitude server](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md) version. See [Amplitude](/activate/event-streaming/destinations/analytics/amplitude.md) for how the two fit together, and for the default event routing and custom action mappings.

## Settings

* **Destination Name** (required): a name to tell this destination apart.
* **Amplitude API Key** (required): your Amplitude project's API key.
* **Track All Pages** (optional): send a "Loaded a Page" event for every `page()` call. Off by default. One page call can send more than one event when several page settings match.
* **Track Named Pages** (optional): send a "Viewed \[Name] Page" event when a page name is provided. On by default.
* **Track Categorized Pages** (optional): send a "Viewed \[Category] Page" event when a page category is provided. On by default.
* **Track UTM Properties** (optional): shown in the form, but Chord doesn't use this switch. Chord starts the Amplitude SDK with its attribution capture on, which is what records UTM parameters. On by default.
* **Track Referrer** (optional): shown in the form, but Chord doesn't use this switch. Off by default.
* **Use Anonymous ID as Device ID** (optional): use Chord's anonymousId as Amplitude's `device_id` for cross-platform tracking. Chord applies it only when it loads the SDK, so it has no effect when **Inject Amplitude SDK** is off. Off by default.
* **Inject Amplitude SDK** (optional): when on, Chord loads and initializes the Amplitude SDK automatically. Turn it off when the Amplitude SDK is already loaded natively in your theme, for example through a `<script>` tag. Chord then forwards events to the existing instance without initializing it again. Turning it off lets Amplitude autocapture, Session Replay and Web Experimentation start as early as possible. On by default.
* **Session Timeout (minutes)** (optional): how long a shopper can be inactive before a new session starts. Defaults to 30.
* **Custom Action Mappings** (optional): override the default routing for specific events. See [Custom action mappings](/activate/event-streaming/destinations/analytics/amplitude.md#custom-action-mappings).
* **Consent Requirements** (optional): the consent categories a visitor must accept before Chord sends data to this destination. See [Consent](/activate/event-streaming/consent.md).

## Connect

Add **Amplitude (Device Mode)** from the destination catalog, using the settings above. See [Connect a destination](/activate/event-streaming/connect-a-destination.md) for the full steps.

## Event mapping

This version hands each event to the Amplitude SDK in the browser. The SDK fills in device, platform, location and language details itself, so Chord doesn't map those fields. The [default event routing](/activate/event-streaming/destinations/analytics/amplitude.md#default-event-routing) and [custom action mappings](/activate/event-streaming/destinations/analytics/amplitude.md#custom-action-mappings) on the Amplitude page apply.

| Chord event                                                       | Amplitude event                                            | Notes                                                                                                                                                     |
| ----------------------------------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| track                                                             | `track(name, properties)`                                  | Event name and properties forwarded as-is. If the event has groups, they are added to the properties as `groups`                                          |
| [Order Completed](/collect-data/tracking-plan/order-completed.md) | `revenue(...)` and `track(name, properties)`               | See [Revenue](#revenue)                                                                                                                                   |
| page                                                              | `track(...)`                                               | Named by the page settings. See [Page events](#page-events)                                                                                               |
| identify                                                          | `setUserId(userId)` and `identify(traits)`                 | Each trait is set as a user property. Groups on the event are set with `setGroup`                                                                         |
| group                                                             | `setGroup(type, id)` and `groupIdentify(type, id, traits)` | Needs a group ID. The group type defaults to `group`. Traits are sent only when there are some                                                            |
| alias                                                             | Not sent                                                   | The browser version can't merge user identities. Use the [server version](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md) |

On every event that has a User ID, Chord also calls `setUserId`.

**Page events**

| Setting                     | Amplitude event name     | Sent when                    |
| --------------------------- | ------------------------ | ---------------------------- |
| **Track All Pages**         | `Loaded a Page`          | Every page call              |
| **Track Categorized Pages** | `Viewed [category] Page` | The page call has a category |
| **Track Named Pages**       | `Viewed [name] Page`     | The page call has a name     |

The page's properties are sent with each event.

**Revenue**

| Chord source (priority order)                    | Amplitude field | Notes                                                              |
| ------------------------------------------------ | --------------- | ------------------------------------------------------------------ |
| `properties.revenue`                             | Price           | The revenue call is sent only when `properties.revenue` is present |
| `properties.quantity`                            | Quantity        | Defaults to 1                                                      |
| `properties.productId` > `properties.product_id` | Product ID      | Left out if neither is present                                     |
| `properties.revenueType`                         | Revenue type    | Left out if not present                                            |

Chord then sends the Order Completed event itself with all its properties.

**Sessions**

Chord keeps the current Amplitude session ID in a `_amp_session` cookie and extends it on each event for as long as **Session Timeout (minutes)** allows. The [server version](/activate/event-streaming/destinations/analytics/amplitude/amplitude-server.md) uses the same session. Chord starts the Amplitude SDK with its session and attribution tracking on, and with page view, element interaction, form interaction and file download autocapture off.

**Initialization**

When **Inject Amplitude SDK** is on, Chord loads the SDK from `https://cdn.amplitude.com/script/{API key}.js` on the first event, unless a working Amplitude SDK is already on the page. If the script fails to load, a warning is logged in the browser console and Chord doesn't try again.

## Custom events

Every track event is sent to Amplitude under its own name, with all its properties. Use [custom action mappings](/activate/event-streaming/destinations/analytics/amplitude.md#custom-action-mappings) to rename events, route them to a different Amplitude action or drop them.


---

# 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/amplitude-browser.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.
