How-to
Set up a custom tracking domain
Publish the tracking CNAME for your sending domain, verify it, and turn on open and click tracking so links and pixels use your own hostname over HTTPS.
Open and click tracking in Emailit always runs on a hostname on your own domain, such as go.acme.com. This guide shows how to publish the CNAME record for that hostname, verify it and turn tracking on.
Before you begin
- Add and verify the sending domain. See Add a domain.
- Make sure you can edit the domain’s DNS records.
- Pick a hostname that isn’t used for anything else. The default is
go, which givesgo.acme.com.
Choose the tracking subdomain
The tracking hostname is <tracking subdomain>.<sending domain>. To use something other than go:
On the domain page in Email APIDomains, find the Custom Subdomains card. Enter a prefix in Tracking Subdomain, for example links, and select Save.
Call Update a domain with tracking_key. You can also pass it when you create the domain.
curl https://api.emailit.com/v2/domains/acme.com \
-X POST \
-H "Authorization: Bearer $EMAILIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tracking_key": "links" }'The prefix can contain lowercase letters, digits and hyphens, up to 63 characters, and must start and end with a letter or digit. Changing it resets the tracking record to Not checked, so publish a CNAME for the new hostname and check DNS again.
Publish and verify the CNAME
-
Add the CNAME record. At your DNS provider, create this record:
Type Host Target CNAME go(or your tracking subdomain)go.emailitmail.comFor
acme.com, the result is:go.acme.com. CNAME go.emailitmail.com.If you send from a subdomain such as
mail.acme.com, the host isgo.mailin theacme.comzone. -
Turn off proxying on Cloudflare. If your DNS is on Cloudflare, set the record’s proxy status to DNS only (grey cloud). A proxied record returns Cloudflare’s IP addresses instead of the CNAME, and tracking can’t verify or serve requests. Cloudflare setup creates the record as DNS only for you.
-
Check DNS. On the domain page, select Check DNS. The status badge in the Tracking card changes to OK when the CNAME points to
go.emailitmail.com. -
Turn tracking on. In the Tracking card, turn on Track loads, Track clicks or both. The switches stay disabled until the CNAME shows OK.
With the API, call Update a domain with
"track_loads": trueand"track_clicks": true.
These switches set the default for mail from the domain. You can override them for a single email with the tracking field when you send through the API. See Open and click tracking.
HTTPS
All tracking links and pixels use https://. Emailit issues and renews the certificate for your tracking hostname automatically, the first time it receives a request for it. You don’t need to upload a certificate or change anything else.
Verify it worked
-
Send a test email from the domain with at least one link, for example with Compose on the Emails page.
-
Check the links. In the received message, hover over a link. It should start with
https://go.acme.com/, not your original URL. -
Open and click. Open the email and click the link. The email’s page in Email APIEmails lists the open under Loads and the click under Clicks, and the status changes to
loadedand thenclicked.
Troubleshooting
| Symptom | Fix |
|---|---|
| Tracking shows Missing | The CNAME isn’t published at the expected host. Check with dig +short CNAME go.acme.com @1.1.1.1. A common cause is entering the full name where the provider expects only go. |
| Tracking shows Invalid | The CNAME points somewhere else, or the record is proxied on Cloudflare. Point it to go.emailitmail.com and set it to DNS only. |
| Track loads and Track clicks are greyed out | The CNAME isn’t verified yet. Select Check DNS after publishing it. |
| Emails arrive with the original links | Tracking is off for the domain, the message was sent with "tracking": false, or the tracking record wasn’t OK at the last DNS check. Emailit sends untracked rather than failing. |
| Links show a certificate warning | The CNAME was created moments ago. Wait a minute and try again. If it persists, check that the record isn’t proxied. |
A CNAME already exists at go |
Choose another tracking subdomain, such as links or t, and publish the CNAME there. |