Logo Wyomind Magento workshop

Add-ons for Magento®

The Simple Google Shopping extension allows you to export quickly and safely a valid and well-structured data feed of your complete catalog of products from your Magento website to your Google Merchant Account.

219 Reviews

Simple Google Shopping
is available for Magento® 2

What are Google Merchant and Google Shopping?

What is Google Shopping?

Google Shopping is a free Google service allowing customers to find and compare products they want to buy online. If you are an online merchant, you can submit all your products to Google Shopping and attract potential customers by allowing them to view your products more easily.

Google Merchant Center is a product management interface designed to assist merchants in submitting their items to Google Shopping.

How to create my Google Merchant Account?

In order to submit your products to Google Shopping, you need to create a Google Merchant Account. Click on the following link for further information on creating an account: https://www.google.com/support/merchants/bin/answer.py?hl=en&answer=188924

This account gives access to the Google Merchant interface. There you can manage all your product data feeds and plan any daily, weekly or monthly updating tasks.

What is a products data feed?

A data feed is a file made up of a unique group of attributes that define each one of your products. This allows customers to search and find your items more easily. This file is similar to an RSS data feed but includes some specific XML tags used by Google Merchant Center or any other shopping engine.

To know more about the product data feeds, have a look to the Google Merchant Center support site: https://support.google.com/merchants/answer/188478?hl=en

How to create a products data feed?

Simple Google Shopping and Data Feed Manager are two Magento extensions that allow you to quickly configure, generate and automate several product data feeds.

Once the Simple Google Shopping or the Data Feed Manager extensions have been installed on your Magento website, go to your Magento admin panel and select Simple Google Shopping / Data Feed Manager from the Catalog tab.

Simple Google Shopping includes one ready-to-configure template and Data Feed Manager includes several ones. These templates will help you to create your first product data feed. You can also customize a configuration or copy an existing one.

 

Try Simple Google Shopping - Try Data Feed Manager

For a quick start, follow our tutorial.

Getting started with data feeds management

How to generate XML files with Simple Google Shopping

All XML data feeds used by shopping engines, like the one used by Google Shopping, are really simple to build but often have their own specifications.

Simple Google Shopping and Data Feed Manager provide one or more ready-to-configure templates. These templates will allow you to build a valid and well-structured data feed quickly.

7 Things to know when creating an XML data feed with Simple Google Shopping:

1. An XML data feed is using an opening and closing tag that includes a value.

<tag>value</tag>

2. For each product you are exporting, you need to choose which tag to use. Most of the time, there is a tag for each attribute.

<g:id>123456</g:id>
<price>45.99 USD</price>

3. When you are building your XML template, you can include between every opening and closing tag one or several Magento attributes. An attribute is specified by its code name and must be enclosed using brackets.

<g:id>{sku}</g:id>
<price>{price}</price>

4. Between every opening and closing tags, you can also include some fixed values. Fixed values are simply text.

<g:brand>YOUR BRAND</g:brand>

5. You have also the possibility to add several attributes and fixed values in a same tag.

<title>{name},available in {color}-{size} for only ${price}</title>

6. You're allowed to use PHP code if you want to customize the pattern. You just have to write your PHP code in one single line, and it will work perfectly (check how to add PHP scripts into your templates).

7. The syntactic coloration in Simple Google Shopping will help you to avoid any error in your template. First, the errors will be underlined in yellow. You need to correct each error before checking syntax once again. Finally, you'll be able to check data.

Attribute management in the Simple Google Shopping templates

All the default Magento attributes and also all your own attributes can be retrieved in any template. For example :

<product>{name}</product>

Please refer to the Basic attributes section to learn more.

Some Magento attributes like price, image or url may have further configuration options that will correspond to your specific data feed needs. For example:

<price>{price,[EUR],[FR]}</price> 

Please refer to the Special attributes section to learn more.


Some Magic attributes are unique to the Google Shopping data feeds. These attributes act as shortcuts to create complete portions of XML in your data feed.  For example:

{G:PRODUCT_TYPE}

Please refer to the Magic attributes section to learn more.


You can use the OR operand with all these attributes (without option). See example below:

{attributeA | attributeB}

If attributeA exists then the value will be attributeA, otherwise, the value will be attributeB

How to use Simple Google Shopping?

STEP 1: Configure Simple Google Shopping in a general way

Before being able to configure your data feeds, you should configure the extension in a general way. To do so, go to System > Config > Wyomind > Simple Google Shopping.

Cron job reporting

In the Cron job reporting tab, you can activate the cron job reporting and fill in an email address to receive the reports. You can also rename the reports as you want. Finally, you have the possibility to enable the debug mode.  

Core Settings

