Google has a product search feature, which allows users to search specifically for products using the Google search engine. Products can be added to this search engine using the Google merchant center.
The Google merchant center is an area where online retailers can list (and manage these listings) their products for including in the Google product search. Google merchant center is a specialized section of Google base: a search area that was designed for allowing anything to be added to the Google index — documents, notes, products, events, and so on, essentially anything that generally wasn't in a web page. As this service grew, the products aspect was spun off into the merchant center.
Apart from being able to manually add products, we can also add a feed of products. This feed of products would be tied directly to our store, updating in real time as we added new products, removed older ones, and updated details. By adding a feed, Google can keep an up-to-date copy of our product catalog for inclusion in its search results.
To get started with the Google merchant center, we need to sign up, or sign in at http://www.google.com/base/.
Within the merchant center, we can click on the Data feeds link on the left-hand side, and then on the New Data Feed button to create a new feed. Here we can set:
The Target country to determine who would see results from our feed
The Data feed type (googlebase)
A name for the feed, that is, the Data feed filename (for example
feed.xml)
After adding the feed to the Google merchant center, we set an update schedule.
The update schedule is where we actually tell the Google merchant center where our feed of products is, and how often it should be updated. When we have added our feed to the center, there is a link next to it under the Upload schedule column called Create. If we click on this, we will see the Scheduled Upload form. This form allows us to select:
How frequently we wish to upload the feed: Daily/Monthly/Weekly
When we want to update the feed (for example, day 15 of every month)
Our time zone
The URL of the feed
To be able to actually create the update schedule we discussed, we need a product feed. We could use a tab-delimited feed, which would be easy to do using a spreadsheet program. If we did it this way, we would need to create and upload the feed manually — something we don't want to do.
XML is a standard way of representing data, and is particularly useful when interacting with web services.
We could create a product feed controller, which generates the feed for us. One requirement for XML feeds in the Google merchant center, is that they end in .xml
, so we would have the controller search the second bit of the URL (for example, productsfeed/latest.xml)
split the string by the dot, and then depending on the first word, here latest
, display the relevant feed.
The controller would build a query of products, cache the results, and store them as a template variable, which would go into the XML template for the data feed.
<?xml version="1.0"?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0"> <channel> <title>Juniper Theatricals Product Feed</title> <link>http://www.junipertheatricals.test</link> <description> Theatrical supplies, props and costumes </description> <!-- START items --> <item> <title>{name}</title> <link> http://www.junipertheatricals.test/products/view/{path} </link> <description>{description}</description> <g:image_link>{image}</g:image_link> <g:price>{cost}</g:price> <g:condition>new</g:condition> <g:id>{ID}</g:id> <c:retail_price type="decimal">{cost}</c:retail_price> <c:promo_offer type="boolean">false</c:promo_offer> </item> <!-- END items --> </channel> </rss>
This is an XML feed showing some basic information for products. We can define our own custom elements to this too if we wish, such as how the product could be customized, if it is a downloadable product, if we can upload an image, the delivery time, and so on. More information on this is available from Google at http://www.google.com/support/merchants/bin/answer.py?answer=160603&hl=en.
For information on data feed specifications, visit http://www.google.com/support/merchants/bin/topic.py?topic=24946
In addition to adding feeds to the merchant center, we can also add products directly from our framework if we wish. We could do this using the Google Base Data API (http://code.google.com/apis/base/). Further details on inserting, updating, and deleting data items using this API are available at http://code.google.com/apis/base/starting-out.html#insupdel.
We've discussed Google quite a bit here; they are a very big player in this arena, being one of the most popular search engines around. There are some other options available, and these have their own specifications for data feeds, which are also supported by the Google merchant services center. These feed types include: