> ## Documentation Index
> Fetch the complete documentation index at: https://dub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross-domain tracking

> Track conversions across domains

By default, the script already sets the `dub_id` cookie on a **cross-domain level**.

This means that if you have the script installed on your marketing site (e.g. **example.com**), the cookie will also be accessible when your user signs up for your app (e.g. **app.example.com**).

However, if you are installing the script on a subdomain (e.g. **app.example.com**), you will need to set the following option to make sure the cookie is accessible on the apex domain as well (e.g. **example.com**):

```html HTML theme={null}
<script
  src="https://www.dubcdn.com/analytics/script.js"
  data-cookie-options='{"domain": ".example.com"}'
></script>
```

```typescript React/Next.js theme={null}
<DubAnalytics
  cookieOptions={{
    domain: ".example.com",
  }}
/>
```

The script also supports conversion tracking across *entirely different domains*.

This means that if you have the script installed on a separate domain (e.g. **example.sh**), you can use the `outboundDomains` prop to ensure that the `dub_id` cookie value is automatically appended to all outbound links targeting your main domain (e.g. **example.com**).

```html HTML theme={null}
<script
  src="https://www.dubcdn.com/analytics/script.outbound-domains.js"
  data-domains="{'outbound': ['example.com', 'example.sh']}"
></script>
```

```typescript React/Next.js theme={null}
// install this script on both domains
<DubAnalytics
  domainsConfig={{
    outbound: ["example.com", "example.sh"],
  }}
/>
```

> [!TIP]
>
> For outbound-domains support, you'll need to use the
> [`script.outbound-domains.js`](/docs/sdks/client-side/variants#outbound-domains-variant-script-outbound-domains-js)
> variant of the script. Learn more about [how script variants
> work](/docs/sdks/client-side/variants).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.