Storing last login date as a marketing tool

If you're not already tracking your users' last login date in your database, you might want to consider it. The storage space footprint is minimal, and it provides another way to keep tabs on your user activity.

It can also be an effective email marketing tool. Imagine if you were able to tailor an e-newsletter to only those users who haven't logged in for over a year. You could explain the changes to your site that have happened since they last logged in. Not to mention the effect of personalizing an opening line, such as

"We haven't seen you in months!"  or "We haven't seen you in years!"

On the technical side, if you are concerned about space, use only your databases date field, as it uses less space than a full timestamp field. However, if space is not an issue, it may not be a bad idea to store the date and time of user's last login.

Keep in mind, you don't want this to be a "default timestamp" field. For example, some databases provide a quick TIMESTAMP field which automatically updates whenever any field in the record is updated. For obvious reasons, this is a bad idea. It will lead to inaccurate last login times. Stick with the DATETIME field, and update it during the user authentication process.

Why follow me on Twitter?

  • I tweet about new technologies, services or libraries I find interesting
  • Yeah, sometimes I'll post a pet-peeve or rant about something trivial
  • If I discover something that made my web development life easier, I share it
  • I'll shout out any handy tip that I think might be useful to other devs
  • Very rarely anything promotional


Tagged .

Updated: 2012-03-25

Phil LaNasa follow us in feedly