Skip to content
mkcode edited this page Dec 4, 2012 · 1 revision

Mooc Documentation

Tagging

There is a convention for tagging emails as they are are sent out to get log data later. The goal of tagging emails is to have a unique set of tags each email and ave the tags categorize the emails in smart ways. You can look at the tags used by logging into the mailgun control panel and clicking on the "Tracking" tab.

The convention

  • intro, course - before the actual course begins, the intro tag is used. The first assignment email starts the use of the course tag.
  • assignment, encourage - during the course, we send out an assignment email on mondays and an encourage email on thursdays
  • week_* - the week_3 tag is applied to both the assignment and encourage emails during week 3
  • sequence_2 - all emails to sequence 2 have the sequence_2 tag applied. Sequence 3 will have the sequence_3 tag applied, etc. The first sequence does not have a sequence_1 applied.
  • intro specific - all the intro emails have a specific tag applied to them so they can be uniquely identified.

Logging

There are two separate sets of logs from mailgun.

Raw Logs

Raw logs come in directly when emails are sent out. Mailgun only keeps the past 100,000 raw logs so it does not work for long term storage. There is a webhook set to send the raw logs to mechanicalmooc.org/mooc-mailgun-log as they come in. Logs are added to the mood_logs table in our database. A regular expression parses out the group-id and stores it. ###API Logs API logs are accessible via the mailgun API. See here: http://documentation.mailgun.net/user_manual.html#logs These can be looked up via the tags that we set when sending the emails.

Getting Data

In a nutshell, the raw logs are used for getting group activity and the API logs are used for getting sequence email analytics.

Getting Group Activity Data

The raw email logs need to be parsed to get group activity. The mood_logs table adds 1 entry for every group email. If the group size is 40 people people, every email sent within the group will have 40 log entries - so to unique emails sent, the log entries must be divided by the group size.

Getting Sequence Analytics

See http://documentation.mailgun.net/user_manual.html#stats and query based on the tags.