Pre-requisite knowledge:
I have a view of type Content which is meant to list the most recently viewed product variations (commerce product entities that the product node references) first. I am using the sort order criteria - Content statistics: Most recent view (desc).
I understand that this view should ideally have been of type Commerce Product and sort order criteria as Entity statistics: Most recent view (desc) (provided by Entity Statistics module).
Problem:
But the real problem is that only the product node page is viewed by the user, not the commerce product page. So the Statistics module (which comes with Drupal 7 core) logs the node view but Entity Statistics does not log the commerce product entity view. So even on using Entity Statistics - Most recent view (desc) sort criteria, the most recently viewed product variation doesn't appear first in view results.
Should I build a custom sort criteria for this purpose? If so, need help in how to do so and in which hook exactly.
Any workarounds or other suggestions are welcome as well!