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.

Common Accuracy Issues

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

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