HTTPS click tracking
Serve tracking links over https with CloudFront in front of SES.
Tracking links are http:// by default. SES uses HttpsPolicy OPTIONAL, and the CNAME target is r.us-east-1.awstrack.me. For https:// links, put CloudFront in front of SES's tracking endpoint. setup-aws.mjs does not create this.
-
Request an ACM certificate in
us-east-1for the tracking host (for examplelinks.example.com) and add its validation CNAME. -
Create a CloudFront distribution:
- Origin:
r.us-east-1.awstrack.me, HTTPS only. - Alias: your tracking host, with the certificate.
- Cache policy:
Managed-CachingDisabled. - Origin request policy:
Managed-AllViewer. SES needs the viewer'sHostheader.
- Origin:
-
Set
TRACKING_CNAME_TARGET=<id>.cloudfront.netandTRACKING_HTTPS=REQUIRE. Then set the domain'stracking_subdomainand point its CNAME at the distribution. -
Check:
curl --head https://links.example.com/favicon.icoThe response should include
x-amz-ses-request-protocol: https.
Set TRACKING_HTTPS=REQUIRE only when the target really serves https.