This article describes the usage for our component GooglebaseXML. This extension for Joomla and Virtuemart generates a product feed which can be uploaded to Google Merchant Centre for submission to Google product search and Google Shopping.
This documentation is for the version 4 series of GooglebaseXML. The component requires Joomla 2.5 and Virtuemart 2. You can find documentation for older versions of the component, compatible with older versions of Joomla and Virtuemart, here.
Upload and install as normal using the Joomla! installer.
Basic usage is quite straightforward. Once you have installed the component go to components->Googlebasexml on your admin menu. This will bring up a simple control panel for Googlebasexml. Clicking the options button will bring up the global options for the feed. All options can be set globally, or on a per-feed basis. We discuss the options below. We recommend that you do read the documentation first, before submitting your feed to Google.
You will need to create one or more feeds. Click the 'new' button to create a new feed. Under 'Details' you need to give it a name. This name will not be output in the feed, so you can give it a name that is most helpful to you. Now set the feed options, and click 'Save and Close'.
Now you should see your feed listed, including its title and URL. You can create as many feeds as you want, and submit them all to Google. This is useful when you want feeds targetting more than one country, you can create a feed for each country. Also if you have a lot of products you may need find it helps to have several feeds, each of a smaller sizer.
The URL will look something like this: http://www.mysite.com/index.php?option=com_googlebasexml&format=xml&id=1. This is the URL that you can submit to Google for scheduled upload. The feed will be dynamically generated so is automatically updated to reflect your current products.
Alternatively you can just click the link to see the generated feed. The save the resulting page to your computer as a text or XML file, then you will be able to upload it manually to Google.
You can find details of Google's feed specification here. You should read it carefully. If you do not follow its requirements your feed will probably be rejected.
The format of the product data stored by Virtuemart is substantially different from that required by the Googlebase feed specification, hence it requires some extra work to support all the Google feed attributes. However this can be done with GooglebaseXML. The component supports the following main product attributes:-
id, title, link, price, sale price, sale price effective date, description, condition, gtin, brand, mpn, image link, additional image links, product type, google product category, availability, quantity, shipping, manufacturer, shipping weight, featured product.
Additionally the component allows for the variant attributes: size, color, age group, gender, pattern and material. If your Virtuemart products include child products then the component can display these as product variants. If you are going to do this it is important to read Google's feed specification carefully.
Because Virtuemart does not directly support many of these attributes it is necessary to use a bit of ingenuity to use them. Where the attribute will normally have a constant value for most or all your products the easiest way is to to define a default value in the component parameters. Where the attribute varies for your products then the recommended method of including the information is through the use of Virtuemart custom fields. There is also a simple method of embedding condition, mpn and gtin data, simply by including it in the product description (this is described below), however recommend using the custom field approach, it is more flexible, for example you can choose to hide it from customers by making it a hidden field.
The basic options should be quite easy to understand. There are some important points:
1) The title, description and store URL are required, and will be included in the feed.
2) Google requires a unique identifier for each product. If you don't have an identifier for the product it will not be included in the feed. If your store uses SKUs (stock keeping units) for your products it is a good idea to set the product identifier to the SKU. Otherwise you will need to set it to the product id. This is the identifier generated automatically in the product database so will alway exist.
3) If your store just uses a single language and currency, and you are just submitting the feed for one target country (and are not including shipping information, see below for more about shipping), then you do not need to set the target country, language, or currency, in fact it is probably better not to. The default values for your store will automatically be used.
If you are including shipping information, or you are submitting feeds targetting more that one country, you will need to set the target country. If you are submitting to more than one country you can use the 'Add country code to identifier' option to generate a unique identifier per product per feed, which Google requires.
4) You can choose to limit your feeds to specific categories, or paginate your feeds. The normal reason for doing this is when you have a lot of products, and your server runs out of memory trying to generate the feed. In this case you can try generating a feed for each of your main categories and submitting each feed to Google separately.
Alternatively you can use the limit and limit start options. 'Limit' will control the number of products included in the feed, 'Limit Start' controls the number of products skipped before the count starts. Note that the count starts from 0, not 1. An example should make this clear. Suppose you have 5,000 products. That is a lot of products, and the chances are that your server will run out of memory before generating a feed of that size if you try to include all the products at one. To solve this, you can create 5 feeds. The limits will be set as follows for each feed:-
This tab allows you to set options for supplying product information such as the brand, condition, GTIN, MPN, tax and shipping.
There are a variety of ways in which the brand information can be set: setting a default value, using the Virtuemart manufacturer, using the category name, using a custom field (see above for an explantion of how to use custom fields). How you want to do this will depend on how your store is organised. For example some stores group their product categories by brand, so using the category name is a natural choice. However if most of your products have the same brand, using a default value may be the natural choice, with perhaps a custom field to override this in case of any exceptions.
Google accepts only the following values for this: new, used, or refurbished. You can set the default value for this attribute for your site using the component 'default product condition' parameter. You can create a custom field to supply the value (see custom fields above). You can also over-ride the default value for an individual product by including one of the following in your product description:-
For example, if your site sells mostly new stuff with a few refurbished items you might want to set a default value of 'new' for your products' condition, and include the string 'Condition: Refurbished' somewhere in your product description.
The other required attributes are self-explanatory, since they match Virtuemart data fields. Note that Googlebase will not accept free items, so the component tests whether the product price is greater than 0 before listing a product.
GTIN stands for Global Trade Identification Number. This is a unique product identifier for your product. These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books). You can include any of these values within this attribute. You can create a custom field to supply the value (see custom fields above).
Alternatively you can embed the information in the product description. To include a gtin, add one of the following to your product description:-
Note that the numbers above are examples, you will need to replace them with the actual product code number.
MPN stands for manufacturer product number (the number which uniquely identifies the product to it's manufacturer). You can create a custom field to supply the value (see custom fields above). Alternatively, to include this attribute, include the following in your product description:-
Please note that the number is an example, replace this with your actual number. The code can accept the following characters: a-z A-Z 0-9 :\-_
Google accepts text such as 'Home & Garden > Kitchen & Dining > Appliances > Refrigerators' for this attribute. The Googlebasexml component constructs this from the category path for the product.
Google product category must correspond exactly to the product taxonomy defined here: http://www.google.com/support/merchants/bin/answer.py?answer=160081
For example: Food, Beverages & Tobacco > Food Items > Grains, Rice & Cereals.
There is no need to worry about escaping the > and & characters, this will be done automatically when the feed is generated.
If most of your products belong to the same category the easiest way to set this attribute is through setting a default value in the GooglebaseXML parameters. If you want to override this for an individual product you can do this by setting up a custom Google category field as a product custom field (see custom fields above).
This attribute consists of text with only three accepted values: 'in stock', 'out of stock', 'available for order','preorder'. You can set the default value for this attribute using the component 'Default Product Availability' parameter. If you want to override this for an individual product you can do this through the Virtuemart product editor, which includes an 'availability' field (on the product status tab), or through setting up a custom product availability field.
You can set the main shipping data through the Google merchant centre control panel. If you are using weight-based shipping the feed can display shipping weights. If you are not using weight based shipping it is best to turn off the 'show weight' option, it may cause problems for your feed.
You can also have the feed calculate shipping directly using the Virtuemart standard weight-based shipping. It should be stressed however that there really is no good reason to do this, it will involve the feed generation in a lot of extra calculation. Provided you have specified your shipping rules correctly in the Google Merchant Centre and turned on the 'show weight' option in the feed, Google can do this work for you. If you do elect to display the shipping costs in the feed you must select the target country, so that the correct shipping rules can be selected.
The feed can optionally display additional attributes such as gender, age group, colour and size. These are required for clothing products in the US, and optionally can be included for other items and other countries. You can use custom fields to represent this data. Please note that you will actually have to have some custom fields defined in order for there to be selectable options for the size, colour etc data.
Google also allow you to submit data for product variants. They define variants as a group of identical products that only differ by the attributes ‘color’, ‘material’, ‘pattern’ or ‘size’.
The feed can display child products as product variants by selecting the 'Show Product Variants' option on the 'Product Variant Options' tab. If this option is selected, for products that have children, the child products will be displayed instead of the parent product, which will not be displayed. If this option is not selected child products will be excluded from the feed, only the parent products will be displayed. Simple products that do not have children or parents are unaffected by this option.
If you want to display product variants it is a good idea to read Google's feed specification carefully, specifically the section on product variants: http://support.google.com/merchants/bin/answer.py?hl=en-GB&answer=188494&topic=2473824&ctx=topic#GB .
You will not normally need to set the advanced options. However for reference this is what they do:-
When this happens it is because the script is running out of memory, which can happen if you have a large number of products.
The script includes code to increase the memory size by changing the PHP configuration, but some hosting providers do not allow the configuration to be changed at run-time.
You may be able to solve this by putting a text file in the root folder of your site called php.ini - this should contain the line:-
which will increase the memory to 256 megabytes. You can experiment with this value if you require more.
An alternative is to submit multiple feeds as described above using the Limit and Limitstart parameters. This is the option that we recommend. Once you have set up the feeds you only need to submit them to Google once, they can be automatically submitted by scheduled upload in future.
This problem is usually caused by faulty 3rd party system plugins which contain whitespace characters such as a space or line break outside of PHP tags. These characters are output directly, ahead of the feed, resulting in an empty space before the opening <xml> tag in the feed. Unfortunately the specification for an XML document is very precise and this is not allowed: the <xml> tag must be the very first thing in the document. The result is a parsing error.
There is more information about how to track down the source of the error here. We also include an option 'Clean Output Buffer' on the advanced tab of the configuration options. You can turn this option on, it will attempt to solve the problem by forcibly emptying the Joomla output buffer before the feed is generated. This is not guaranteed to work, but it may.