Google Analytics is not sufficient for your use case. Your system doesn't have real time access to the data collected by Google Analytics for a particular user. Because of this, you can't use Google analytics data to change what is later displayed on the site to the user.
You may want to use Google Analytics to track which products get viewed on your website anyway. It is useful to see stats on your products to make decisions about which products to feature. If each product has its own page, then page tracking is appropriate. If products get loaded via AJAX then you will need to use events.
To display related products to users, you will also need to track a list of viewed products where the server can read it. User cookies or a server side session object would be the places that this information would normally be stored. Once you have a list of recently viewed products, your server can use that to generate a list of related products to show the user.
If you are just implementing Google Analytics for the first time, you should use Universal Analytics (analytics.js). That is the newer version with more features. Google will eventually be converting all sites over to it.