In the Core Settings tab, you'll need to configure a certain number of fields.

  • Items in preview: By default there are 10 items in preview, if you want you can reduce or increase that number. 
  • Items in buffer: By default, products are inserted into the file on the server every 10 items but you can reduce or increase that number.
  • Items in SQL request: By default, there are 1500 items in each MySql query.
  • Number of advanced filters: By default, you have 10 advanced filters. If you need more, you can at any time increase that value.
  • Use of OR/AND statements in advanced filters: and/or statements can be used in the advanced filters simply by enabling that option.  
  • Include not in menu categories: you can also include the categories of products that are not in the menu.  
  • Memory limit size (M): The default memory limit is 1024.
  • Use canonical urls: you have the choice between several options. You can choose to use the shortest category url, the longest one or the product url.

STEP 2: Configure your data feeds with Simple Google Shopping

To create and configure your data feeds, go to Catalog > Simple Google Shopping..

Your data feeds will be listed according to IDs.You will find the name of the file, its path as well as the link to the data feed file. You should also get a message that sums up the number of products exported, the time it took and the number of errors and warnings in your data feed.

The status of your data feed will vary according to the situation:

  • Pending: the data feed has never been generated or the scheduled hour is past (waiting for the execution from the cron task)
  • Success: successull generation of the data feed, manually or automatically (the generation corresponds with a schedule)
  • Hold: in the process of generation (latency, indeterminate status)
  • Processing: generation progression percentage
  • Error: the generation is stopped

You should find the date and the hour of the last generation of the data feed as well as the Store view taken into account for the data feed

From the Action dropdown, you'll be able to:

  • Generate
  • Edit
  • Preview (10 products)
  • Show Report
  • Delete

Errors and warnings reports

From Simple Google Shopping 9.0.0, you can get reports on the errors and warnings of your data feeds.

Those reports do not replace the error reports from Google and are by no means a guarantee that your data feed will be approved by the Google team. This will help you to save time by quickly identifying the main problems of your data feed and by making the necessary changes.

The reports are available:

  • from the action dropdown in Catalog > Simple Google Shopping

  • from the blackbox when editing a data feed

  • In orange will be displayed the warnings such as: Missing recommended attribute: product_type.
  • In red will be displayed the error that you must correct to be able to submit your data feed. For example: Missing required attribute: google_product_category.

Next to these errors or warnings, you should see the number of items that are concerned.

By default, the reports will give the 10 first examples (sku) that are concerned with each error and warning. You can change that by editing the Items in preview in System > Config > Wyomind > Simple Google Shopping > Core Settings.

Create a template

To create your own data feed, you need to go to Catalog > Simple Google Shopping. There, click on Create a new data feed. You now have to configure your data feed as you want.

When creating a data feed, you should see a blackbox on the right of your screen. The Simple Google Shopping extension includes that tool to help you create your feed and see what is wrong.

The blackbox is inevitably a very useful tool. This will help you to configure your data feed more quickly.

Here are the different options of the blackbox:

Syntax validation: This button allows you to check if your syntax is correct. It helps you to see if you have forgotten a bracket or a coma by underligning in yellow the part of text that contains a mistake.

Attributes library: If you click on that button, a library of your store attributes will be displayed. This makes it easier to find very quickly which attribute you need to add into your template.

Data preview: When clicking on Data preview, you'll see a preview of your data feed. It's very useful to see if the values of your attributes are correctly retrieved or if your filters are working. 

Error report: When clicking on that button, it will display a report on the errors and warnings of your data feed. This feature is only available from Simple Google Shopping 9.0.0.

Configuration

In that first tab is the main configuration of the data feed. You'll find several fields to fill in that will allow you to customize your feed.

  • File name: enter a name for the file.
  • Path: define the path where you want the data feed to be generated. For example /feeds/. 
  • Store View: define which store view is concerned.
  • Website url: add your website url.
  • Title: add a title to your feed.
  • Description: add a description to your data feed.
  • XML template: this is probably the most important field as this is where you will configure your template

Categories

In the Categories tab, you will find 2 subtabs that will allow you to manage your categories.

Category filter type

You can filter your categories according to two different ways:

  • Exclude all products from the selected categories.
  • Include all products from the selected categories.
If you don't select any category, all products will be exported.


For example, if you wish to include only products of the Apparel category, you can configure your filter in two different ways.

First of all by ticking the Include option that will allow you to include all categories that you have selected.

Or via the Exclude option that will exclude all categories you have selected.

From Simple Google Shopping 9.0.0, you will have different possibilities to filter your categories.

You'll be able to include or exclude your categories depending on:

  • Product categories only
  • Product and parent categories
  • Parent categories only

Imagine you have a configurable product with simple variants associated. The configurable has a category assigned but not the variants. In that case, you'll need to select Parent categories only.

On the contrary, if you have categories assigned to simple variants but not to the configurable product, you'll need to select Product categories only.

In the case where you have both situations, you can select Product and parent categories.

Category selection and mapping

In that subtab, you can map your categories to Google ones. This step is very important so that Google can make a link between their product categories and yours.

With Simple Google Shopping, you have the possibility to change the file on which the category mapping is based. From Simple Google Shopping 9.0.0, taxonomy files for the main countries are directly included to allow you to map your categories more easily. You can also have a look to our faq to know how to add a new taxonomy file.

Check our faq to know how to map your categories.

Filters

Simple Google Shopping also allows you to filter your products on several levels according to their attribute sets or their visibility for example.

With Data Feed Manager 7.3.0 and Simple Google Shopping 9.0.0, you can now select all the filters in one click.

Product Type

First of all, you can choose to include products to your feed according to their type. For example, only include simple, virtual and downloadable products.

Attribute Set

You have the choice to include several attribute sets. In our case, we've decided to include only attribute sets that are linked to the Apparel category.

Product Visibility

Then, choose the products that will be included to the feed between the products that are not visible individually, products from the Catalog, the Search results, or both.

Advanced Filters

In the Advanced filters, you can go further by setting more personalized filters.

For example, we wanted to include only products which price is higher than 0, and which SKU and name are not null.

Here again, you have the possibility to configure your advanced filters according to several options.

LIKE / NOT LIKE

like: starts / ends with the character string / includes the character string. Eg:

  • name like %shirt: will include all products which name ends with 'shirt'.
  • name like Apple%: will include all products which name starts with 'Apple'.
  • name like %women%: will include all products which name contains the 'women' character string.

not like: doesn't start / end with the character string / doesn't include the character string. Eg:

  • name not like %shirt: won't include any product which name ends with 'shirt'.
  • name not like Apple%: won't include any product which name starts with 'Apple'.
  • name not like %women%: won't include any product which name contains the 'women' character string.

IS NULL / IS NOT NULL

is null: the value is null. Eg:

  • Special price is null: will include all products that don't have special prices.

is not null: the value is not null. Eg:

  • SKU is not null: will include all products which SKU is not null.

IN / NOT IN

in: is in (selection of several options). Eg:

  • Brand in Acer Apple Sony: will include only products from these 3 brands.

not in: is not in (selection of several options). Eg:

  • Brand not in Dell Toshiba: will include all products which brand is not Dell or Toshiba.

You can activate the AND/OR statement in System > Config > Wyomind > Simple Google Shopping.

Scheduled tasks

Simple Google Shopping provides you a fully configurable schedule in the Scheduled task tab of your template configuration for each data feed. You just have to tick the days and hours when you want your feed to be generated.

If you're facing some difficulties with scheduled tasks, or if you think your feed is not automatically generated, have a look to our faq on that subject.

Improve your data feed with Simple Google Shopping

Attribute specifications

Basic attributes & basic options

Basic attributes are the default attributes defined in Magento and also include any attributes you have defined for your products. (eg: name, description, short_description, weight, size, color)
You can apply one or more options to all of these attributes by using the following syntax:
{attribute_code,[option1],[option2],[option3],[...]}

All options are executed in the written order eg:

<title>{name}</title>
<title>{name,[htmlentities],[strtolower]}</title>
<title>{name,[htmlentities],[strtolower],[ucwords]}</title>
will produce:
<title>NOKIA© 2610 Phone</title>
<title>nokia&copy; 2610 phone</title>
<title>Nokia&copy; 2610 Phone</title> 

{attribute_code,[strip_tags]}

Remove all html tags.

For example:

<description>{description,[strip_tags]}</description>

{attribute_code,[cleaner]}

Remove all characters that don't belong to the utf8 charset.

For example:

<title>{name,[cleaner]}</title>

{attribute_code,[substr],[max_length],[end_string]}

Truncates the value.
  • max_length: maximum length of the value
  • end_string: string that will be added at the end of the string. By default: [...]

For example:

<description>{description,[substr],[50],[...]}</description>

{attribute_code,[strtoupper]}

Transforms the value to upper case.

For example:

<title>{name,[strtoupper]}</title>

{attribute_code,[strtolower]}

Transforms the value to lower case.

For example:

<title>{name,[strtolower]}</title>

{attribute_code,[inline]}

Removes all EOL characters from the value.

For example:

<description>{description,[inline]}</description>

{attribute_code,[html_entity_decode]}

Converts all HTML entities to their applicable characters.

For example:

<description>{description,[html_entity_decode]}</description>

{attribute_code,[htmlentities]}

Converts all applicable characters to HTML entities.

For example:

<description>{description,[htmlentities]}</description>

{attribute_code,[implode],[separating_string]}

Joins all array elements in a string.

  • separating_string: string used between each value. By default it is a coma (,).

May be useful for multi-select attributes like color.

For example:

<g:color>{color,[implode],[,]}</g:color>

will give: black, blue, red, green.

{attribute_code,[float],[decimals]}

Converts a numeric value to a floating number.

  • decimals: number of floating number. By default [0].
For example:
<g:shipping_weight>{weight,[float],[2]}kg</g:shipping_weight>

Special attributes

{inc}

Retrieves an auto-incremented value, starting at 1.

{price}

Retrieves the normal price or the special price if it exists.

If prices are exclusive of VAT and the product is liable to a unique VAT rate, the price retrieved will include this rate. Otherwise, the price exclusive of tax is retrieved.

For example:

<g:price>{price}</g:price> 

You also have the possibility to use some parameters with this attribute:

  • currency is for currency conversion. This option automatically converts the original product price to a specified currency. It uses an exchange rate already stored by you in your admin panel. By default, your local currency is used.
  • vat_rate is a floating value between 0.00 and 100.00 that represents an arbitrary VAT rate to apply. This option rewrites the VAT rule for the product except if the product doesn't have any tax class. 
<g:price>{price,[currency],[vat_rate]}</g:price> 

Here are some examples:

To convert the prices to EUR and apply a 20% VAT rate:

<g:price>{price,[EUR],[20.0]}</g:price>

To convert the prices to USD and not apply any VAT rate:

<g:price>{price,[USD],[0]}</g:price>

If the prices of your catalog are already including VAT:

<g:price>{price,[EUR]}</g:price>

To use an ISO2 code corresponding to one of the countries for which you specified a VAT rate in your tax settings (from Simple Google Shopping >= 5.1.0, and Data Feed Manager >= 3.0.0):

<g:price>{price,[EUR],[FR]}</g:price>

This code may also be completed by an area code:

<g:price>{price,[USD],[US/NY]}</g:price>

To deduce the VAT corresponding to a country/area:

<g:price>{price,[USD],[-US/NY]}</g:price>

To retrieve prices including different price values for simple products associated to a configurable one (from Data Feed Manager v7.3):

<g:price>{price parent,[EUR],[20.0]}</g:price>

Note that for Simple Google Shopping < 4.6.1, currency and vat_rate are swapped.

{normal_price}

Retrieves the price and ignores any existing special price value.

For example:
<g:price>{normal_price}</g:price>
You also have the possibility to use the same parameters than the {price} attribute.

{special_price}

Retrieves the promotional price (special price) if exists.

If this price doesn't exist the value is null.

For example:
<g:price>{special_price}</g:price>
You also have the possibility to use the same parameters than the {price} attribute.

{price_rules}

Retrieves either the price or the special price or the price including the catalog price rules if indicated.

For example:

<g:price>{price_rules}</g:price>

You also have the possibility to use some parameters with this attribute:

  • currency is for currency conversion. This option automatically converts the original product price to a specified currency. It uses an exchange rate already stored by you in your admin panel. By default, your local currency is used.
  • vat_rate is a floating value between 0.00 and 100.00 that represents an arbitrary VAT rate to apply. This option rewrites the VAT rule for the product except if the product doesn't have any tax class.
<g:price>{price_rules,[currency],[vat_rate],[customer_group_id]}</g:price> 
From Data feed Manager v7.4.4
  • customer_group_id allows you to determine which price rules must apply for a given custom group id (by default the "NOT LOGGED IN" cutsomer group applies)
<g:price>{price_rules,[currency],[vat_rate],[customer_group_id]}</g:price> 

{is_special_price}

Retrieves either 1 if a special price exists or 0 if not

{is_special_price?[value_if_yes]:[value_if_no]}

 

  • value_if_yes value to retrieve if a special price exists. By default 1.

  • value_if_no value to retrieve if no special price exists. By default 0.

For example:

<g:is_special_price>{is_special_price?[yes]:[no]}<g:is_special_price>

{min_price}

Retrieves the minimum price.

For example:
<g:price>{min_price,[EUR],[20.0]}</g:price>
{min_price} must be used for Bundle and Grouped products.

{max_price}

Retrieves the maximum price.

For example:
<g:price>{max_price,[EUR],[20.0]}</g:price>
{max_price} must be used for Bundle and Grouped products.

{image}

Retrieves the product's main image.

{image,[index]}

  • index is the index of any additional images to retrieve. By default 0 (the main image).

For example:

<g:image_link>{image,[0]}</g:image_link>

{host}

Retrieves the host url, for example https://www.website.com.

Example with the {small_image} attribute:

<g:image_link>{host}/media/catalog/{small_image}</g:image_link>

{url}

Retrieves the product's canonical absolute url.

For example:
<link>{url}</link>
From Simple Google Shopping v9.3.0

The url attribute can receive the currency code as an url parameter to display the landing page with a specific currency, by example :

<link>{url}?currency=USD</link>

{uri} or {url_key}

Retrieves the product canonical relative url.

For example:
<url>https://www.mywebsite.com/mystore_code/{uri}</url>

{is_in_stock}

Retrieves either "in stock" if the product is in stock, "out of stock" if the product is out of stock or "available for order" if the product is backordered.
 
{is_in_stock?[value_if_in_stock]:[value_if_out_of_stock]:[value_if_preorder]}

  • value_if_in_stock value to retrieve if the product is in stock
  • value_if_out_of_stock value to retrieve if the product is out of stock
  • value_if_preorder value to retrieve if the product is backorderable

For example:

<g:availability>{is_in_stock?[in stock]:[out of stock]:[preorder]}</g:availability>

{stock_status}

Retrieves the stock status "in stock" or "out of stock".

For example:

<g:availability>{stock_status}</g:availability>

{qty}

Retrieves the available quantity.

The quantity retrieved for the configurable products is based on the sum of simple products.

For example:

<g:availability>{qty}</g:availability> 

{categories}

Retrieves a list of category paths separated by "," in which the product may be found

{categories,[number_of_category_path],[from_category_level],[number_of_categories_in_each_path]}

  • number_of _category_path, by default infinity

  • from_category_level, by default 1 (root catalog)

  • number_of_categories_in_each_path, by default infinity

Example:

{categories,[INF],[1],[INF]}

From Data Feed Manager v7.0.0

2 arguments can be used to specify the path separator and the category separator:

{categories,[path_separator],[category_separator]}

  • path_separator, by default "coma" (,).

  • category_separator, by default "higher than" (>)

Example:

{categories,[,],[>]}

Only one argument can be used to get the first or the last (deepest) category path:

Example:

{categories,[last]}
{categories,[first]}

A complete list of all categories per product can be handle with the following method:

<? $product->getCategoriesArray(); ?>

{review_count}

Retrieves the total count of all the reviews that your customers have left for the product.

{review_count,[storeview_id]}

  • storeview_id is the id of your store view. If not specified the current store view is used.
    "*" will count all reviews for all store views.

For example:

<g:product_review_count>{review_count,[*]}</g:product_review_count>

{review_average}

Retrieves the average score of all the evaluations that your customers have left for the product.

{review_average,[storeview_id],[base_value]}
 

  • storeview_id id of your store view. If not specified the current store view is used.
    "*" will count all reviews for all store views.

  • base_value the base number. By default 5.

For example:

<g:product_review_average>{review_average,[*],[3]}</g:product_review_average>

{category_mapping}

Retrieves any new category that you have assigned (in the Categories filter) to the item's own product category. If no mapping is assigned to the first category found, the second category will be used etc.

{category_mapping,[index]}

  • index index of the category mapping

For example:

<category>{category_mapping,[0]}</category>
<category>{category_mapping,[1]}</category>
<category>{category_mapping,[2]}</category>
<category>{category_mapping,[3]}</category>
<category>{category_mapping,[4]}</category>

Will retrieve a maximum of 5 category mappings in 5 separate tags.

/!\  from Simple Google Shopping >= 5.0.0 and Data Feed Manager >= 3.0.0

Magic Attributes (for Google Shopping Data Feed)

{G:ID}

Is the shortcut for:

<g:id>{sku}</g:id>

You can retrieve the id instead of the sku by adding an option:

{G:ID,[id]}

/!\ : from Simple Google Shopping >= 9.0.0

{G:TITLE}

Is the shortcut for:

<title>{name}</title>

/!\ : From Simple Google Shopping >= 9.0.0

{G:DESCRIPTION}

Is the shortcut for:

<description>{description}</description>

You can retrieve the short description instead by adding a parameter:

{G:DESCRIPTION,[short]}

/!\ : From Simple Google Shopping >= 9.0.0

{G:LINK}

Is the shortcut for:

<link>{url}</link>

/!\ : from Simple Google Shopping >= 9.0.0

{G:IMAGE_LINK}

Is the shortcut for :
<g:image_link>{image}</g:image_link>
<g:additional_image_link>{image,[1]}</g:additional_image_link>
<g:additional_image_link>{image,[2]}</g:additional_image_link> 
...

{G:AVAILABILITY}

is the shortcut for:

<g:availability>{is_in_stock?[in stock]:[out of stock]:[available for order]}</g:availability>

Options: see {is_in_stock}

/!\ : From Simple Google Shopping >= 9.0.0

{G:PRICE}

Is the shortcut for:

<g:price>{price}</g:price>

/!\ : From Simple Google Shopping >= 9.0.0

{G:SALE_PRICE}

Is the shortcut for :
<g:sale_price>{special_price}</g:sale_price>
<g:sale_price_effective_date>{special_from_date}/{special_to_date}</g:sale_price_effective_date>
Must be used in combinaison with {normal_price} :
<g:price>{normal_price}</g:price>
{G:SALE_PRICE}
Options : see {price}

{G:PRODUCT_TYPE}

Has no equivalent, this attribute creates a list of all the categories where the product may be found:
<g:product_type>category A > sub-category B </g:product_type>
<g:product_type>category A > sub-category B > sub-category C</g:product_type>
This attribute generates a tag for each category in which the product is classified.

Options : see {categories}

{G:GOOGLE_PRODUCT_CATEGORY}

Is the shortcut for :

<g:google_product_category>{category_mapping,[0]}</g:google_product_category>

This magic attribute retrieves the Google category that you assigned (in filter section / category filter) of the first category found to which the product is linked. If no Google category is assigned to the first category found, the second category will be used, if no Google category is assigned to the second, the third will be used etc.

To find the Google categories that match with your categories:
https://www.google.com/support/merchants/bin/answer.py?answer=160081 

 

Options : see {category_mapping}


/!\  from Simple Google Shopping >= 5.0.0 and Data Feed Manager >= 3.0.0

{G:ITEM_GROUP_ID}

Is the shortcut for :

<g:item_group_id>{sku configurable}</g:item_group_id>

{G:PRODUCT_REVIEW}

Is the shortcut for :
<g:product_review_average>{review_average}</g:product_review_average>
<g:product_review_count>{review_count}</g:product_review_count>
Options: see {review_average}

{G:PROMOTION_ID}

Retrieves the product promotion id if exists.

To know more about the use of this attribute, check out our doc on Google Merchant Promotions extension.

Special Attributes (Stock In the Channel users)

The Stocks in The Channel users can use the following attributes in order to build their data feeds :

{SC:URL}

Retrieves the canonical url of the product :

<link>https://www.example.com/product.html</link>

Can be used in Data Feed Manager with {sc:url}

{SC:EAN}

Retrieves an unique ean value of the product:

 <g:ean>1234567891234</g:ean>

 Can be used in Data Feed Manager with {sc:ean}

{SC:IMAGES}

Retrieves the associated image of each product :

<g:image_link>https://www.example.com/media/catalog/image.jpg</g:image_link>

Can be used in Data Feed Manager with : {sc:images}

{SC:DESCRIPTION}

Retrieves the description for the product:

<g:description>...product description ...</g:description>

A default value is retrieved when the description is empty.

Can be used in Data Feed Manager with {sc:description}

Parent Attributes

/!\ From Simple Google Shopping v4.8.1 and Data Feed Manager v2.6.1

Most of the time simple products are related to parent products like configurable, grouped and bundle products. That is why you might need to retrieve Parent attribute values instead of simple product attribute values such as url, image, description...

All the above attributes (Basic, Special and Magic) may be used to retrieve a Parent attribute value instead of a product attribute value.

All options are still available, eg: {description parent,[htmlentities]}

{attribute_code parent}

Retrieves the first parent attribute value.

The parent value is retrieved only if the simple (item) product is associated with a parent product, if not, its own attribute value is retrieved.

The parent product may be a configurable, a grouped or a bundle product. The first parent product that matches the simple product is used to get the attribute value.

Eg:

{G:PRODUCT_TYPE parent}
<g:product_type>{categories parent,[last]}</g:product_type>

{attribute_code configurable}

Retrieves the first configurable parent attribute value.

The configurable product value is retrieved only if the simple product is associated to a configurable product, if not, its own attribute value is retrieved.

Eg:

{G:IMAGE_LINK configurable}
<g:image_link>{image configurable}</g:image_link>

{attribute_code grouped}

Retrieves the first grouped parent attribute value.

The grouped product value is retrieved only if the simple product is associated to a grouped product, if not, its own attribute value is retrieved.

Eg :

{G:GOOGLE_PRODUCT_CATEGORY grouped}
<link>{url grouped}</link>

{attribute_code bundle}

Retrieves the first bundle parent attribute value.

The bundle product value is retrieved only if the simple product is associated to a bundle product, if not, its own attribute value is retrieved.

Eg:

{G:SALE_PRICE bundle}
<g:price>{price bundle}</g:price>

PHP API for Simple Google Shopping

Simple Google Shopping allows to use php scripts in different ways to fully customize and control the data feed output.

  • Inline PHP scripts
    Scripts that are added directly in the data feed template surrounded by PHP  short tags <? ... ?>
  • Custom attributes
    Scripts that can be called by using the custom attribute name just like you do for any attribute in your data feed template
    For Data Feed Manager only
  • Custom functions
    Functions that that can be called by using the function name and additional parameters and that can be applied to any attribute in your data feed template
    For Data Feed Manager only

API coding standards

The Simple Google Shopping PHP API uses the exact same syntax and standards than any PHP coding.

Attribute calls

For performance reasons, Simple Google Shopping only loads in the collection of products the attributes that are explicitly required in the data feed template.
This means that only the attributes that are called using the template placeholders, {attribute_code}, will be added to the collection of products.

As a consequence, when you try to access the value of an attribute from the $product object, you must be sure that the attribute has been added to the collection.
Most of time when the returned value is null for a given attribute, it means the attribute is not loaded in the collection of products.

The best way to be sure that all the attributes you need are well loaded in the collection, is to add at the beginning of your template a simple script that lists all the attributes required.

<? 
/* list of required attributes 
* {attribute_1} {attribute_2} {attribute_3} {attribute_4}...
*/
?>

Then you should be able to get the values of these attributes in your php script :

<? return $product->getAttribute1();?>
<? return $product->getAttribute2();?>
<? return $product->getAttribute3();?>
....

Php functions in attribute calls

You can use any php function to apply in the attribute calls even if it requires one or more additional arguments, for instance:

{name,[str_replace("Apple","Banana",$self)]}

You can use several consecutive options:

{ean,[str_pad($self,10,"0",STR_PAD_LEFT)],[str_replace("X","0",$self)]}

Conditional values

In many cases you may need to output a specific value depending on conditions.

To do so you can use any php conditional statement such as :

  • if/else
    <?
    /* attribute {sku} required */
    
    if ($product->getSku()=="abc"){
       return "Alphabetic";
    }
    elseif($product->getSku()=="123"){
      return "Numeric";
    }
    else{
      return "Mixed";
    }
    ?>
  • switch/case
    <?
    /* attribute {sku} required */
    
    switch($product->getSku()){
       case "abc":
          return "Alphabetic";
       break;
       case "123":
         return "Numeric";
       break;
       default:
          return "Mixed";
    }
    ?>

Opening and closing tags

When using the PHP API inline directly in your data feed template, you must use the opening and closing short PHP tags <? .... ?> as follows:

<? 
   if($product->getData('size')=="X-Large") {
      return "XL";
   }
?>

Outputting value

  • Return
    Any value that you want to output in your data feed, must be returned with the return instruction.
<? return "Don't miss! ".$product->getTitle(); ?>

/* This script adds for each product in data feed  a new ouput line 
*  Don't miss! Iphone 5
*  Don't miss! Galaxy note 7
*  ... 
*/

  • echo, var_dump, print_r
    Any value printed in the data feed through these functions will be rendered at the top of the data feed and will not be added to the final file.
    Such functions must be used for debugging purposes.
<? var_dump($product->getTitle()); ?>

/* This script adds for each product in data feed  a new debugging trace 
*  String(8) "Iphone 5"
*  String(13) "Galaxy note 7"
*  ... 
*/

Variables scope

All variables available in PHP scripts have a local scope, this means they can't be shared between several scripts.

If you whish to share a variable with different scripts all along the data feed generation process, then the variable must be set as a global variable.

<? 
global $increment;
$increment++;
return $increment;

/* This script will output a incremental $variable
* 1
* 2
* 3
* ...
*/
?>

API Objects, Variables and Methods

Object $product

$product is an instance of Mage_Catalog_Model_Product. It contains all methods available by default and some other specific to Simple Google Shopping.
The list below is not exhaustive but lists the most useful methods.

  • $product->getCategoriesArray()
    Retrieves an array of arrays that describes the categories to which belongs the products
  • $product->getCatgoryIds()
    Lists all category ids in which the product may be found
  • $product->getVisibility()
    Returns the visibility of the product (1 = not visible individually, 2 = catalog, 3 = search, 4 = catalog and search)
  • $product->getStatus()
    Returns the status of the product (1 = enabled, 2 = disabled)
  • $product->getData($attributeCode)
    Returns the value of the given attribute code
  • $product->getAttributeText($attributeCode)
    Returns the textual value of the given attribute code

Object $this

$this is an instance of Wyomind_simplegoogleshopping_Model_Feed. It provides a few useful methods.

  • $this->hasParent($product, $type="parent")
    Returns a Boolean value wether a product has a parent from the give type (parent, configurable, grouped, bundle) or not
  • $this->getParent($product, $type="parent", $strict=false)
    Returns a product object of the given parent type (parent, configurable, grouped, bundle) if available or the product object passed as 1st parameter when $strict parameter is set on false.
  • $this->skip()
    Skips the current product, useful to filter out some products based on specific condition

String | Integer | Boolean | Array $self

$self is the value of the attribute for the current product.

This variable is available only in the custom attributes, and in the custom functions.

Array $param

$param is an array of the parameters that have ben passed to the custom function.

{ean,[str_pad],[10],[0]}

The custom function str_pad, should be written as follows

<?
/* var_dump($param) gives
*  Array(3)[
*    0 => String(7) "str_pad",
*    1 => String(2) "10"
*    2 => String(1) "0"
*  ]
*/
 return str_pad($self,$param[1],$param[2],STR_PAD_LEFT); 
?>
This variable is available only for the custom functions.

Tutorial: configuration of a data feed with Simple Google Shopping

Each configuration is different; this is why you need to get informed on the configuration of data feeds. You can have a look at:

Once your products have been uploaded to your Google Merchant account, it is possible to display all the products inserted in Google index:

https://www.google.com/products?authorid=[your Account ID]

To configure your data feed in Simple Google Shopping, go to Catalog > Simple Google Shoping.

You can notice that there is already a template feed named GoogleShopping_datafeedTest.xml. The easiest way to configure your feed according to the rules is to edit the template.  

Once you clicked on Edit, we advice you to duplicate the template (by clicking on Duplicate), in order to always have an original template. You have to know that you can find at any time the original template in our Demo.

Then, define for which view(s) your feed is intended and modify the fields of the Configuration tab if needed.   

Find below an overview of the original data feed. Each modification must be done in the Xml template field. The black box is very useful to check if the syntax is correct, to check the existing attributes and to check data (preview of 10 products).

From that configuration, you can go Back, Delete the feed, Duplicate it, Generate it or Save it.

STEP 1: Configure the template feed

You can start with mapping your categories.

Have a look at that video it will help you to understand how to map categories.


You can then define filters. Indeed, if you want to export only simple products or only one specific category, then it is possible with filters.

You can also choose to export products with prices higher than 0, products which SKU are not null. You can configure your data feed according to your needs.

Then define the days and hours during when you want your data feed to be automatically generated. 

STEP 2: Generate the template feed

By clicking on Generate, we will generate the data feed a first time in order to have a global view of the errors. Once the data feed generated, a notification will appear giving the path to the generated file (You will have to paste that url in the Feed URL field of the Scheduled Upload tab in Google Merchant Center).

STEP 3: Create a Test data feed from Google Merchant Center

Go to your Google Merchant Center account and then in the Data feeds tab.

First of all, we will create a test data feed by clicking on New Test Data Feed.

You need to specify the target country as well as the data feed file name. In our case, our data feed is meant for United States and we will name it Data_test. Click on Save changes.

STEP 4: Upload the Test data feed from Google Merchant Center

Once your feed is created, you need to upload the Template of Simple Google Shopping. You have two possibilities to upload your data feed. You can click on Create Schedule or on Manual Upload.

  • Scheduled Upload

You can click on Create scheduled if you want to create an automatic and scheduled upload. Paste the link of the notification from your Magento admin in the Feed URL field. Select the time zone as well and define the schedule of your data feed upload.

Then click on Schedule and fetch now.

  • Manual Upload

Click on Manual Upload to simply upload your file via the Browse button and then click on Upload and process this file.

Once you've clicked on Schedule and fetch now or Upload and process this file, your data feed is being uploaded (according to the number of products in your feed, it can take up to one hour).

STEP 5: Correct the errors

Errors

Here are the most common errors:

  • Invalid URL

To start, all the errors linked to the URL are due to the fact that you didn't specify the URL of your website in your Google Merchant Center account, so go to Google Merchant Center > Settings > General.

  • Missing shipping information

If you get this error, it is because you didn't configure shipping rule in your Google Merchant Center account or if you did, you didn't do it for the target country. For that, go to Settings > Tax and Delivery. Here you can add a new rule just by clicking on + Delivery Method.

Then, fill in the different fields and click on Save.

  • Insufficient product identifiers: Missing brand attribute.

It seems here that some products don't have a brand. We can especially read that clothing items need a "brand" value. You can check the problem of each one of the sample of 5 products by clicking on Show item.

You have to add an attribute (for example brand_apparel) for clothing (shoes included) categories and define a brand for each one of those products (the brand can be for example the name of your website) from your admin: Magento > Manage products.

In the case where you didn't define a brand for your products, you can define in your data feed configuration that all products will get the brand XXX by writing: <g:brand>XXX</g:brand>

Like below, in the case where your products don't have enough identifiers, you can define that there is no identifier existing by replacing <g:identifier_exists>true</g:identifier_exists> by <g:identifier_exists>false</g:identifier_exists>.

  • Missing required attribute: age group

Here, the error is due to the age group. In the case you don't sell items for children you could edit the template with: <g:age_group>adult</g:age_group> instead of <g:age_group>{age_group}</g:age_group>. This means that the age group is "adult" for all the products.

In the case you sell products for adults and for children, you will need to specify the age group for each one of your products in your Magento admin and keep <g:age_group>{age_group}</g:age_group>.  

  • Missing required attribute: color


Here, a product doesn't have "color" value, so you need to assign a color to that product in your Magento admin.

  • Currency is not supported in the given country in attribute: price

The currency is not supported here, so it means the currency defined in the template in not the same as the currency of your products. In that example, the currency defined in the template is in EUR whereas the products' prices are in USD. In the template, every EUR must be changed into USD.

  • Missing required attribute: size

Apparently, a size attribute is missing here. Indeed, if you check your products, you can find out that they are all shoes and that size attribute is missing. First of all, you need to check in the black box if there is already an existing size attribute for shoes by clicking on Check Attributes.

The size attribute for shoes exists under the name of {shoe_size}. We will add it to our template just as below. The error is now corrected.

Warnings

With Google Merchant Center, you can also have an overview of the warnings. Warnings are not penalizing because your products are inserted to Google Shopping however it is better no to have some.  

  • Missing recommended attribute: image link

You need to understand here that some of the products don't have image link. Click on Show Item to have more information on products. Let's take the example of coal_sm.

If we go to Catalog > Manage Products of our admin and if we have a look at that product, we find out that it is a product linked to a configurable.  

The solution would be to modify the template and to replace {G:IMAGE_LINK} by {G:IMAGE_LINK parent} in order to get the image links of the parent products.

  • Missing recommended attribute: description

Here, it seems a description is missing for the product zol. Go to the product page in your admin and edit the product. 

  • Missing recommended attribute: google product category 

When Google product category is missing, it means that you didn't map your categories with Google ones. For that, go to Catalog > Simple Google Shopping in the Categories tab of your data feed.

 

Generate your feed from your Magento Admin, and repeat STEP 4 and STEP 5 until no errors appear.

STEP 6: Generate the corrected data feed

Once your data feed is perfectly configured, without any error or warning, generate it one last time from Magento > Simple Google Shopping, by clicking on Generated.

STEP 7: Create a new feed

Go to Google Merchant Center > Data feeds and click on New data feed.

There, you will be able to upload your data feed exactly as you did for the test feed (STEP 4).

Once your feed uploaded, your products will be visible on Google Shopping within 48 hours, while Google validates them.