# Open and click tracking

> Per-domain open and click tracking: how the open pixel and link rewriting work, and how events surface.

Each domain has two independent tracking toggles — **open tracking** and **click tracking** — stored on the domain and applied to mail sent from it. **Both are disabled by default** for every domain. Toggle them in the dashboard or with [`PATCH /domains/:id`](https://www.mailblastr.com/docs/api/domains-update) (`open_tracking`, `click_tracking`).

## Open tracking

When open tracking is on, MailBlastr embeds a **1×1 transparent pixel GIF** in the HTML body, with a unique reference to the email. When the recipient’s mail client downloads that image, MailBlastr records an `opened` event for the email — telling you exactly which message was opened.

## Click tracking

When click tracking is on, MailBlastr **rewrites every link** in the HTML body to pass through a redirect. When a recipient clicks, the request hits MailBlastr first: it records a `clicked` event (with the destination URL) and then immediately redirects the recipient to the original link.

## Custom tracking subdomain

By default the rewritten links and open pixel point at a MailBlastr-hosted tracking host. You can instead serve them from a **custom subdomain on your own domain** so tracked links stay on-brand. Set `tracking_subdomain` with [`PATCH /domains/:id`](https://www.mailblastr.com/docs/api/domains-update) (for example `links`, which produces a CNAME for `links.yourdomain.com`); providing it implicitly turns on `custom_tracking`.

- Pick a neutral label — avoid values with a negative connotation such as `tracking` or `click`.
- After setting it, publish the **Tracking CNAME** record MailBlastr returns and let it verify; until then the previous tracking host is used.
- A tracking subdomain can be **changed but never removed** — old DNS records are retained so links in already-sent email keep working.

## How events surface

Open and click events appear in two places:

- In the **per-email log** — part of the event timeline you can view in the dashboard or fetch with [`GET /emails/:id`](https://www.mailblastr.com/docs/logs/overview).
- In your **webhooks** — `opened` and `clicked` events are delivered to your configured webhook endpoints alongside delivery, bounce, and complaint events.

> **Warning:** Open tracking is **inherently approximate**. Image-proxying and privacy features (e.g. Apple Mail Privacy Protection) can pre-fetch the pixel and inflate opens, while clients that block images undercount them. Treat opens as a directional signal, not an exact count; clicks are more reliable.
