Click tracking
Enable click tracking to record when a recipient follows a supported link in an HTML email.
How it works
When click tracking is enabled for a route, Lettermint automatically rewrites links in your HTML emails to route through our tracking domain. The original link:
Code
Becomes:
Code
Where {sid} is your project's short ID.
Want branded tracking links? Custom tracking domains let you use your own subdomain (e.g., track.yourcompany.com) instead of the default tracking domain. Available on Pro plans.
Redirect flow
When a recipient clicks a tracked link:
- Click observed. Request hits the tracking domain and we store the click observation with timestamp
- Token validated - We verify the tracking token is valid and not expired
- Instant redirect - Recipient is immediately redirected (302) to the original URL
- Classification and promotion - The observation is classified before it contributes to customer-visible events and metrics
- Webhook sent - Human-countable clicks send a
message.clickedevent to your configured webhooks
The redirect happens in milliseconds, so recipients notice nothing.
Enabling click tracking
Via dashboard
- Navigate to your project
- Go to Routes and select your transactional or broadcast route
- In Route Settings, enable Track Clicks
- Save your changes
Via API
Use the route update method shown in Tracking with this settings payload:
Code
Click tracking is only available for transactional and broadcast routes. Inbound routes cannot have tracking enabled.
Per-email override
You can override the route's click tracking setting for a single email. This lets you keep a route default while opting individual messages in or out.
API sends use settings.track_clicks:
Code
SMTP sends use the Lettermint override header:
Code
The override applies only to that email and takes precedence over the selected route's Track Clicks setting.
Which links are tracked
Tracked links
Lettermint rewrites standard HTTP/HTTPS links:
https://example.com/pagehttp://example.com/page- Links in HTML
<a>elements - Links in HTML email content
Skipped links
The following link types are not rewritten to preserve functionality:
| Link Type | Example | Reason |
|---|---|---|
| Email links | mailto:support@example.com | Opens email client |
| Phone links | tel:+1234567890 | Opens phone dialer |
| SMS links | sms:+1234567890 | Opens messaging app |
| JavaScript | javascript:void(0) | Client-side only |
| Anchors | #section-name | Same-page navigation |
| Data URIs | data:image/png;base64,... | Embedded content |
| Unsubscribe links | Links with unsubscribe in URL | Preserve direct access |
Bot detection
Security scanners and link preview features can click links before humans do. Lettermint detects these automated clicks to ensure accurate analytics.
Webhook payload
When a human-countable click is detected, Lettermint sends a message.clicked webhook event. Machine, link preview, and security scanner clicks are excluded by default and are only sent to webhooks with Include machine events enabled.
Code
Click-specific fields:
destination_url- The original destination URL that was clickedlink_index- Zero-based index of the link in the email (order of appearance)anchor_text- The visible text of the clicked linkclicked_at- Timestamp when the click occurred
Engagement fields:
tracking_event_id- Stable ID for this click observation. The click has an ID that is different from the ID of an earlier privacy open.classification_revision- Revision number for this click. A new click starts at revision1.engagement- Optional engagement conclusion and evidence times. It is present when the click confirms an earlier privacy open.first_click-trueif this is the first time this recipient clicked any link in this emaildevice_type- Device category:desktop,mobile, ortabletclient_type- Client category:browser,email_client, etc.client_name- Specific client name:Chrome,Safari,Outlook, etc.
Bot detection fields:
bot.detected-trueif the click appears automatedbot.probability- Confidence score from 0-100 (higher = more likely a bot)bot.classification- Source classification such asgenuine,privacy_proxy,security_scanner, orgeneric_botbot.proxy_type- Known proxy family when applicable, otherwisenullbot.reason_codes- Machine-readable reasons behind the classificationbot.machine-truewhen the click is classified as machine, preview, or security activitybot.counts_for_metrics- Whether the click contributes to default engagement metrics
Privacy inference revisions
A high-confidence click can confirm human engagement for an earlier supported privacy fetch. Lettermint then sends revision 2 of the message.opened event. The revised open keeps the same privacy-open tracking_event_id and the same privacy-fetch time.
The message.clicked event uses the click observation's own tracking_event_id and starts at revision 1. Its engagement.engagement_confirmed_at value contains the click time. Store the highest classification_revision for each tracking_event_id.
See Bot Detection Field Values for the stable classification contract and guidance for open diagnostic strings.
Limitations
Token expiration
Tracking tokens expire 30 days after the email is sent. After expiration:
- Clicks are not recorded
- Recipients are still redirected to the original URL (graceful degradation)
Corporate security pre-clicking
Some corporate email security tools pre-click all links in emails to scan for malware. Lettermint excludes identified security scanner clicks from default metrics and webhooks. They remain available to opted-in webhooks and reporting requests that include machine activity.
Plain text emails
Click tracking only works for HTML emails. Links in plain-text email parts are not rewritten.
Link appearance
The tracking URL is visible if recipients hover over links or inspect the email source. This is standard for email tracking and does not affect the user experience. For a more branded appearance, consider using a custom tracking domain.
Best practices
- Track specific campaigns - Use metadata and tags to attribute clicks to campaigns
- Monitor unique clicks - Use
first_clickto distinguish initial engagement from repeat clicks - Test your links - Send test emails to verify tracked links redirect correctly
- Respect privacy - Disclose tracking in your privacy policy
Next steps
- Open Tracking - Combine with open tracking for complete engagement data
- Webhook Events - Full payload reference for all tracking events
- Tags - Organize and filter your tracked emails