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

# Domain Settings

> Configure tracking and delivery settings for your sending domain

## Overview

Each sending domain has configurable settings that control how emails are tracked and delivered. Access these settings at **Settings → Sending Domains → \[Your Domain]**.

***

## Tracking Settings

### Open Tracking

| Setting       | Default     |
| ------------- | ----------- |
| Open Tracking | **Enabled** |

When enabled, Migma inserts a 1x1 transparent pixel image at the end of your email. When a recipient opens the email and loads images, this pixel is requested from Migma's servers, recording the open.

**What's tracked:**

* First open timestamp
* Total open count
* Approximate location (from IP)

**When to disable:**

* Privacy-focused audiences
* Emails where image loading is blocked
* Transactional emails where open rates don't matter

***

### Click Tracking

| Setting        | Default     |
| -------------- | ----------- |
| Click Tracking | **Enabled** |

When enabled, Migma rewrites links in your email to route through our tracking servers. When a recipient clicks a link, we record the click and redirect them to the original URL.

**What's tracked:**

* First click timestamp
* Total click count per email
* Which links were clicked

**When to disable:**

* When you need original URLs visible in the email
* High-security contexts where redirects are a concern
* When third-party link tracking is already in place

***

### Branded Tracking

| Setting          | Default      |
| ---------------- | ------------ |
| Branded Tracking | **Disabled** |

When enabled, Migma adds a small "Sent with Migma" footer to your emails. This includes a logo that also serves as an open tracking pixel.

**Why enable:**

* Support Migma with visible branding
* Simple alternative to custom open tracking

**Why disable (default):**

* Keep emails unbranded
* Custom footer design

***

## Updating Settings

### In the Dashboard

<Steps>
  <Step title="Navigate to Domain">
    Go to **Settings → Sending Domains** and click on your domain.
  </Step>

  <Step title="Find Tracking Settings">
    Scroll to the **Tracking** section.
  </Step>

  <Step title="Toggle Settings">
    Click the toggle next to each setting to enable or disable.
  </Step>

  <Step title="Save Changes">
    Changes are saved automatically.
  </Step>
</Steps>

### Settings Summary

| Setting              | Enabled                  | Disabled                |
| -------------------- | ------------------------ | ----------------------- |
| **Open Tracking**    | 1x1 pixel inserted       | No tracking pixel       |
| **Click Tracking**   | Links rewritten          | Original URLs preserved |
| **Branded Tracking** | "Sent with Migma" footer | No footer added         |

***

## How Tracking Works

### Open Tracking Flow

```
1. Email sent with tracking pixel
2. Recipient opens email
3. Email client loads images
4. Pixel request hits Migma servers
5. Open recorded with timestamp
```

### Click Tracking Flow

```
1. Links rewritten: example.com → track.migma.ai/c/[id]
2. Recipient clicks link
3. Request hits Migma tracking server
4. Click recorded with timestamp
5. Recipient redirected to original URL
```

***

## Data Retention

Tracking data is stored for **30 days**. After 30 days, individual email logs are automatically deleted. Aggregate metrics (totals per domain) are retained indefinitely.

***

## Best Practices

<AccordionGroup>
  <Accordion title="Enable both for marketing emails" icon="envelope-open-text">
    For newsletters, promotions, and marketing campaigns, keep both open and click tracking enabled. This data helps you:

    * Measure campaign effectiveness
    * Identify engaged subscribers
    * Optimize send times
    * A/B test content
  </Accordion>

  <Accordion title="Consider disabling for transactional emails" icon="receipt">
    For password resets, order confirmations, and receipts, tracking may be unnecessary:

    * Users expect these emails regardless
    * Open rates are typically very high anyway
    * Reduces email size slightly
    * Avoids potential privacy concerns
  </Accordion>

  <Accordion title="Separate domains for different use cases" icon="sitemap">
    If you need different tracking settings, use separate subdomains:

    * `mail.yourdomain.com` - Marketing (tracking enabled)
    * `notify.yourdomain.com` - Transactional (tracking disabled)
  </Accordion>
</AccordionGroup>

***

## Transactional vs Marketing Streams

Mailbox providers score sender reputation per signing domain, so mixing promotional sends with critical mail like password resets and receipts lets one drag down the other. Migma keeps them apart on separate subdomains:

| Stream        | Subdomain               | Recipients                   | Unsubscribe header |
| ------------- | ----------------------- | ---------------------------- | ------------------ |
| Marketing     | `send.yourdomain.com`   | Subscribed contacts only     | Added              |
| Transactional | `notify.yourdomain.com` | Everyone except hard bounces | Omitted            |

Migma picks the stream automatically: a send to a single recipient is treated as transactional, a send to an audience or tag is treated as marketing. You can override this per send with the `transactional` flag.

### Provisioning a stream

Provision the subdomain once, publish the DNS records it returns, then verify it.

```typescript Node.js SDK theme={null}
await migma.domains.provisionStream({
  rootDomain: 'yourdomain.com',
  stream: 'transactional',
});
```

```bash CLI theme={null}
migma domains streams create yourdomain.com --stream transactional
```

Until a transactional stream exists, transactional sends fall back to your marketing or legacy identity. They still deliver, but they share that identity's reputation instead of being isolated.

<Tip>
  Provisioning is also available in the dashboard at **Settings → Sending Domains**. The API and CLI exist so you can set this up without leaving your own tooling.
</Tip>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="View Metrics" icon="chart-line" href="/sending-domains/metrics">
    See domain performance data
  </Card>

  <Card title="Email Logs" icon="list" href="/sending-domains/email-logs">
    View individual email status
  </Card>
</CardGroup>
