Click Tracking
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, providing a seamless experience for recipients.
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
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
<a href="...">tags - 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:
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
See Bot Detection Field Values for classification and proxy_type values, plus reason_codes guidance.
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