How can I monitor the opens and clicks from emails that I send using Amazon SES?

Last updated: 2019-04-03

I want to be notified when a recipient opens an email that I send using Amazon Simple Email Service (Amazon SES), or when a recipient clicks a link in the email. Additionally, I want to know how many times recipients open my emails from Amazon SES, and how many times recipients click links in the emails. How can I do that?

Short Description

Use Amazon Simple Notification Service (Amazon SNS) to notify you when a recipient opens an email, or clicks a link in an Amazon SES email. Then, use Amazon CloudWatch to track how many times recipients open your emails from Amazon SES, or how many times they click on links in the emails. Follow these steps to configure Amazon SES, Amazon SNS, and CloudWatch for monitoring email opens and clicks:

Note: If you send an email to multiple recipients, this configuration won't show which recipient opened the email.

1.    Create an Amazon SNS topic.

2.    Configure Amazon SES to send information about email clicks and opens to the Amazon SNS topic.

3.    Send a test email to verify the Amazon SNS topic subscription.

4.    Configure Amazon SES to send information about email clicks and opens to CloudWatch.

5.    Send a test email to verify the CloudWatch metric.

Resolution

Before you begin, be sure that you verified your domain with Amazon SES.

Create an Amazon SNS topic

1.    Open the Amazon SNS console.

2.    Choose Create topic.

3.    For Topic name, enter a name to create a unique identifier for your topic.

4.    For Display name, enter a display name for your topic.

5.    Choose Create topic.

6.    From the Topic details of the topic that you created, choose Create subscription.

7.    For Protocol, select Email-JSON.

8.    For Endpoint, enter the email address where you want to receive notifications.

9.    Choose Create subscription.

10.   From the email address that you specified in step 8, open the subscription confirmation email from Amazon SNS with the subject line "AWS Notification - Subscription Confirmation".

11.   In the subscription confirmation email, open the URL specified as "SubscribeURL" to confirm your subscription.

Configure Amazon SES to send information about email clicks and opens to the Amazon SNS topic

1.    Open the Amazon SES console.

2.    In the navigation pane, under Email Sending, choose Configuration Sets.

3.    Choose Create Configuration Set.

4.    For Configuration Set Name, enter a name for your configuration set.

5.    Choose Create Configuration Set.

6.    From the list of configuration sets, select the set that you created.

7.    For Add Destination, select SNS.

8.    For Name, enter a name for the SNS destination.

9.    For Event types, select Click and Open.

10.   For Topic, choose the Amazon SNS topic that you created.

11.   Choose Save.

Send a test email to verify the Amazon SNS topic subscription

1.    Open the Amazon SES console.

2.    In the navigation pane, under Identity Management, choose Domains.

3.    Select one of your verified domains.

4.    Choose Send a Test Email.

5.    For Email Format:, choose Raw.

6.    For From:, enter an email address with your verified domain.

7.    For To:, enter an email address that you want to use as a test recipient.

8.    For Message:, enter text that's similar to following example. Replace myConfigset with the name of the configuration set that you created.

X-SES-CONFIGURATION-SET: myConfigset
From: test-verified-domain@example.com
To: test-recipient@example.com
Subject: Test email
Content-Type: multipart/alternative;
    boundary="----=_boundary"

------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

This is a test email.
<a href="https://aws.amazon.com/">Amazon Web Services</a>
------=_boundary

9.    Choose Send Test Email.

10.   From your test recipient email address, open the test email that you sent.

11.   After you open the test email, go to the email address that you used as the endpoint for your Amazon SNS topic subscription. Verify that you received an email event notification from Amazon SES. This message contains the email address of the recipient who opened the test email.

Configure Amazon SES to send information about email clicks and opens to CloudWatch

1.    Open the Amazon SES console.

2.    In the navigation pane, under Email Sending, choose Configuration Sets.

3.    Choose the configuration set that you created.

4.    For Add Destination, select CloudWatch.

5.    For Name, enter a name for the CloudWatch destination.

6.    For Event types, select Click and Open.

7.    For Value Source, select Message Tag.

8.    For Dimension Name, enter the name that you want to use for this metric in CloudWatch. For Default Value, you can enter Null as an example.

9.    Choose Save.

Send a test email to verify the CloudWatch metric

1.    Open the Amazon SES console.

2.    In the navigation pane, under Identity Management, choose Domains.

3.    Select one of your verified domains.

4.    Choose Send a Test Email.

5.    For Email Format:, choose Raw.

6.    For From:, enter an email address with your verified domain.

7.    For To:, enter an email address that you want to use as a test recipient.

8.    For Message:, enter text that's similar to following example. Replace myConfigset with the name of the configuration set that you created. Then, replace Email=Null with the Dimension Name and Default Value ( Dimension Name=Default Value) that you entered for the CloudWatch destination in your configuration set.

X-SES-CONFIGURATION-SET: myConfigset
X-SES-MESSAGE-TAGS: Email=NULL
From: test-verified-domain@example.com
To: test-recipient@example.com
Subject: Test email
Content-Type: multipart/alternative;
    boundary="----=_boundary"

------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

This is a test email.

<a href="https://aws.amazon.com/">Amazon Web Services</a>
------=_boundary

9.    Choose Send Test Email.

10.   From your test recipient email address, open the test email that you sent.

11.   Open the CloudWatch console.

12.   In the navigation pane, choose Metrics.

13.   From the All metrics view, choose SES.

14.   Choose the metric that you created.

15.   Verify that the graph shows the test email that you opened.


Did this article help you?

Anything we could improve?


Need more help?