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

# Tracking Domains

> Set up a custom tracking domain for click links and open pixels, served from your brand over HTTPS with automatically provisioned SSL

A tracking domain is a custom subdomain used for click tracking links and open tracking pixels in your emails. Instead of using Lettr's default tracking URLs, you can configure your own branded domain like `links.yourcompany.com`. Setting up a tracking domain improves recipient trust, maintains brand consistency, and can help with deliverability since links point to your own domain rather than a third-party service.

## Why Use Custom Tracking Domains?

By default, tracking links in your emails use Lettr's domain:

```
https://track.lettr.dev/c/abc123
```

With a custom tracking domain, links use your brand:

```
https://links.yourcompany.com/c/abc123
```

### Benefits

* **Brand Consistency** - Links show your domain, reinforcing brand recognition
* **Improved Trust** - Recipients are more likely to click familiar links
* **Better Deliverability** - Some spam filters favor custom tracking domains
* **Professional Appearance** - Emails look more polished and legitimate

## Default vs Custom Tracking

| Feature     | Default                 | Custom                    |
| ----------- | ----------------------- | ------------------------- |
| Click links | `track.lettr.dev/c/...` | `links.example.com/c/...` |
| Open pixels | `track.lettr.dev/o/...` | `links.example.com/o/...` |
| SSL         | Automatic               | Automatic                 |
| Setup       | None required           | DNS configuration         |

## Adding a Tracking Domain

### Via Dashboard

<Steps>
  <Step title="Navigate to Tracking Domains">
    Go to **Domains** → **Tracking** in your dashboard.
  </Step>

  <Step title="Add Domain">
    Click **Add Domain** and enter your tracking subdomain (e.g., `links.example.com`).
  </Step>

  <Step title="Add DNS Records">
    Add the provided DNS records to your domain. You'll need:

    * A CNAME record pointing to Lettr's tracking server
    * TXT records for SSL certificate validation
  </Step>

  <Step title="Verify Domain">
    Click **Verify** to check DNS configuration and provision your SSL certificate.
  </Step>
</Steps>

<Card title="Try it in the app" icon="wand-magic-sparkles" href="https://app.lettr.com/domains/tracking?guide=eyJ2IjoxLCJzdGVwcyI6W3siYW5jaG9yIjoiZG9tYWlucy50cmFja2luZy5hZGQiLCJtZXNzYWdlIjoiQWRkIGEgdHJhY2tpbmcgZG9tYWluIHNvIG9wZW4gYW5kIGNsaWNrIGxpbmtzIHVzZSB5b3VyIG93biBicmFuZCBpbnN0ZWFkIG9mIExldHRyIGRlZmF1bHQgVVJMcy4ifSx7ImFuY2hvciI6ImRvbWFpbnMudHJhY2tpbmcubmFtZS1pbnB1dCIsIm1lc3NhZ2UiOiJVc2UgYSBzaG9ydCBzdWJkb21haW4gbGlrZSBsaW5rcy5leGFtcGxlLmNvbS4gQXZvaWQgd29yZHMgbGlrZSB0cmFja2luZyB0aGF0IGNhbiB0cmlwIHNwYW0gZmlsdGVycy4ifSx7ImFuY2hvciI6ImRvbWFpbnMudHJhY2tpbmcuc3VibWl0IiwibWVzc2FnZSI6IkFkZCBpdC4gTGV0dHIgc2hvd3MgdGhlIENOQU1FIHBsdXMgdGhlIFRYVCByZWNvcmRzIHRoYXQgcHJvdmlzaW9uIHlvdXIgU1NMIGNlcnRpZmljYXRlLiJ9XSwiZG9jcyI6Imh0dHBzOi8vZG9jcy5sZXR0ci5jb20vbGVhcm4vZG9tYWlucy90cmFja2luZy1kb21haW5zIn0">
  Follow an interactive walkthrough of this guide inside Lettr.
</Card>

<Note>
  Tracking domains are managed through the Lettr dashboard. API endpoints for tracking domains are not currently available.
</Note>

## DNS Configuration

After adding your tracking domain, configure these DNS records:

### CNAME Record

Points your subdomain to Lettr's tracking servers:

| Field | Value                           |
| ----- | ------------------------------- |
| Type  | CNAME                           |
| Name  | `links` (your chosen subdomain) |
| Value | `proxy.lettr-tracking.com`      |

### SSL Validation TXT Record

Required for automatic SSL certificate provisioning:

| Field | Value                   |
| ----- | ----------------------- |
| Type  | TXT                     |
| Name  | `_acme-challenge.links` |
| Value | (provided by Lettr)     |

### Ownership TXT Record

Verifies domain ownership:

| Field | Value                       |
| ----- | --------------------------- |
| Type  | TXT                         |
| Name  | `_cf-custom-hostname.links` |
| Value | (provided by Lettr)         |

<Note>
  The exact TXT record values are unique to your domain and will be provided when you add your tracking domain. Copy them exactly as shown.
</Note>

## Choosing a Subdomain

Common choices for tracking subdomains:

| Subdomain | Full Domain         |
| --------- | ------------------- |
| `links`   | `links.example.com` |
| `track`   | `track.example.com` |
| `click`   | `click.example.com` |
| `go`      | `go.example.com`    |
| `e`       | `e.example.com`     |

<Tip>
  Keep the subdomain short and generic. Avoid words like "tracking" or "analytics" that might trigger spam filters.
</Tip>

## SSL Certificates

Lettr automatically provisions and renews SSL certificates for your tracking domain. This ensures all tracking links use HTTPS.

### Certificate Status

| Status               | Description                            |
| -------------------- | -------------------------------------- |
| `active`             | SSL certificate provisioned and active |
| `pending`            | Certificate being provisioned          |
| `pending_validation` | Waiting for TXT record validation      |
| `initializing`       | Initial setup in progress              |

SSL provisioning typically completes within a few minutes after DNS verification.

## Verifying Your Tracking Domain

### Via Dashboard

1. Go to **Domains** → **Tracking**
2. Find your domain and click **Verify**
3. Wait for both CNAME and SSL verification to complete

## Tracking Domain Status

| Status          | Description                    | CNAME   | SSL     |
| --------------- | ------------------------------ | ------- | ------- |
| `active`        | Fully verified and operational | Valid   | Active  |
| `pending_cname` | Waiting for CNAME verification | Pending | Active  |
| `pending_ssl`   | Waiting for SSL certificate    | Valid   | Pending |

## Linking to a Sending Domain

Associate your tracking domain with a sending domain so all emails from that domain use your custom tracking links:

### Via Dashboard

1. Go to **Domains** → **Sending**
2. Select your sending domain
3. Choose your tracking domain from the dropdown

## SSL and Deliverability

Lettr uses SSL for all tracking and **automatically provisions and renews** SSL certificates for your custom tracking domain. You do not need to buy or upload certificates—once both CNAME records (SSL and Proxy) are in place and verified, Lettr issues and renews the certificate.

**Why this matters for deliverability:** Tracking links served over HTTPS from your own domain are trusted more by spam filters and look correct to recipients. Insecure or third-party tracking URLs can hurt deliverability. With automatic SSL, your tracking domain is always HTTPS and aligned with best practices.

<Info>
  SSL provisioning usually finishes within a few minutes after DNS verification. Until then, tracking may use Lettr's default domain. Check the domain status in the dashboard for SSL state.
</Info>

## Using Custom Tracking

Once configured, all tracking automatically uses your custom domain. No code changes needed.

### Click Tracking

When you enable click tracking, links in your email:

**Original link in your email:**

```html theme={null}
<a href="https://example.com/offer">View Offer</a>
```

**Link in delivered email (with tracking):**

```html theme={null}
<a href="https://links.example.com/c/abc123">View Offer</a>
```

When clicked, the recipient is redirected to `https://example.com/offer` and the click is recorded.

### Open Tracking

When you enable open tracking, a tracking pixel is added:

```html theme={null}
<img src="https://links.example.com/o/xyz789" width="1" height="1" />
```

## Enabling Tracking in Emails

Enable tracking when sending emails:

```bash theme={null}
curl -X POST https://app.lettr.com/api/emails \
  -H "Authorization: Bearer lttr_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "hello@example.com",
    "to": ["recipient@example.com"],
    "subject": "Check out our new features",
    "html": "<p>Click <a href=\"https://example.com/features\">here</a> to learn more.</p>",
    "options": {
      "click_tracking": true,
      "open_tracking": true
    }
  }'
```

## Delete a Tracking Domain

<Warning>
  Deleting a tracking domain will cause tracking links in previously sent emails to stop working. Recipients clicking those links will see an error.
</Warning>

### Via Dashboard

1. Go to **Domains** → **Tracking**
2. Find the domain and click **Delete**
3. Confirm deletion

## Troubleshooting

<AccordionGroup>
  <Accordion title="CNAME not verified">
    * Verify the CNAME record is pointing to `proxy.lettr-tracking.com`
    * Check that you added the record to the correct subdomain
    * DNS propagation can take up to 48 hours, though usually completes in minutes
    * Some DNS providers require the full domain in the name field (e.g., `links.example.com` instead of `links`)
  </Accordion>

  <Accordion title="SSL certificate pending">
    * Ensure both TXT records are added correctly
    * TXT record values must match exactly (including any trailing characters)
    * Certificate provisioning can take up to 24 hours in rare cases
    * If stuck, try removing and re-adding the tracking domain
  </Accordion>

  <Accordion title="Tracking links not using custom domain">
    * Verify the tracking domain is linked to your sending domain
    * Check that tracking domain status is `active`
    * Only emails sent after configuration will use the custom domain
  </Accordion>

  <Accordion title="Certificate renewal issues">
    * SSL certificates auto-renew before expiration
    * If renewal fails, check that TXT records are still in place
    * Contact support if certificates expire unexpectedly
  </Accordion>
</AccordionGroup>

<Note>
  Changing your tracking domain won't affect previously sent emails. Only new emails will use the updated tracking domain.
</Note>

## Best Practices

1. **Use a dedicated subdomain** - Don't use your root domain for tracking
2. **Keep subdomains short** - Shorter URLs look cleaner in emails
3. **Avoid suspicious words** - Skip words like "tracking" or "click" in the subdomain
4. **Set up before sending** - Configure tracking domains before email campaigns
5. **Monitor SSL status** - Ensure certificates stay active

## Related Topics

<CardGroup cols={2}>
  <Card title="Sending Domains" icon="paper-plane" href="/learn/domains/sending-domains">
    Configure domains for sending
  </Card>

  <Card title="Tracking" icon="chart-line" href="/learn/sending/tracking">
    Learn about click and open tracking
  </Card>

  <Card title="Analytics" icon="chart-bar" href="/learn/analytics/introduction">
    View tracking analytics
  </Card>

  <Card title="Storage Domains" icon="hard-drive" href="/learn/domains/storage-domains">
    Custom domains for email assets
  </Card>
</CardGroup>
