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

# Segment

Use Segment to connect Synap to hundreds of other tools and platforms.

[Segment](https://segment.com/?utm_source=Synap\&utm_medium=SynapSegmentHelpDocs\&utm_campaign=synap_recommending_segment\&utm_id=fromSynap) is a fantastic platform and one we highly recommend. Segment unifies all of your data and makes sure its ready to go into other tools in the right way. Using Segment means you don't need to installing different codes onto your website / portals in order to connect it to other tools.

Segment lets you integrate Synap with thousands of popular tools, supporting a wide range of use cases, such as:

* Analytics tools such as Google Analytics & Tag Manager, Mixpanel, Posthog and Amplitude
* Support platforms such as Intercom, Mailchimp and Zendesk&#x20;
* CRMs such as Salesforce, Hubspot and Pipedrive

If you already have a Segment account, [create a new source for Synap](https://www.twilio.com/docs/segment/connections/sources/catalog/cloud-apps/synap) add in the URL of your Synap platform once prompted. Once the source is set up, copy the Write key to your clipboard.

<figure><img src="https://3316915154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkgvUeCmTPeNouRxGPC%2Fuploads%2FRo0RiqT03ChCkqDkwPK4%2FScreenshot%202024-05-10%20at%2010.42.57.png?alt=media&amp;token=b4b57e55-e646-431b-b66d-e7550238369c" alt=""><figcaption><p>Synap in Segment</p></figcaption></figure>

Next, on Synap go to **Settings > Integrations.** From here you'll see a box to input your Segment Write key.

![Settings > Integrations](https://3316915154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkgvUeCmTPeNouRxGPC%2Fuploads%2Fr2vBQh7f98H5cve9J2eS%2FScreenshot%202021-11-11%20at%2010.20.19.png?alt=media\&token=ba301d1a-ae0d-4862-a4b1-6264260f6459)

### Event Data

Segment lets you view event data for key events on Synap. You can use Segment's [Track](<https://segment.com/docs/connections/spec/track/ >) and [Page](https://segment.com/docs/connections/spec/page/) events to see what users are doing and what page they're on. Then through Segment's [Identify](https://segment.com/docs/connections/spec/identify/) tie those events back to users.

![Using identify to link users to events in Segment](https://3316915154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkgvUeCmTPeNouRxGPC%2Fuploads%2F2CRH1SwxB7CGXL9r0Ld6%2Fimage.png?alt=media\&token=0fac6dd4-da3c-4985-94c9-3e3f0ac72fc8)

#### Identify

Attributes attached to the user will show in Segment as `EI-` see below for an example of an Identify call payload.

```json
{
  "userId": "QsogF1GDFZ",
  "traits": {
    "EI-Role": "Health and Safety Manager",
    "createdAt": "new Date('2021-11-26T10:09:52.447Z')",
    "email": "homer_simpson@spfield.com",
    "emailVerified": false,
    "firstName": "Homer",
    "lastName": "Simpson",
    "marketingEmailsConsent": "removed",
    "name": "Homer Simpson",
    "profilePicture": "https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png"
  }
}
```

#### Track

Began test is an example of a Track event, it is linked to the user using their `userId` these events tend to exclude titles and rely on `testId` and `attemptId` Note: an `attemptId` is a users unique attempt on a particular `testId`

```json
{
  "event": "Began Test",
  "integrations": {},
  "messageId": "node-xxxxxxxxxx",
  "originalTimestamp": "2022-01-18T18:37:43.245Z",
  "properties": {
    "Quiz Mode": "test",
    "attemptId": "rae6sql3AD",
    "testId": "RG70wQdFDl"
  },
  "receivedAt": "2022-01-18T18:37:43.872Z",
  "sentAt": "2022-01-18T18:37:43.246Z",
  "timestamp": "2022-01-18T18:37:43.871Z",
  "type": "track",
  "userId": "QsogF1GDFZ"
}
```

#### Page

Page calls will show the page path and unique URL. Synap content pages will always contain an identifier in the url ie:

* /collections/
* /assignment/
* /quiz/
* /insights/

```json
{
  "name": "Springfield Portal",
  "path": "/quiz/a/rae6sql3AD",
  "referrer": "",
  "search": "?title=Springfield%Exam",
  "title": "Springfield Summer Exam",
  "url": "https://portal.synap.ac/quiz/a/rae6sql3AD?title=Springfield%Exam"
}
```

Segment has a lot of documentation and resources, we suggest starting with [Synap's integration page](https://www.twilio.com/docs/segment/connections/sources/catalog/cloud-apps/synap) which has more information.


---

# 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://academy.synap.ac/doc/integrations/segment.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.
