I want to show the most viewed products but when I look at the backend Report->Viewed is empty. Also, I looked at the report_viewed_product_index this table is empty
how I can get mostly viewed products?
To check this you can go to:
Stores -> Configuration -> General -> Reports
Check if the reports are enabled.
First, try to Refresh Statistics. You will find it at reports -> Statistics -> Refresh Statistics. After that check, it will work fine.