we have seen recently that the "Online customers" report is always empty + also the column customer_id in table report_viewed_product_index is always NULL

I know because on our DEV server the column customer_id is always a number (never NULL) ....

What setting in Magento can influence this behavior? Has anyone seen this before?

enter image description here

1 Answer 1


I don't know what your problem might be, but I can explain how the values end up in that table.
when a product page is viewed, the event catalog_controller_product_view is dispatched.
This event is observed by Mage_Reports_Model_Event_Observer::catalogProductView.

This method just instantiates a model and saves record in the table report_viewed_product_index


In the _beforeSave method for the model Mage_Reports_Model_Product_Index_Viewed the visitor id and customer id are set.

Check Mage_Reports_Model_Product_Index_Abstract::_beforeSave.

I wasn't able to reproduce your issue, but I thought that the stacktrace may help you debug the issue.

  • I see public function getVisitorId() that uses Mage::getSingleton('log/visitor')->getId(); - can it be that we turned of the log model somewhere?
    – snh_nl
    Jun 26, 2015 at 11:21
  • @snh_nl could be.
    – Marius
    Jun 26, 2015 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.