> 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/chord-oms/chord-storefront-event-tracking/about-event-tracking.md).

# About Event Tracking

{% hint style="danger" %}
This is legacy documentation and is no longer maintained—refer to the latest Chord documentation for accurate and supported guidance
{% endhint %}

Chord automatically sends customer events to Segment's tracking API from your website front end and the Chord OMS. These events flow through Segment to a Chord data warehouse, where the data is modeled and turned into [actionable insights](https://chord.co/segments/insights).

Segment structures data flow as "sources" and "destinations." Sources are anything that sends events to Segment, like a website or an app. Destinations are tools or apps that will receive the data flowing from a source. Chord automatically creates several sources and destinations within Segment, but you can also add your sources and destinations. Destinations are an easy way to enable third-party integrations, like advertising and marketing tools. Read more about this concept in [Segment's documentation](https://segment.com/docs/connections/).

## How does Chord use Segment?

Chord provisions two sources in your Segment account: the Chord OMS (called the "back-end source") and your website (the "front-end source"). You will have a set of sources per environment. For example, if you have a staging environment and a production environment, you'll see four sources:

1. "My Company Back-End (Production)"
2. "My Company Front-End (Production)"
3. "My Company Back-End (Staging)"
4. "My Company Front-End (Staging)"

### Back-end source

The Chord OMS sends events to the back-end source immediately using the `SEGMENT_WRITE_KEY` environment variable in your OMS store settings. Verify events are tracked by selecting the source within Segment, and then selecting the **Debugger** tab. You'll see a live feed of events coming from the source.

The back-end source sends events related to orders and customer accounts, like "Order Completed" and "Subscription Payment Failed." We recommend relying on events from the back-end source whenever possible when setting up third-party integrations because ad blockers or other factors can impact front-end events.

[What is the Tracking Plan?](/chord-oms/chord-storefront-event-tracking/what-is-the-tracking-plan.md) includes a list of the events sent by the back-end source\*\*.\*\*

If you're using Chord with Shopify, you'll see one or more "Shopify Webhook" sources instead of the Chord OMS back-end source. These work similarly. Shopify sends mission-critical events like "Order Completed" to Segment via these sources. [The Shopify Tracking Plan](/chord-oms/chord-storefront-event-tracking/the-shopify-tracking-plan.md) reference includes a list of events sent by webhook sources.

### Front-end source

The Chord JavaScript SDK sends events to the front-end source from your website. To set this up, you'll need to load Segment's [Analytics.js](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/) library on your website and do some configuration. See [Adding Tracking](/chord-oms/chord-storefront-event-tracking/adding-tracking.md).

Once your website is configured, the Chord SDK automatically sends events to Segment related to customer activity, like "Product Added" and "Promo Code Applied." The Chord SDK also offers functions you can use to instrument your website to track UI-related events, like "Product Clicked." Chord's website starter kits are fully instrumented with UI tracking, so you can use them to get started easily or as examples. Read more about instrumenting your website. [Adding Tracking](/chord-oms/chord-storefront-event-tracking/adding-tracking.md).

[What is the Tracking Plan?](/chord-oms/chord-storefront-event-tracking/what-is-the-tracking-plan.md) includes a complete list of the events sent by the front-end source\*\*.\*\*

### Data warehouse destination

Chord also provisions a data warehouse destination in your Segment account. It's connected to front-end and back-end sources. This gives the Chord data pipeline access to all events coming into Segment from Chord sources.

## How should you use Segment?

Chord uses tracking data from Segment to provide actionable insights for your business. You can also use Segment directly to integrate your website with other apps and services. Add additional sources and destinations when you need them. Segment has a large [catalog of integrations](https://segment.com/docs/connections/destinations/catalog/) that are available as sources and destinations.

Chord's events follow [Segment's e-commerce spec](https://segment.com/docs/connections/spec/ecommerce/v2/), which many destinations understand so that they can be enabled with minimal configuration.


---

# 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/chord-oms/chord-storefront-event-tracking/about-event-tracking.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.
