↑↓ selectEnter openEsc close

    1. Elbuz
    2. Feeds and marketplaces

    How to build a Google Merchant feed for Google Shopping

    23 min readUpdated

    Elbuz builds a Google Merchant Center feed from your catalog — an XML file with Google’s tags — and updates it at a permanent URL. You map your fields to Google tags once.

    When you need this:

    • Products should appear in Google Shopping — Merchant Center fetches the file on its own schedule.
    • Google rejects availability — your statuses become in_stock, out_of_stock, preorder automatically.
    • You need a Facebook, Instagram or TikTok catalog — a separate format on the same engine.
    • Your catalog suddenly “shrank” — a stop rule keeps that feed away from Google.

    Where to start: create a “Google Merchant (XML)” template in the “Data export” window.

    What the Google Merchant feed can do

    How to create a template

    In the “Data export” window, click the add button and choose the “Google Merchant (XML)” format. To edit a template, click the pencil in its row in the list.

    Google Merchant (XML) template: data selection tab with the photo, attributes and options switches and the product XML template
    1Photo, Attributes, Options switches
    2XML template block
    1. The Photo, Attributes and Options switches decide which data goes into the feed, regardless of whether a macro is present in the template.
    2. The XML template holds one product body: marketplace tags (g:title, g:price) filled with macros of the catalog fields.

    The template has two tabs: “Select data to export” — the file contents, and “Export limit (filter)” — conditions that narrow down the products (where the filtered set is defined). Blocks on the first tab:

    BlockWhat it contains
    “What to export”the “Photo”, “Attributes”, “Options” toggles
    “XML template”the whole file: the feed header and the body of one product with macros of your fields
    “Photos and file”the beginning of photo links and the file name
    “Export limits”store, warehouse and catalog language, the “In stock at this store only” checkbox, “Pre-order lead time, days” (availability date)

    Elbuz fills in the site address in g:link and the feed header: from the main store’s address in the store list, else from the “Website URL” field of your company, else from your only CMS tunnel. If none is found, the template has https://site.com and the form warns about the placeholder: replace it in the “XML template” and save.

    The default file name is export_google_feed.xml. Merchant Center fetches the feed from a permanent URL, so do not put the date macros {DATE}, {DATETIME}, {TIME} in the name.

    What goes into the feed: Google tags

    The “XML template” field contains the whole document: the declaration, the feed header with the store name and address, and one product inside the item tag. Elbuz repeats the product node itself; which tag to repeat is set in the advanced settings (for Google it is item).

    You don’t type field macros by hand: Ctrl+Space or the { character opens the list of catalog fields. The minimum set of tags without which Merchant Center will not accept the feed:

    TagWhat goes in
    g:idinternal SKU — must be unique and must not change between exports
    g:titleproduct name
    g:descriptiondescription; usually wrapped in CDATA so that tags inside don’t break the XML
    g:linklink to the product page on your website: the site address plus the product URL macro
    g:image_linkmain photo; the photo list macro puts the first photo here and the rest into g:additional_image_link
    g:availabilityavailability, in Google’s values
    g:availability_dateavailability date — only for products in preorder or backorder, macro {xml_availability_date} (where the date comes from)
    g:priceprice with the currency code
    g:brandmanufacturer
    g:conditionproduct condition — macro {xml_condition}: “New” → new, “Discounted” and “Used” → used, “Refurbished” → refurbished (product condition)

    In templates where g:condition had a hard-coded new, Elbuz replaced it with {xml_condition} itself; new templates are created with the macro already in place. So a discounted product no longer goes to Google as new: the condition is set in the product card, in the “Product condition” field.

    Three macros build whole blocks:

    • Photo list. The first photo becomes g:image_link, the rest g:additional_image_link. Merchant accepts one main and ten additional photos, so nothing from the eleventh photo on gets into the file.
    • Attribute list. Each “name — value” pair becomes a g:product_detail block with nested g:attribute_name and g:attribute_value.
    • Description. Markup Google doesn’t accept is stripped, and the text is cut to five thousand characters. For Facebook all markup is stripped: plain text is required there.

    Tags that affect how products are shown and counted:

    • g:sale_price — sale price. Google shows the struck-through regular price next to the sale price.
    • g:gtin and g:mpn — barcode and manufacturer part number. Google asks for at least one of the two; without them some categories perform worse.
    • g:product_type — your category as a full path.
    • g:google_product_category — a category from Google’s taxonomy; it comes from marketplace category matching.

    In the category path (g:product_type), levels are joined with “>”, not with a slash as in the database. Google requires this: Google Ads campaigns group products by this field, and a different separator breaks the groups apart.

    You can put calculations in tags: for example, use the recommended price when there is one and the regular price when there isn’t. The syntax is in price in exports.

    How to send availability in Google’s values

    Google has its own availability values, and Elbuz substitutes them for your status:

    Your statusWhat goes into the feed
    marked as “in stock”in_stock
    marked as “out of stock”out_of_stock
    “Pre-order” or any otherpreorder

    For TikTok the same values are written capitalized and with a space — “In stock”. Elbuz does this; you don’t need to change anything in the template.

    The mapping is set in the “Stock-based update setup” window — a button in the “Related settings” block on the first tab. It has a row for each status from your stock status list. A new template gets all rows enabled and without custom text.

    • Row disabled — the value is taken from the product’s active state: active — in_stock, inactive — out_of_stock. So a “Pre-order” product may go out as in_stock.
    • “Title on site (in file)” filled in the row — this exact text goes into the feed instead of Google’s value.

    Availability date for pre-orders. For a product in preorder status (or backorder, if you entered that text in the stock status), Google Merchant requires the g:availability_date tag, otherwise it rejects the product. Elbuz sets it itself:

    • it takes “Date Available” from the product card if it is in the future and no more than a year away;
    • otherwise — today plus “Pre-order lead time, days” from the template’s “Export limits” block (1 to 365, 14 by default).

    In templates without this tag, Elbuz adds it right after g:availability. In-stock and out-of-stock products don’t need it and don’t get it. If you put the tag in the “XML template” yourself, the {xml_availability_date} macro fills the date: for products not on pre-order it is empty, and so is the tag. The TikTok feed has no availability date.

    Google accepts only the three values from its list. It rejects any other text in “Title on site (in file)” — clear this field for the Google feed.

    The first fork is whether the status row is enabled in the template settings: if not, the product’s active state decides, not its status. Custom text in the row overrides Google’s values
    NoYesYesNoin stockout of stockPre-order or otherno markProduct with its stock statusIs this status row enabledin the template's availabilitysettings?By the product's active state:active — in_stock, inactive —out_of_stockIs “Title on site (in file)”filled in the row?This text goes into the feed as isHow is the status markedin the stock status list?in_stockout_of_stockpreorderFor TikTok the value is written inwords,capitalized: In stock
    • Action or result
    • Decision: the path depends on the answer

    Photos, attributes and options: what the toggles decide

    What data goes out is decided by the “Photo” and “Attributes” toggles. Unlike YML, the toggle wins here, not the macro: with “Photo” off, the photo block is empty even if the macro is in the template.

    The “Options” toggle has no effect in Google, Meta and TikTok feeds: option products go into the file as separate items next to the main product. Main products only — that is a filter condition on the “Export limit (filter)” tab (scenario). The “Option products” line in the pre-run summary shows how many options are in the filtered set.

    The “Product image link” field sets the start of the address to which the photo file name is appended. Without it the feed gets relative addresses, and Google accepts only full ones.

    Merchant Center rejects products without photos or prices one by one, and with many rejections may suspend the whole feed. Filter them out with a condition. The pre-run summary shows how many such products there are, and for Google also the “No barcode” chip — products with empty , , UPC and manufacturer part number.

    How to keep g:id stable between runs

    Each run builds the file from scratch with the full set of products. The Google form has no “Only export new data” checkbox, and the engine ignores it even if it remains from old settings.

    Exporting doesn’t change your catalog, with one exception. With “Unique internal SKU” on, before each export that passes the stop rules, empty SKUs get random values and duplicates get a suffix. The SKU is usually the g:id, and Google identifies products by it: a changed g:id means a new product. Fill in SKUs before your first feed.

    You can fix your own value in the “XML template” field: as text instead of a macro (for example, new in g:condition if all products are new) or as a formula. To remove a product from the feed, clear “Export to file (to website)” in its card or exclude it with a filter condition.

    The exchange is one-way: Elbuz doesn’t pull back moderation statuses or edits made in Merchant Center.

    Facebook, Instagram and TikTok

    These platforms read the same format, so in Elbuz they are separate formats on the same engine: “Facebook / Instagram (Meta)” and “Tiktok”. You create them the same way, with the add button. Each has its own product body template and set of tags, but the logic is the same: platform tags plus your macros.

    Schedule and file link

    The pre-run summary, stop rules, manual and scheduled runs, and the log work the same for all formats: summary, stop rules, running, where the file goes, run log. For a Google feed, this is what matters.

    • The file URL is permanent — the template folder plus the file name. The ?uuid= tail in the card link is a cache-busting marker; in Merchant Center enter the URL up to the question mark.
    • An empty feed is not published. If no product matches the conditions, the log ends with “Data export NOT completed: the file was not generated”, and the previous file stays at the URL.

    What is at the URL when a run doesn’t finish

    The new file goes to the cloud as the last step, and only then is everything else removed from the folder. After a stop, a break-off, a formula error or a failed upload, the link and date in the card stay the same, and Google reads the previous file. Retrying is safe: a run starts with a clean file.

    The side branches end without a new file — the previous one stays at the URL. The file in the cloud changes only on the bottom, straight path
    YesNoNoYesNoYesYesNoNoYesStart: “Export”, scheduleor “Export all templates”Did a stop rule in“Stop the export” mode trigger?“Export stopped by a stop rule”.The previous file stays in the cloudThe old file in the temp folder isdeleted,the new one starts with the feedheaderWas the product selection built?A template formula error breaks it“Data export NOT completed:the file was not generated”. Link anddate unchangedDid at least one productmatch the conditions?Products are written in batches of500Was “Stop” clicked?“Export stopped by the user!”.Link and date unchangedClosing tags. The file goes to FTPif FTP is set upDid the new file landin cloud storage?“The file was not uploaded to cloudstorage.The previous file and its link are leftunchanged”Everything except the new file isremovedfrom the template folder in the cloudThe card's link, size and date areupdated.“Data export completed”
    • Action or result
    • Decision: the path depends on the answer

    Disabling and deleting a template

    The “Active” toggle in the card header takes effect immediately, without saving the form. A disabled template is skipped by the schedule (silently, with no log line) and by “Export all templates”, but you can still run it manually.

    Two ways a scheduled task ends without a run: busy with another export — with a log line; template disabled — silently
    YesNoNoYesA scheduled task is dueIs another scheduled exportstill running?Task canceled. The log shows“Scheduled export canceled…”Is the template “Active”?The template is skipped silently.The file in the cloud stays from thelast runRegular template runwith stop rules
    • Action or result
    • Decision: the path depends on the answer

    The file from the last run stays in the cloud, and Merchant Center keeps reading it — with the same prices and stock. Deleting erases the template settings (XML, FTP, schedule, filter, availability), but not the file. To make products disappear from Google, disconnect the data source in Merchant Center.

    If a wrong feed has already gone out

    You don’t need to roll back the catalog — exporting doesn’t change it (except SKUs in “Unique internal SKU” mode). There is no previous file: only the new one remains in the template folder.

    1. Fix prices, categories, stock statuses or the XML template.
    2. Click “Check” in the card header: a test run on one product shows the finished XML, unrecognized macros, and formula and markup errors. It doesn’t touch the file in the cloud, the link or FTP.
    3. Run a regular export. The URL stays the same, and Merchant Center fetches the new file on its schedule.

    To keep the error from repeating automatically, switch the relevant stop rule to “Stop the export” (scenario).

    When a product disappears from the feed

    A product disappears once it fails a filter condition: export flag, category, filter, store or warehouse — full list in why a product didn’t make it into the file. The feed has no “removed” marker, and no out_of_stock is written instead. For Google to show “out of stock”, the product must stay in the feed with an out-of-stock status (scenario).

    Scenarios

    Keep a stock collapse out of Google

    Task: if stock or half of the products suddenly “disappear” from the base catalog, that feed must not reach Merchant Center.

    What to do: select the template row in the template list, choose “Export stop rules” in the “Additional operations” menu, and set the rule you need to “Stop the export” mode. The same window opens from the “Configure thresholds” link in the pre-run summary. Default thresholds are 30 % for stock and 50 % for the total number of products.

    Result: both manual and scheduled runs stop before the file is created, the log shows “Export stopped by a stop rule”, and the previous file stays in the cloud. Such a run doesn’t touch SKUs. On a template’s very first run the collapse rules stay silent — there is nothing to compare with yet.

    Export stop rules window for the selected Google Merchant template
    1Template the thresholds apply to
    2Mode column
    3Threshold column
    1. The rules are set for the selected template, whose name is shown here.
    2. In the Mode column a rule is switched between Off, Warn and Stop the export; the last one halts the run.
    3. The Threshold column sets the limit of change versus the previous run at which the rule triggers.

    Pause feed updates

    Task: during a stock count or repricing, the feed must not update on schedule.

    What to do: in the template card header, switch “Active” to “Disabled”.

    Result: the schedule and “Export all templates” skip the template; the “Export” button still works. Products won’t disappear from Google: Merchant Center reads the file from the last run with those prices and stock (disabling and deleting).

    Main products only in the feed, no variants

    Task: Google should see one item per product, not the main product plus each of its options separately.

    What to do: on the “Export limit (filter)” tab, add a condition that filters out option products.

    Result: only products that meet the condition go into the file. Turning off the “Options” toggle is not enough — it has no effect in Google, Meta and TikTok feeds.

    A product is sold out but must stay in Google as “out of stock”

    Task: an item is temporarily unavailable, and Google should show it as unavailable rather than drop it.

    What to do: keep the product in the template’s filtered set and give it a stock status marked as “out of stock” in the list.

    Result: the product goes into the feed as out_of_stock. A new template is created with a filter condition for active products only, so an inactive product won’t get into the feed until you change that condition.

    You changed the XML template and want to see the result before a live run

    Task: after editing tags or formulas, make sure the feed builds without errors, without touching the file Google already reads.

    What to do: click “Check” in the template card header; if needed, enter the of a specific product.

    Result: the test run builds the XML with the same engine and shows unrecognized macros and errors. The file in the cloud, the link, FTP and the stop rule figures stay as they were.

    What to do when Google rejects the feed

    Empty filtered set, selected store, schedule conflict and FTP — see the general troubleshooting table.

    Troubleshooting common Google feed problems
    What you seeWhyWhat to do
    Merchant Center doesn’t accept the availability value In the template’s availability settings, “Title on site (in file)” is filled for the status, and that text went out instead of Google’s value Clear the field in the template’s availability settings (details)
    Google complains about links The feed has relative addresses or the https://site.com placeholder instead of your site Fill in “Product image link” and check the full site address in the g:link tag; replace https://site.com with your address (where it comes from)
    No photos in the feed The “Photo” toggle is off Turn it on — the macro in the template doesn’t work on its own
    Google Ads campaigns fell apart into different groups The category path in g:product_type changed Don’t rename categories unless necessary: the groups rely on this path
    Some products are rejected No barcode or manufacturer part number Fill in at least one of the two fields; the “No barcode” chip in the summary shows how many such products there are
    Merchant Center picks up an old file The file name contains {DATE}, so the URL changes every day Remove the date macro from the file name
    “Data export NOT completed: the file was not generated” An error in a template formula, or no product matched the conditions Click “Check”: the test run names the formula and the field. No errors — check the filter conditions
    A product appears twice in the feed: itself and its variant Option products get into the feed regardless of the “Options” toggle Filter out options with a condition (scenario)
    Google treats familiar products as new g:id changed — most often “Unique internal SKU” mode assigned SKUs Keep SKUs filled in and stable (about g:id)

    FAQ

    How do I connect the finished feed to Merchant Center?

    In Merchant Center, add a data source with the file URL and an update schedule. Elbuz doesn’t create a Merchant Center account for you. Keep the date macro out of the file name, otherwise the URL will keep changing.

    Where does the Google category in the feed come from?

    g:product_type is your category path, with levels joined by “>”. The category from Google’s taxonomy is taken from the marketplace category matching window and placed in g:google_product_category.

    How do I show a sale price?

    Put the regular price in g:price and the sale price in g:sale_price. If there is no sale, the second tag stays empty and Google shows one price.

    Do I need a separate template for Facebook and Instagram?

    Yes, it is a separate format in the list — “Facebook / Instagram (Meta)”. The engine is the same as for Google Merchant, but the set of tags is its own.

    Does the feed include shipping and taxes?

    No. Shipping and tax rules are set in Merchant Center itself.

    What happens to the file if a run breaks off midway?

    Google keeps fetching the previous file: an unfinished file doesn’t go to the cloud. It is safe to retry the run (details).

    What does disabling a template do — will products disappear from Google?

    No. Disabling stops updates, not display: Merchant Center reads the file from the last run. Deleting the template doesn’t erase this file either.

    Can I roll back a wrong feed?

    No, there are no previous versions of the file. Your catalog is not affected: fix the data, check the template with the “Check” button and export again — the URL stays the same.

    Where to find it and who has access

    Menu
    Directories → Operations → Data export
    Access right
    the “Data export” window; the card — “Export Template Setup”
    Have ready
    a Merchant Center account, your full website address, product photos and prices

    Related topics

    Was this article helpful?

    Missing a feature? Tell us.

    We will add it for free if other users need it too.

    If only you need it, we will agree on it separately.

    Article contents

    Suggest an improvement

    Try Elbuz free