Open and click tracking
Tracking is a per-domain setting and is off by default. Turn it on for a domain:
await resend.domains.update({ id: domainId, openTracking: true, clickTracking: true });
or with PATCH /domains/:id and { "open_tracking": true, "click_tracking": true }.
How it works
When tracking is on, Me Send changes the HTML body of each message just before it goes to the provider:
- Clicks. Each
httpandhttpslink is rewritten tohttps://<tracking host>/c/<token>. The recipient is redirected (302) to the original address.mailto:andtel:links, in-page anchors and unsubscribe links are left alone. - Opens. A 1 by 1 pixel image,
https://<tracking host>/o/<token>.gif, is added just before</body>, or at the end of the HTML.
Text-only mail has nothing to track. A token names one email and one link, never the destination, and carries a signature, so a forged link is a 404 and cannot be used as an open redirect.
Your own tracking host
By default the tracking host is a shared Me Send host, so links show Me Send's name. Set tracking_subdomain on a domain (links.yourdomain.com, or just the label links) to use a host under your own domain. The operator of your project has to attach that host to the Worker first, so ask before you set it. A tracking host can belong to only one domain.
Events
A click records email.clicked with the clicked link, the recipient's IP address and user agent. An open records email.opened. Both fire your webhooks and move the email's last_event to clicked or opened. An open or click never replaces a bounce, complaint, failure or suppression as the email's last_event. Test mode sends and simulated test addresses record no tracking events. Opens within an hour of an earlier open of the same email are counted once.
Opens are an estimate: mail apps that preload images report opens nobody made, and apps that block images hide real ones. Treat clicks as the stronger signal. GET /emails/metrics and GET /broadcasts/:id/recipients report both.