Home > Software design >  Tracking AWS SES Event Metrics
Tracking AWS SES Event Metrics

Time:11-17

I'm trying to understand the best way to track SES event metrics for emails we're sending through SES. Currently, we're sending email campaigns using the API with SentTemplatedEmail(). The configuration set is currently not set up with any event publishing, which I know would be the first step.

My goal is to gather statistics on each batch of emails sent out, like bounce rates, opens etc. Perhaps even identify which email addresses bounced or had errors. Ideally I'd like to gather this information in our own admin system and store this in our internal databases.

I understand I can send the events to Cloudwatch or Kineses Data Firehose. If I were to do either one of these, how would I go about fetching/parsing the information out of these services in order to use it in our in-house apps? Don't understand which of the services above would be appropriate in this regard (if at all) and how to approach it from there.

Any suggestions on how to architecture this, or where to read up on how to do this? I've seen posts on how to go into Cloudwatch and look at metrics from within the console, but can't find much on how to extract this data.

UPDATE: I did find this: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-getting-metrics.html which would allow me to gather statistics for a time period. Not quite what I wanted, as I'd like to track statistics per a bulk send, but still useful. Also don't see a way to track which emails were rejected, so as maybe to remove them from our list.

CodePudding user response:

For bounced, success and complaints emails you need to enable the SNS topics for them in SES.

configure-sns-notifications

A SQS queue can then be connected to the SNS topic for example bounced emails and then you can get the SQS queue to trigger a Lambda that can process the bounced email information and save it to your DB for further analysis. You can then also use this to remove any email addresses from your address book that bounced and might affect your success rate. Note this is not fine grained.

For fine grained statistics look at this link. You will need to setup configuration sets in SES and use those when you send emails. That will allow you to do fine grained analysis in Cloud Watch.

amazon-ses-now-provides-fine-grained-email-sending-metrics

If you do not want to use Cloud Watch to analyze the metrics then you can export it to Kinesis Firehose or write it to S3 by setting up a Metric Stream in Cloud Watch.

Metric Streams

  • Related