Open and click tracking
Tracking tells you when a recipient opened an email or clicked a link in it. It is off by default and is switched on per sending domain.
Related:Email sendingTransactional email
Checked against the API source on
Turn it on
Each sending domain has two settings, open_tracking and click_tracking. Both are false until you change them. Switch them in the dashboard under Sending, Domains, Details and DNS, or with the API:
curl -X PATCH https://api.scrubimail.com/scrubimail/api/v1/send/domains/$DOMAIN_ID/ \
-H "X-API-Key: $SCRUBIMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"open_tracking": true, "click_tracking": true}'The API key needs the domains scope. The setting applies to every message sent from that domain afterwards: single sends, bulk sends and campaigns. Over the SMTP relay messages are sent as written, so tracking is not added.
What is changed in your email
Only the HTML part changes, and only in the copy handed to the mail server. The message stored in your history keeps your original HTML. The plain-text part is never changed.
| Setting | Change |
|---|---|
| Open tracking | A 1x1 transparent image is added just before </body> (or at the end if there is no </body>). When the recipient's mail app loads images, ScrubiMail records an open. |
| Click tracking | The href of each http and https link in an <a> tag is replaced with a ScrubiMail address. When someone clicks, we record it and redirect (302) to your original URL. |
<!-- You send -->
<p><a href="https://yourcompany.com/welcome">Get started</a></p>
<!-- Recipient receives (shortened) -->
<p><a href="https://api.scrubimail.com/scrubimail/api/v1/t/c/eyJtIjoi...">Get started</a></p>
<img src="https://api.scrubimail.com/scrubimail/api/v1/t/o/eyJtIjoi....gif" width="1" height="1" alt="" style="display:none">Each tracking address is signed. A click address can only redirect to the URL that was in your email when it was sent, so it cannot be turned into an open redirect, and an address that was altered returns 404.
Links that are never rewritten
mailto:andtel:links, anchors such as#pricing, and relative links.- The unsubscribe link. Unsubscribing must work even if tracking were ever unavailable.
- Any
<a>tag with the attributedata-scrubimail-notrack. Use it for links you want left exactly as written, for example a link to a page behind a signed URL that breaks if the address changes. - Links inside HTML comments,
<script>and<style>. - Links longer than 2,000 characters.
<a href="https://yourcompany.com/invoice/1042?sig=abc" data-scrubimail-notrack>View invoice</a>To opt a whole message out, send track_opens: false and/or track_clicks: false with POST /send/. These flags can only turn tracking off for that message; they cannot turn it on for a domain that has it off.
Reading the results
Get a message and List sent messages include these fields. In the dashboard, History shows opens and clicks per message and Campaigns shows totals.
| Field | Meaning |
|---|---|
| opened_at | When the message was first opened, or null. |
| clicked_at | When a link in it was first clicked, or null. |
| open_count | Every open recorded. The same person can add many. |
| click_count | Every click recorded. |
Campaign opened_count and clicked_count count each recipient once, however many times they opened or clicked. GET /send/analytics/ returns the same kind of count as opened and clicked across all your messages.
If you have webhooks set up, every open sends an email.opened event and every click an email.clicked event. The click event carries the url, and both carry the recipient's user_agent and ip.
What the numbers can and cannot tell you
- Missed opens. If the recipient's app blocks images, or they read the plain-text part, no open is recorded.
- Early clicks. Some security scanners follow every link in a message before the recipient sees it. Those clicks are recorded.
- Privacy. Tracking records the time, the recipient's IP address and their mail app or browser name for each event. Tell your recipients in your privacy policy, and check the consent rules for your audience (for example GDPR and ePrivacy in the EU) before you turn it on. Leave it off for sensitive transactional mail such as password resets.
- Deliverability. Rewritten links point at a ScrubiMail address, not your own domain. Some spam filters score that slightly worse than direct links, so test with a seed list before you enable click tracking for a large campaign.
- Retention. Messages and their events are deleted after 90 days. A click address keeps redirecting after that, but no longer records anything.
Something missing or wrong? Email [email protected].