If you're building an ecommerce website that sells a number of different kinds of goods, you might want to institute tagging. This mainstay of many Internet sites makes it easier to categorize items, and can assist your visitors in finding what they're looking for. This four-part article series shows you how to add tagging support to your site using Ruby on Rails. This article is excerpted from chapter seven of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
In this chapter, we will extend the Emporium site to support tagging. Tagging, which is done by assigning a set of tags (keywords) to an entity, is used by some of the most respected web-sites on the Internet. For example, Amazon, Yahoo, and Google allow their users to categorize and link together a variety of information with the help of tags.
Adding tagging functionality to an e-commerce site has several benefits. One benefit is that tagging simplifies the categorization of content. A good showcase for the benefits of tagging is del.icio.us, which uses a collaborative form of tagging (folksonomy) where all users are allowed to bookmark websites and assign tags to them. The success of del.icio.us can largely be attributed to tagging, because it simplified the way people could categorize and find their bookmarks.
Another benefit of tagging is that it allows you to make recommendations to your customers. Say, for example, that your customer is browsing a book on programming that has been tagged with the keywordsRuby andProgramming. You can then show other books that share these tags, and this will probably increase your sales.