title: Magento Recently Viewed Products for non logged users
body: <p>I'm using default magento 1.9.x Recently Viewed Products block on a CMS page </p>
  
  <pre><code>{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}
  </code></pre>
  
  <p>But default magento Recently Viewed Products block only support for logged in users, so it only show when i logged in</p>
  
  <p>I checked the file</p>
  
  <pre><code>/public_html/app/code/core/Mage/Reports/Block/Product/Abstract.php
  </code></pre>
  
  <p>and It's <strong>line number 138</strong> function set a customer id for product collection for filter the results.</p>
  
  <p>But i think normal site visitors not have that kind of id.</p>
  
  <pre><code>if ($this-&gt;getCustomerId()) { 
                         $this-&gt;_collection-&gt;setCustomerId($this-&gt;getCustomerId());
   }
  </code></pre>
  
  <p>Anyone know how to get recently viewed products by setting an id to above or by using another way.</p>
  
  <p>i also tried this answer but it didn't work at all</p>
  
  <p><a href="https://stackoverflow.com/questions/15682483/how-to-get-recently-view-product-for-guest-user-in-magento">How to get Recently View Product For Guest User In Magento</a></p>