Simple event logging

Measuring everything doesn’t necessarily have to involve complex analytics tools, or lots of development.

Here is a simple way to quickly log events of interest, for example if you are running an AB test.

Create a single table in your database with the following columns:

event_log

  • user_id
  • other_id
  • event_type (either a string or a foreign key)
  • details
  • timestamp

Then whenever something happens that you want to track, insert a row.  You can use the details field to track whatever data is relevant to the event.

Optimise the table for inserts, so that you can quickly add rows whenever required.  Then export the data when you want to run reports.  You can flush all of the data when you have your answer (or do it automatically every week, or month)

Easy.