title: magento report_event table analysis
body: <p>I have a requirement to create a number of custom reports on the magento data.</p>
  
  <p>The first job I have to do is to improve on the ‘Products Viewed’ report integrated into Magento.</p>
  
  <p>I have managed to work out that the data for this report is taken from the ‘report_event’ table, however there are some peculiarities with this data I need to understand.</p>
  
  <p>Firstly, I assume that where event_type_id is 1 (i.e. ‘catalog_product_view’ according to the reference table), the columns object_id and subject_id store the ID of the product and the ID of the visitor respectively. However, there are a large number of entries where subject_id is zero, but object_id holds the id of a valid product.</p>
  
  <p>What I need to know is how this can occur… i.e. how can we get an entry in the report_event table where the following are all true:</p>
  
  <p>event_type_id = 1</p>
  
  <p>object_id = [valid product id] </p>
  
  <p>subject_id = 0</p>
  
  <p>Many thanks in anticipation</p>
  
  <p>Si</p>