Part of the Commerce ecosystem · 502 projects
Commerce Merchant Feed publishes a Drupal Commerce catalog to Google Merchant Center and to ChatGPT shopping: as feed files that Google and OpenAI fetch from a fixed URL, and through Google's Merchant API. Prices come from Commerce's own price resolvers, as an anonymous visitor would get them.
Status: Stable. 1.0.0 is the first release.
Why
Google compares the prices in a feed with the product page its crawler sees, which is the page an anonymous visitor gets. On a store whose price resolvers give staff or dealers their own prices, an export run by someone who is logged in can publish their price instead. This module resolves every price as an anonymous customer, through the same resolvers the storefront uses. Google shut down the Content API for Shopping on 18 August 2026; the module pushes through its replacement, Merchant API v1.
Features
Feeds and files
- Three formats: Google Merchant Center XML (RSS 2.0 with the
g:namespace), Google Merchant Center TSV, and the OpenAI product feed (JSONL). The OpenAI feed uses OpenAI's own field names, so ChatGPT gets its own file, not a copy of Google's. - Each feed covers one store, one content language and one target country, in one currency, with an optional Merchant Center feed label. Products without a translation in the feed's language are left out.
- Files are built in batches: by cron every hour, 6 hours, 12 hours or day, from the feed list, or by Drush. A new file replaces the published one only when its run completes, so a half-written feed is never served.
- Files are stored in the private file system when the site has one, or in any other writable file system, and served at
/merchant-feed/FEED_ID/google.xml,google.tsvoropenai.jsonl. - A feed is public, or needs a token kept in the Key module, sent as the HTTP Basic password, a Bearer header or a
tokenquery parameter. Wrong tokens are limited to 20 an hour per address. A token cannot be combined with files in the public file system, where they could be fetched directly.
Product data
- Each Google attribute comes from a variation or product field, a fixed value, or a value the module works out: title, description, the main image and up to ten more (from image, file, media or link fields, or a text field holding a URL), brand, GTIN, MPN,
identifier_exists, condition, adult, age group, gender, color, size, material, pattern, availability date, Google product category and product type, shipping and product weight, shipping and transit time labels, five custom labels, and Google'snative_commercecheckout flag. - Variations of one product are grouped under one
item_group_id, and the OpenAI feed lists each variation's options. - Availability comes from Commerce Stock levels at the locations it assigns to the store, from a field on the variation with a value map, or is always in stock. With Commerce Stock, an item with no stock left is published as out of stock, backorder or preorder, as you choose.
- Default handling and transit times in business days, and an optional shipping rate sent with every item, which is the only way Google takes transit times per item.
- Every item is held to Google's limits: long titles and descriptions are shortened with a warning, invalid GTINs, URLs and other values are dropped with a warning, and items that lack a required value are left out.
Prices
- Prices come from Commerce's price resolver chain for an anonymous customer in the feed's store, with the anonymous user as the current user, in a request with an empty session.
- Prices are rounded to the currency and never converted. A variation priced in another currency, or at zero or less, is left out and listed in the report.
- Optional: a higher list price published as the regular price, with the resolved price as the sale price; and, with Commerce Promotion, promotions an anonymous visitor gets on the product page published as the sale price.
- An optional probe resolves each price again as a made-up logged-in account and warns when the price changes, which means a resolver reads the current user. The anonymous price is still the one published.
- Queued feed work waits when cron runs at the end of a logged-in visitor's request, and runs on a later cron run outside it.
Merchant API
- Product inputs are pushed to a Merchant Center API data source in batches, with a Google Cloud service account key kept in the Key module.
- Only new and changed products are sent: a SHA-256 hash of what Google last accepted is kept for each variation. Unchanged products are sent again within 20 days by default (at most 29), spread over up to a week, because Google removes products not sent for 30 days.
- After each push, products that left the feed (unpublished, deleted, out of scope or now invalid) are deleted from Merchant Center. A push that would delete more than the deletion limit (by default 10% of pushed products, and always at least 3) stops instead; an administrator can then push again allowing it. Products that could not be built this time, for example because a price service timed out, stay in Merchant Center.
- Saving a variation or product, or a stock transaction in Commerce Stock's local storage, sends that product on the next cron run, without waiting for the scheduled push. This is on by default.
- Calls that fail with 408, 429 or a server error are retried with backoff, honoring Google's
Retry-After. An exhausted daily quota waits until it resets at 12:00 UTC. - Google's verdict on each pushed product is read back for the report.
- A Check connection button, a purge that deletes everything a feed pushed, and a Drush command for the one-time Google Cloud project registration that Google requires.
Reports and tools
- A report for each feed with its latest runs and every product left out or sent with a weakened value, and why, with links to edit the product. With the Merchant API on, it also lists the products Google disapproved or limited, with Google's issues.
- One status report entry per enabled feed, flagging setup problems, failed or stale runs, and refused, disapproved, expiring and left-out products.
- Drush commands to list feeds, generate, validate (with
--fail-onto fail a deploy check), push, read Google's status, purge, check the connection and register the Cloud project. - Deleting a feed removes its files and stored data but leaves its products in Merchant Center: purge them first.
- For developers: events to set handling and transit times per variation and to change, add or exclude item attributes, and plugins for feed formats and availability sources. The event cannot change prices; a Commerce price resolver can.
Requirements
- Drupal 11.3 or later, or Drupal 12. Drupal 12 needs a Drupal Commerce release that supports it; Commerce 3.3 supports Drupal 10.3 and 11.
- PHP 8.3 or later with the openssl and xmlwriter extensions.
- Drupal Commerce 3.3 or later, or Commerce 4, with its Price, Product and Store modules.
- Key 1.23 or later, for the download token and the service account key.
- The google/auth library 1.55 or later, which Composer installs.
- For the Merchant API: a Google Merchant Center account and a Google Cloud service account in a project with the Merchant API enabled.
- Optional: Commerce Stock 3, for availability from stock levels; Commerce Shipping, whose variation weight field can feed
shipping_weight; Commerce Promotion, part of Drupal Commerce, for promotion prices; and Drush, for the commands. - Any database Drupal supports (MySQL or MariaDB, PostgreSQL, SQLite).
Installation
Install with Composer, then enable the module:
composer require drupal/commerce_merchant_feed drush en commerce_merchant_feed
For token-protected feeds, configure a private file system first.
Configuration and permissions
Feeds are at Administration » Commerce » Configuration » Merchant feeds (/admin/commerce/config/merchant-feeds). Set each feed's site URL: links and image URLs are built on it, because cron and Drush do not know the public host name. Generate now, Validate, Push now, Read Google status and Delete from Merchant Center are operations in the feed list, and each feed's report is at /admin/commerce/config/merchant-feeds/FEED_ID/report. For the Merchant API, add the service account as a user of the Merchant Center account, create an API data source, and register the Cloud project once with drush commerce-merchant-feed:register-gcp FEED_ID [email protected]; the README has the steps.
- Administer merchant feeds (restricted): add, edit and delete feeds and choose their keys, download any feed file without its token, start generation, validation, pushes, status reads and deletions from Merchant Center, and read the reports.
- View merchant feed reports (not restricted): read each feed's report, which names left-out and degraded products by title, unpublished ones included. The feed list needs the first permission, so give these users the report's URL.
What it does not cover
The price guard cannot see what a price resolver keeps from earlier in the same PHP process, such as a cache keyed by product only or a user captured in a service's constructor, nor data a resolver reads from outside the request, such as the session service. If a logged-in dealer's page filled such a cache, a feed built later in that process could get the dealer's price. Key any resolver cache by the Context's customer. On stores with such resolvers, set the feed to run only by hand or Drush, and run drush commerce-merchant-feed:generate --all and drush commerce-merchant-feed:push --all from the system crontab, each in its own process. The module adds no tax and converts no currency; the status report only warns when the target country expects otherwise.
Similar projects
Checked on drupal.org in November 2026.
- Commerce Product Feeds API offered an API layer for Google Merchant and Facebook catalog feeds. Its latest release (2.1.1, 2022) supports only Drupal 8 and 9.
- Views data export is the usual do-it-yourself route: build a View of products and export it as CSV or XML. Choose it for a simple file feed you want full control over; it has no Merchant API push and no guard on customer-specific prices.
- The commerce_google_shopping and commerce_gmerchant projects have no release for current Drupal.
- Commerce Feeds imports products into Commerce; it does not export feeds.
Support and maintenance
Report bugs and ask for features in the issue queue. Each release has notes describing what changed.
This project is not covered by Drupal's security advisory policy. Until it is, security issues are handled in the public issue queue and fixed in ordinary releases.
A read-only mirror is on GitHub at DanePete/drupal-commerce-merchant-feed; development and issues stay on drupal.org.
Maintainer
Created and maintained by deadnorth (Dead North).
Ask your assistant about Commerce Merchant Feed
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- Commerce Core commerce_price
- Commerce Core commerce_product
- Commerce Core commerce_store
- Key
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Commerce ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | 11 | PHP >=8.3 | Nov 27, 2026 |