title: Gathering User Activity Data on a Website
body: <p>I'm currently developing a web application and the client wants to store data around user activity on the site. This is outside of what Google Analytics could provide.</p>
  
  <p>I currently have a nice simple database structure with a minimum number of tables which all relate to the core functionality of the website. </p>
  
  <p>I'm a little begrudged at adding a lot of tables to the database schema to record user activity. And also muddy the code base by adding services to record user activity on the site.</p>
  
  <p>Examples of what they want recording are:</p>
  
  <ul>
  <li>logins for existing users</li>
  <li>explicit logout by user</li>
  <li>password resets by admin</li>
  <li>password reset/change by user</li>
  <li>change of user account (e.g. grant/remove admin permissions or
  profile changes if we have profiles)</li>
  </ul>
  
  <p>They may also want to record</p>
  
  <ul>
  <li>Search parameters entered into a search form</li>
  <li>access of any (content) page</li>
  <li>selection of any (content) link</li>
  <li>language selection</li>
  </ul>
  
  <p>So my question is:</p>
  
  <ul>
  <li>Should I just add this functionality to the database and project?</li>
  <li>Should I separate this as much as possible, possibly store this
  analytical data in a separate database, or maybe in a different
  schema, create a separate project for analytical services.</li>
  <li>Are there anymore options?</li>
  </ul>
  
  <p>I just feel recording this data will bulk the code base and database, and have very little gain….</p>