Click tracking allows you to monitor when recipients click links in your emails by automatically rewriting URLs to redirect through AhaSend’s tracking servers. This feature provides valuable insights into email engagement and recipient behavior.

How Click Tracking Works

Click tracking works by automatically rewriting all eligible links in your HTML emails to redirect through AhaSend’s tracking servers. When a recipient clicks a tracked link, they’re briefly redirected through AhaSend’s servers before being sent to the original destination, allowing the click to be recorded.
  1. Link Detection: AhaSend scans HTML emails for eligible links
  2. URL Rewriting: Original URLs are replaced with AhaSend tracking URLs
  3. Email Delivery: Email is delivered with rewritten tracking links
  4. Link Clicked: Recipient clicks on a link in the email
  5. Redirect & Track: AhaSend records the click and redirects to original URL
  6. Analytics Updated: Click data appears in your dashboard and webhooks

Common Accuracy Issues

Click behavior varies by client:
  • Some clients pre-fetch links, inflating click counts
  • Mobile clients may handle redirects differently
  • Corporate firewalls may block tracking redirects
  • Email security scanners may trigger false clicks

Privacy Considerations

Click tracking has significant privacy implications that you should consider:
Privacy Compliance: Ensure your use of click tracking complies with applicable privacy laws (GDPR, CCPA, etc.) in your jurisdiction. Consider disclosing tracking in your privacy policy.

Privacy Impact

When someone clicks a tracked link, AhaSend may collect:
  • Timestamp: When the link was clicked
  • IP Address: Recipient’s approximate location
  • User Agent: Browser and device information
  • Original URL: The destination they were trying to reach
  • Click Count: How many times the link was clicked
Recipients may notice:
  • Brief redirect through AhaSend’s tracking domain
  • Different URL in browser address bar during redirect
  • Slight delay before reaching final destination
Recipients typically cannot see:
  • That their clicks are being tracked
  • What information is being collected
  • Analytics and reporting data
Recipients can avoid tracking by:
  • Disabling JavaScript in their browser
  • Using privacy-focused browsers or extensions
  • Reading emails in plain text mode
  • Manually copying/pasting URLs instead of clicking

Enabling Click Tracking

Click tracking can be controlled at different levels depending on how you send emails:

Account-Wide Settings

Configure your default click tracking preference in your AhaSend dashboard:
  1. Navigate to Account Settings in your dashboard
  2. Toggle Click Tracking on or off
  3. This setting applies to all emails unless overridden per message

Per-Message Override

Override account settings for individual emails using different methods:

SMTP with Special Headers

For SMTP email sending, use the ahasend-track-clicks header to control tracking:
SMTP Example
From: [email protected]
To: [email protected]
Subject: Product Update with Click Tracking
ahasend-track-clicks: true
Content-Type: text/html

<html>
<body>
<h1>New Product Features</h1>
<p>Check out our <a href="https://example.com/features">latest features</a>!</p>
<p>Excluded link: <a href="https://example.com/unsubscribe" data-as-no-track>Unsubscribe</a></p>
</body>
</html>
Header Details: The ahasend-track-clicks header accepts true or false values and overrides your account-wide click tracking setting for individual emails.
For complete SMTP header documentation, see Special Email Headers.

API v2 Implementation

API v2 (/v2/accounts/{account_id}/messages) provides native support for tracking configuration:
API v2 Example
{
  "from": {
    "email": "[email protected]",
    "name": "Your Company"
  },
  "recipients": [
    {
      "email": "[email protected]",
      "name": "John Doe"
    }
  ],
  "subject": "Newsletter with Click Tracking",
  "html_content": "<h1>Newsletter</h1><p>Visit our <a href=\"https://example.com\">website</a> for more info!</p>",
  "tracking": {
    "click": true
  }
}
API v2 Advantage: API v2 provides dedicated tracking field at the root level, making it easier to manage tracking settings without dealing with custom headers.
For complete API v2 documentation, see Send Emails using the API.

API v1 Implementation

For API v1 (/v1/email/send), include tracking headers in the content.headers field:
API v1 Example
{
  "from": {
    "name": "Your Company",
    "email": "[email protected]"
  },
  "recipients": [
    {
      "name": "John Doe",
      "email": "[email protected]"
    }
  ],
  "content": {
    "subject": "Newsletter with Click Tracking",
    "html_body": "<h1>Newsletter</h1><p>Check out our <a href=\"https://example.com/offers\">special offers</a>!</p>",
    "headers": {
      "ahasend-track-clicks": "true"
    }
  }
}
To exclude specific links from click tracking while keeping it enabled for the email, add the data-as-no-track attribute:
HTML Example
<p>
  Tracked link: <a href="https://example.com/product">View Product</a>
</p>
<p>
  Untracked link: <a href="https://example.com/unsubscribe" data-as-no-track>Unsubscribe</a>
</p>
Use Case: Commonly used for unsubscribe links, privacy policy links, or other administrative links where tracking isn’t needed or desired.

Best Practices

Respect recipient privacy:
  • Disclose click tracking in your privacy policy
  • Consider providing opt-out mechanisms
  • Comply with GDPR, CCPA, and other privacy regulations
  • Be transparent about data collection purposes
Analyze click data effectively:
  • Focus on engagement trends over time
  • Compare click performance between campaigns
  • Segment data by recipient characteristics
  • Use A/B testing to optimize link placement and content