# Install on Segment

> Already send your page views to Segment? Add Okidoki as a destination. No script to add to the site.

Segment does not write code for you, but it has a box for code that goes in the head of every page. Paste one line there and you are done.

## Before you start

[Sign in to Okidoki](https://okidoki.sh/login) and add your site. On the setup page, choose **With a site builder** and copy the line. It looks like this, with your own site key:

```html title="The script tag"
<script defer data-site="ok_your_site_key" src="https://okidoki.sh/js/okidoki.js"></script>
```

## Install on Segment

1. In Segment, open **Connections → Catalog → Destinations**, search for **Webhooks (Actions)** and click **Add destination**.
2. Choose the source your site sends to Segment, name the destination Okidoki and click **Create destination**.
3. Open **Mappings → New Mapping** and choose **Send**. As the trigger, choose **Event Type is Page** and add **Event Type is Track** with **any**.
4. Paste your Okidoki address in **URL**, leave **Data** as it is and click **Save**. Turn the mapping on, then the destination under **Settings**.

The setup page in Okidoki turns green as soon as the first visit arrives. See [Check that it works](https://docs.okidoki.sh/install/check).

> [!NOTE]
> Some builders only allow custom code on paid plans or on a connected domain. If you cannot find the place, check your plan with the builder.

## Good to know on Segment

- Okidoki reads the page address, the referrer, the browser, the language and the time zone from each call. Everything else Segment sends, like userId, anonymousId, traits with an email and the IP address, is thrown away the moment it arrives. It is never stored or logged.
- Track calls show up as events under their own name, like **Signed Up**. Make a goal from any of them in Okidoki.
- Okidoki stores nothing until it knows the site is yours. Without the Okidoki tag on the site, add one DNS record: **TXT** `_okidoki.yoursite.com` with your site key as its value.
- Segment sends no time on page or scroll depth, so those stay empty. Want them too? Add the Okidoki script instead, and keep only **Event Type is Track** in the trigger, so no page view is counted twice.

> [!TIP]
> Rather do it all on one page? The [Segment install guide](https://okidoki.sh/install/segment) on okidoki.sh has the setup built in.

## No cookie banner needed for Okidoki

Okidoki sets no cookies and collects no personal data, so it needs no cookie banner. If your builder offers to add one for analytics, you can usually say no. Read more in [Privacy and GDPR](https://docs.okidoki.sh/privacy).
