# Integrating Segment

## Connect your segment account to tamber to stream data in real time.

Tamber enables you to put head-scratchingly accurate personalization into your app, just by [tracking events](/content/docs/api/#event-track/index.html) and [pulling recommendations](/content/docs/api/#discover/index.html). By connecting your Segment account, you can instantly begin streaming your events to Tamber, as well as backfill your historical data.

## Get Started

Head to your [dashboard > sources > segment](https://dashboard.tamber.com/project/default/sources/segment) and click enable.

## Configure

Tamber learns on user-item interactions, so all events must include both a user and an [item](/content/docs/api/#item/index.html).

Segment's default api provides the necessary user data, but items are not included by default.

If you are using Segment's [e-commerce](https://segment.com/docs/spec/ecommerce/v2) or [video](https://segment.com/docs/spec/video) apis, check the relevant box and Tamber will handle the rest.

Otherwise, you may use the **Custom Field Definitions** tool to set the field name for your item field, and optionally your amount and hit fields. Tamber will alias from the field name(s) you provide to the relevant [event](/content/docs/api/#event/index.html) attribute.

##### Example

An item field must be added to your Segment event properties. The item may be provided either as an object with an id field, or as a string id.

Segment track call:

```js
analytics.track("Watched", {
  video: "f8ca1e4de5024d9430b3928bd8ac6b96"
  plan: "Pro Annual",
  accountType: "Facebook",
});
```

The item can also be an object:

```js
analytics.track("Watched", {
  video: {
    id: "f8ca1e4de5024d9430b3928bd8ac6b96", // required
    title: "Kurt Vonnegut 60 Minutes Interview",
    genre: "News"
  }
});
```

Field definition:
