Creation and optimization of Google Shopping feed for your online store on WooCommerce 

Lukáš Horák
28. 6. 2023
13 minutes read

In the ImperialMedia advertising and digital agency, we have been creating online stores and follow-up marketing for several years. One of the effective ways of promotion is advertising products on Google Shopping. However, in order to advertise products on this channel, we need to create a properly structured XML feed with as much detailed product information as possible.

In the ImperialMedia advertising and digital agency, we have been creating online stores and follow-up marketing for several years. One of the effective ways of promotion is advertising products on Google Shopping. However, in order to advertise products on this channel, we need to create a properly structured XML feed with as much detailed product information as possible.

Content:

  1. How to fill products correctly
  2. Generating XML feed in WooCommerce
    1. Available plugins
  3. Creating export in MERGADO 
  4. Feed editing
    1. Catalogue number in product name 
    2. Products on demand
    3. Brand 
    4. Setting G:IDENTIFIER_EXISTS 
    5. Google categories 
    6. Invalid weight 
    7. Removing G:TAX 
    8. Zkrácený popis namísto hlavního 
    9. Skrytí produktů k pronájmu 
    10. Feedu regeneration
  5. Conclusion

Creating a quality feed starts with filling products on the web. The more systematically you populate product information, the better quality XML feed you can generate. It is therefore desirable to add as many relevant properties to the products as possible, to enter catalogue numbers correctly, etc.

In this article, we will discuss a “real-life case”, namely a WooCommerce online store with spare parts for cars, where the client decided to populate about 4,000 products on his own as a cost-saving measure.

How to fill products correctly

In order to not only generate quality XML feeds, but to generally present the products you offer in the best possible light, you need to list them correctly in the online store. What exactly does this mean?

  • The title is the key:
    • It should describe the product as concisely and succinctly as possible, and at the same time identify the product itself. 
    • It should not contain a catalogue number or the manufacturer. 
    • It must not be dependent on the context, i.e. it must identify the product equally well in the online store and (not only) in Google Shopping among thousands of similar items (e.g. on the e‑shop with essential oils the product name “Vanilla” is relatively concise, but in Google Shopping it is not only too generic, but in this case very misleading). 
  • Always enter a description:
    • Provide detailed information about the product in the description. 
    • The description must always contain text (e.g. it must not be made only of images). 
    • If you insert images, videos, etc., which contain important information, always include this information in the text. 
  • Use high-quality photos
  • If possible, always enter the catalogue number (SKU) or EAN for products
  • Set relevant properties for products:
    • Always try to set properties that are relevant to the product. 
    • Especially for textiles, always set the colour, size and material. 
    • Also, use the properties to indicate the brand or manufacturer.

If you follow the above points, you will give yourself a significant competitive advantage not only in advertising and comparison sites, but also in the online store itself, where you will present your products in a clear way.

Advertise profitably on Google Shopping with MERGADO. You can find all the important information and tutorials on how to effectively set up advertising on this channel on the How to Google Shopping page.

Generating XML feed in WooCommerce

There are myriad ways to generate XML feeds in WooCommerce. However, in principle, as a technical implementer of an online store, you are faced with 2 options:

  1. program your own generator 
  2. or use a plugin

On platforms like WooCommerce, the first option only makes sense in very specific cases, which Google Shopping feed is definitely not one of them.

Logically, you will go the route of using a plugin that will do all the work (or at least the vast majority of it) for you. A suitable plugin should be well-configurable. It should support formats for most platforms used in the country where the client wants to advertise products. And most importantly, it should be able to generate multiple different feeds at once. Because you never know when the client will want to expand to other platforms.

Available plugins

  • Product Feed PRO for WooCommerce:
    • The basic version is free (for normal use it’s absolutely enough).
    • The plugin supports a huge number of output formats.
    • You can have an unlimited number of feeds generated in parallel.
    • The initial configuration of each feed must be done by someone who knows and understands the specification of the format.
    • Excellent support for Google Shopping feed. For other formats, however, it doesn’t offer all the possibilities (especially the lack of category mapping).
  • Toret XML Feeds for Comparators:
    • Paid plugin.
    • Generates high-quality output data.
    • Suitable even for less technically savvy users.
    • You can configure products in bulk and independently.
    • Supports the most used formats in the Czech Republic, but not all necessary ones (e.g. Favi is missing).
  • Mergado Pack + Mergado:
    • MERGADO Pack allows you to generate an XML feed, which you further process in MERGADO
    • The MERGADO Pack plugin itself is free, you have to subscribe to the MERGADO platform.
    • Administration of feeds is separate from the administration of e‑shops.
    • Support for a huge number of formats for Czech and foreign platforms.
    • Wide possibilities of configuration and “postprocessing” of individual feeds.

In the case of this client, the choice fell clearly on MERGADO, thanks to which we could modify the output feed almost beyond recognition.

Objevte Mergado Pack pro WooCommerce

snadno exportujete produktové feedy a převedete je do stovek formátů

propojte svůj WooCommerce e‑shop se světem elektronického obchodu z jednoho místa

bezplatný nástroj pro implementaci reklamních služeb a pluginů

Installation of MERGADO Pack and generation of product feed

MERGADO Pack is installed by default from the WordPress repository. In the site administration, go to Plugins — Plugin Installation, search for “MERGADO Pack” and click on “Install” and then “Activate”.

Once we have activated the plugin, we can immediately have the product feed generated. In the online store administration we go to MERGADO Pack — Product feed and click on the “Create XML feed” button. Now we wait until the feed is completely generated. Depending on the number of products in the online store, this operation can take a few seconds or even tens of minutes.

Cron settings

Once the feed is generated, click on the “Continue to cron setup” button. Here we have to decide whether to leave the automatic feed regeneration to the WordPress cron or use a custom cron. If you don’t want to deal with additional configuration, leave the “Activate WP cron” box checked.

In ImperialMedia, we have the cron set up in a slightly different way than normal. The standard WordPress cron is more of a “pseudo-cron” that only activates when a visitor (or robot) opens a web page. At that point, any scheduled actions that are about to or have been triggered in the past will be triggered. What is the consequence? If we use the WordPress cron to run more computationally intensive operations (which can include feed generation), one of the site visitors will see a white page in front of them for some time. This is until all scheduled operations are completed.

Z toho důvodu jsme na našich serverech spouštění úloh WordPress cronem v rámci HTTP požadavků zakázali a necháváme cron spouštět každou minutu přímo serverem. Díky tomu nedochází k ovlivňování rychlosti zpracování požadavků a cron se spouští pravidelně nezávisle na návštěvnosti webu.

For this reason, we have disabled the running of WordPress cron jobs on our servers as part of HTTP requests and have the cron run every minute directly by the server. This way, the speed of request processing is not affected and the cron is run regularly regardless of the site traffic.

To disable cron execution within HTTP requests, simply add a constant to wp-config.php:

define( ‘DISABLE_WP_CRON’, true );

In this case, however, you will see the message “Your WP cron (wp-cron.php) is disabled” in the cron settings for the product feed.

Mergado Pack cannot detect if WordPress cron is disabled completely or if it is running externally. You need to tell it. Using the tab with the gear icon, go to Settings, click “Advanced Settings” and check the “Unlock WP cron form” box.

Then go back to the Feed List tab, expand the product feed and click on the “Cron Settings” button. Here we will make sure that we have checked “Activate WP cron” and that the interval is set to the appropriate value. If you are running the WordPress cron externally like we are, I strongly recommend setting the schedule to the lowest possible value so that changes to products are written to the feed as quickly as possible.

At this point, I can’t help but mention that 15 minutes still seems like a rather large interval to me, and I personally wouldn’t be angry at all if it could be set to 5 minutes or less. Maybe the MERGADO Pack developers will be able to work this adjustment in.

Creating export in MERGADO

We have generated the product feed. It’s high time to create an export from it in MERGADO. So we go to MERGADO, click on “New export”, insert the URL of the product feed from the online store, select the online store, set the input feed format to “Mergado XML [en]” and the output feed format to “Google Shopping [en]”. Now we wait for MERGADO to generate the “first version” of the feed.

Even without any modifications, the first generated feed is usually quite good, but in the case of our client, it was far from perfect. Let’s take a look at a sample product that made it into the feed:

Feed editing

Let’s now identify the bugs and issues that the feed contains and try to fix them using MERGADO.

Run a free Feed Audit
  • improve the condition of your feed and get recommendations for its adjustment
  • fast and free technical analysis

Catalogue number in product name

The client entered the catalogue number in the product name instead of filling it in the dedicated “SKU” field in the e‑shop. However, since in this case the catalogue number is relatively easy to identify (it consists only of numbers and capital letters and is always found as the “last word” in the name), there is nothing stopping us from letting MERGADO extract it into the G: MPN element where it belongs according to the specification.

We will create a selection of products without an explicit catalogue number (in the future, the client will probably write catalogue numbers in the correct field, so we don’t want to affect such products):

  1. Go to “Products”.
  2. Search according to the condition: [PRODUCTNO] = “”
  3. Click on “Search”.
  4. Save the selection with the name “Products without catalogue number”.

Then we create a rule that extracts the catalogue number from the name.

  1. Go to “Rules” and click on “New Rule”:
  2. Set rule:
    1. Name = Copy catalogue number from name to MPN
    2. Rule Type = Bulk overwrite by value
    3. Selections = Products without catalogue number
    4. Check “Regular Expression”
  3. Set “Element to search” to “NAME_EXACT”.
  4. Set “Element to write to” to “G:MPN”.
  5. Fill one row of the table: ^(.*)\s([A‑Z0‑9]+)$ → \2.
  6. Click “Create”.

By doing this, we basically told MERGADO: “For all products where the catalogue number was not filled in, try to split the product name into 2 parts so that the second part contains only uppercase letters and numbers (i.e. [A‑Z0‑9]+) and copy this second part (\2) into the G:MPN element.”

Using the same principle, we create a second rule that then deletes the catalogue number from the product name. Note that the catalogue number can be separated from the rest of the name by a backslash. In this case, we want to remove this slash from the name as well.

  1. Go to “Rules” and click on “New Rule”. 
  2. Set the rule:
    1. Name = Removing catalogue number from the name
    2. Rule type = Bulk overwrite by value
    3. Queries = Products without catalogue number
    4. Check “Regular expression
  3. Set “Element you are searching in” to “NAME_EXACT”.
  4. Set “Element you are writing to” to “TITLE”.
  5. Fill 2 rows of the table:
    1. ^(.*)\s[|]?\s([A‑Z0‑9]+)$ → \1
    2. ^(.*)\s([A‑Z0‑9]+)$ → \1
  6. Click “Create”.

Create a clear environment in MERGADO with the right handling of rules. Using the tips from the article 3 tips to make your life (and managing your product campaigns) easier will save you time and trouble.

Products on demand

For most products, the client has set the online store to be made on demand. From the point of view of the online store itself, this is fine (it can take up to 7 days for the client to process the order), but from the Google Shopping point of view, it is not. Google doesn’t allow you to advertise products on demand, and if we hadn’t intervened in the feed, the vast majority of products would be unsalable.

How do we resolve this situation without putting misleading information in the feed? Google allows us to fill in the elements G:MIN_HANDLING_TIME and G:MAX_HANDLING_TIME, within which we specify the minimum and maximum number of days, respectively, during which the online store can process the order. If we fill in these elements, nothing prevents us from setting that the products are in stock.

  1. Selection of products in stock:
    1. We go to “Products”.
    2. We search for products according to the condition: [AVAILABILITY] = “in stock”
    3. We save the selection as “Products in stock”.
  2. Selection of products for order:
    1. Go to “Products”.
    2. Search for products by condition: [AVAILABILITY] = “preorder”
    3. Save selection as “Products on demand”.
  3. Set products on order as in stock:
    1. Go to “Rules” and click “New Rule”.
    2. Name the rule “Availability of products on order”.
    3. Set the rule type to “Rewrite”.
    4. Set the selection to “Products on demand”.
    5. Set the element to “G:AVAILABILITY”.
    6. Set the new content to “in stock”.
  4. Fill G:MIN_HANDLING_TIME:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Minimum Processing Time”.
    3. Set the rule type to “Bulk rewriting by query”.
    4. Set the element to “G:MIN_HANDLING_TIME”.
    5. Populate the table: 
      1. Select “Products in stock” → 0
      2. Select “Products on order” → 2
  5. Fill G:MAX_HANDLING_TIME:
    1. Go to “Rules” and click “New Rule”.
    2. Name the rule “Maximum Processing Time”.
    3. Set the rule type to “Bulk rewriting by query”.
    4. Set the element to “G:MAX_HANDLING_TIME”.
    5. Fill the table: 
      1. Selection “Products in stock” → 2
      2. Selection “Products on order” → 7

Translated into “human language”, we tell MERGADO: “Find all products that are in stock and set G:MIN_HANDLING_TIME to 0 and G:MAX_HANDLING_TIME to 2. Then find all the products on order, set them as in stock and set G:MIN_HANDLING_TIME to 2 and G:MAX_HANDLING_TIME to 7.”

With this setup, we can advertise the client’s products without deceiving the end customer.

Brand

The product brand should be listed whenever possible. Google has reserved a G:BRAND element for it within the feed. WooCommerce does not have any special field for the brand. So it is a good rule of thumb to insert it as a product property.

In this case, unfortunately, the client only inserted the brand as a property for a few products. Mostly, however, he has embedded it in the product name, where we can extract it from.

So if the tag is available within the properties, we will use the value of the relevant property and hide the property itself. For other products, we will try to extract the brand from the name.

  1. Copying a brand from a property:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Mark from Property”.
    3. Set the rule type to “Rewrite”.
    4. Set the selection to “All Products” (we don’t mind overwriting all products at the moment, the G:BRAND element is not populated anywhere at this stage).
    5. Set the element to G:BRAND.
    6. Set the new content to “%PARAM_​Mark%”.
  2. Create a selection of products to extract the mark from the name:
    1. Go to “Products”.
    2. Search for products according to the condition: [PARAM|Brand] = “”
    3. Save the selection as “Products without brand”.
  3. Create a rule to extract the brand from the name:
    1. Go to “Rules” and click on “New Rule”. 
    2. Name the rule “Brand from name”. 
    3. Set the rule type to “Bulk rewriting by value”. 
    4. Set the selection to “Products without mark”. 
    5. Set “Element you are looking for” to “NAME_EXACT”. 
    6. Set “Element you are writing to” to “G:BRAND”.  
    7. Now we need to enter as many words as possible into the table representing the brands found in the product names; so let’s fill the table as follows: 
      1. Škoda → Škoda
      2. Skoda → Škoda
      3. Volkswagen → Volkswagen
      4. VW → Volkswagen
      5. Seat → Seat
      6. Audi → Audi
      7. Toyota → Toyota
      8. BMW → BMW
      9. Citroen → Citroen
      10. Mercedes → Mercedes-Benz
  4. Hide the original “Brand” property:
    1. Go to “Elements”.
    2. Search for “G:ATTRIBUTE_VALUE|Brand”.
    3. In the corresponding row, click on the eye icon (“Hide element”).

G:IDENTIFIER_EXISTS settings

Google requires us to fill in either the EAN or the brand in combination with the catalog number for each product. If neither of these requirements can be met, we specify the “G:IDENTIFIER_EXISTS” element with a value of “no” or “false”. This tells Google that there is no unique identifier for the product on the market.

Warning! If Google evaluates that you have specified G:IDENTIFIER_EXISTS = no / false for a product and the product does have an identifier, the product will either be disadvantaged or rejected completely. It is therefore very important to fill in EAN or brand and catalogue number wherever possible.

You should do this step for every Google feed you manage in MERGADO.

  1. Create a selection:
    1. Go to “Products”.
    2. Switch the search to “on output”.
    3. Search for products according to the condition: ([G:BRAND] = “” AND ([G:GTIN] = “” OR [G:MPN] = “”))
    4. Save the selection as “Products without identifier”.
  2. Fill in the G:IDENTIFIER_EXISTS element:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Identify products without identifier”.
    3. Set the rule type to “Rewrite”.
    4. Set the selection to “Products without identifier”.
    5. Set the element to G:IDENTIFIER_EXISTS.
    6. Set the new content to “no”.

Google categories

Each advertised product should be listed in one of the categories defined by Google. Fortunately, this is one of the easiest things to do in MERGADO.

  1. Go to “Rules” and click on “New Rule”.
  2. Name the rule “Google Categories”.
  3. Set the rule type to “Bulk Rename Categories”.
  4. Set the selection to “All Products”.
  5. Click on the “magic button” “Suggest Categories”.
  6. Check or modify the suggested categories appropriately.

This feature was one of the reasons we started using MERGADO. It is an incredible time and labor saver on larger e‑commerce sites. And even though we’ve created a lot of rules of different types since then, this is simply our favorite.

Invalid weight

For some products, the client managed to set an invalid weight. Specifically on our sample product, the weight is set to “kg”, which is obviously nonsense. For such products, it is better to hide the weight element completely.

  1. Creating a selection:
    1. Go to “Products”.
    2. Search for products according to the condition: ([SHIPPING_WEIGHT] = “kg” OR [SHIPPING_WEIGHT] = “”)
    3. Save the selection as “Products without weight”.
  2. Hide the element:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Remove Weight”.
    3. Set the rule type to “Rewrite”.
    4. Set the selection to “Products without weight”.
    5. Set the element to “G:SHIPPING_WEIGHT”.
    6. Leave the “New Content” field blank.

MERGADO automatically hides empty elements. Thanks to this property and the above rule, the G:SHIPPING_WEIGHT element is completely hidden for the corresponding products.

Removing G:TAX

Although the Google Shopping feed specification says that we can only use the G:TAX element indicating the product’s tax rate in the US, MERGADO will always add it within the format converter application. Fortunately, hiding it is a matter of a few clicks.

Since we want to hide this element unconditionally for all products, just go to the “Elements” section, search for “G:TAX” and click on the eye icon (“Hide element”) next to the corresponding lines.

Short description instead of the main description

In WooCommerce, you can set not only the main description for each product, but also a “short description”, which usually appears next to the product photo. However, for a few products, the client has set this short description instead of the main description.

In order not to put such products at an unnecessary disadvantage, or even to reject them, we will set at least this short description in the G:DESCRIPTION element for products with missing description.

  1. Creating a selection:
    1. Go to “Products”.
    2. Search for products according to the condition: [DESCRIPTION] = “”
    3. Save the selection as “Products without description”.
  2. Create a rule:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Replace empty description with a short one”.
    3. Set the rule type to “Rewrite”.
    4. Set the selection to “Products without description”.
    5. Set the element to “G:DESCRIPTION”.
    6. Set the new content to “%DESCRIPTION_SHORT%”.
       

Hiding products for rent

The final task was to hide products that are not intended to be advertised on Google Shopping. In addition to spare parts, the client also offers cars for short-term rentals, which for technical reasons are registered as special types of WooCommerce products.

In our particular case, we can’t distinguish the products based on any flag or category. Therefore, we have to make a selection based on the ID.

  1. Creating a selection:
    1. Go to “Products”.
    2. Search for products by condition (the “IN” operator translates to “is in the list”): [ITEM_ID] IN (“1061”; “1060”; “1059”)
    3. We save the selection as “Products for rent”.
  2. Creating a rule:
    1. Go to “Rules” and click on “New Rule”.
    2. Name the rule “Hide Products for Rent”.
    3. Set the rule type to “Hide Product”.
    4. Set the selection to “Products for Rent”.

Regenerate feedre-generate the output feed

After making all the adjustments, I recommend to re-generate the output feed. Go to Settings — Regeneration and click on “Regenerate All”. Although MERGADO still offers a “Regenerate Changed” option, I prefer to completely re-generate the feed at least the first time when making such extensive edits.

After the re-generation, we check the sample product, which now looks like this in the output feed:

Compared to the original form, the product differs in several ways:

  • The catalogue number has been moved from the title to the G:MPN element.
  • The brand has been moved from the property to the G:BRAND element.
  • The availability has been set to “in stock”.
  • The elements “G:MIN_HANDLING_TIME” AND “G:MAX_HANDLING_TIME” have been added.
  • The element G:SHIPPING_WEIGHT with an invalid value has been hidden.
  • The element G:TAX, which is not needed in the Czech Republic, has been hidden.
Mergado with a 30-day free trial
  • optimize your feed by yourself and save the cost for the developer’s time
  • full access to all features already in the trial version

Conclusion

In this article, I wanted to demonstrate one of the ways you can use MERGADO and how we use it most often — to fix problems and errors caused mainly by incorrect work with the online store and partial or complete misunderstanding of its controls.

I am also fully aware that a large part of the mentioned problems should have been solved already on the e‑shop side, not on the MERGADO side, but the situation at that time did not allow us to take this route. Thanks to Mergado, we were able to run quality advertising even though the data for the products was relatively substandard.

Author

Pavel Vybíral: I work primarily as a web developer with a slight focus on marketing at ImperialMedia, an advertising and digital agency.

Read more:

Lukáš Horák

Lukáš takes care of most of the Czech and English communication in Mergado. Through blogs, e‑mail, and social networks, he regularly supplies readers with e‑commerce news and news and tips from Mergado. In his time off, he enjoys simple things like badminton, digging the hidden gems of the 80’s, and seafood served with red wine.