Click Tracking & HTML Best Practices

It's important to consider the privacy implications of enabling Click and Open tracking before enabling the feature. Depending on the country where your recipient resides, using this feature to track engagement may require the unambiguous consent of the recipient.

If you are experiencing issues with the click tracking setting not replacing your original links, please take a look at your link formatting. Links must be in the proper format in order for our click tracking setting to find and replace them:

  • Links must be within an HTML <a> tag with the href argument within the tag.
  • There must not be spaces around the = in the href attribute
  • The URI must be quoted, and must be preceded by "http:// or "https://.

Here are some example links that will be properly replaced by our click tracking app:

  • <a href="">SendGrid</a>
  • <a href="">SendGrid</a>
  • <a target="_blank" href="">SendGrid</a>

Note that a link shouldn’t be a custom field or buried within a custom field. For example:

  • <a href="{{ birthday_url }}"></a> will not work. Instead you should format your link like this: <a href="{{ birthday_url }}"></a>

The following links, even though they may still resolve, will not be captured or replaced by our click tracking system:

  • <a href="">SendGrid</a>
  • <a href="">SendGrid</a>
  • <a href=>SendGrid</a>
  • <a href = "">SendGrid</a>

If you are in the habit of BASE64 encoding your email content, we will be unable to detect the encoded <a> tags and overwrite them, so clicks will not be tracked in this case.

Click tracking can be turned off for individual links by including the clicktracking=off attribute inside the anchor of an HTML link before the href. For example, <a clicktracking=off href="">link text</a> would not be tracked.

If you have a Pro 100K package or higher and you have authenticated your sending IP address, the replaced click tracking links lie under the authenticated subdomain. Pro 100K and higher packages that have not authenticated, Essentials packages, and Free packages have click tracking links that resolve through one of SendGrid's domains (,,, etc.).

Rate this page:

Need some help?

We all do sometimes. Get help now from the Twilio SendGrid Support Team.

Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!