silvershop-suite / product-feed-google
Google Merchant channel connector for silvershop-suite/product-feed (CMS 6): an RSS 2.0 + g: namespace serializer and field map that turns the shared CatalogProductData into a Google Shopping product feed, plus a bundled Google product taxonomy with per-category mapping. Registers itself into the pr
Package info
github.com/silvershop-suite/silvershop-product-feed-google
Type:silverstripe-vendormodule
pkg:composer/silvershop-suite/product-feed-google
Requires
- php: ^8.3
- silvershop-suite/product-feed: ^1.0
- silvershop/core: ^6.2
- silverstripe/cms: ^6.0
- silverstripe/framework: ^6.0
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-24 10:58:55 UTC
README
The Google Merchant channel connector for
silvershop-suite/product-feed on Silverstripe CMS 6. It plugs a
Google Shopping channel into the feed core's registry seam: an RSS 2.0 + g: namespace serializer, the
CatalogProductData → g:* field map, and a bundled Google product taxonomy with per-category mapping. No core
change — the connector registers itself.
product-feed core ──(registry)──▶ GoogleChannelFeed.mapItem() ──▶ RssGFormat ──▶ public/feeds/google.xml
(g: attribute map) (RSS 2.0 + g:) served at /feed/google
Requirements
- PHP 8.3+,
silverstripe/framework^6,silverstripe/cms^6,silvershop/core^6.2 silvershop-suite/product-feed(the feed core; pulls insilvershop-suite/catalog-datatransitively)
Release ordering.
silvershop-suite/product-feedandsilvershop-suite/catalog-dataare not on Packagist yet, so CI / a plaincomposer requireis release-blocked until they are published — a known ordering dependency (core → connector), likesilvershop-suite/newsletter→ its ESP connectors. For development and the clean-room, install product-feed + catalog-data (and its guarded soft-deps) as path repositories.
Installation
composer require silvershop-suite/product-feed-google
Then dev/build?flush=all. This:
- adds the per-category Google product category mapping to
ProductCategory; - seeds the bundled Google taxonomy (~5,600 categories) when the table is empty (toggle with
GoogleShoppingCategory.seed_on_build; re-seed withsake tasks:ProductFeedGoogle-SeedTaxonomy,--freshto rebuild); - registers + enables the
googlechannel in the feed core (installing the connector means you want the feed).
Mapping categories
Open a product category in the CMS → Google Shopping → pick a Google product category from the tree. A
sub-category inherits its nearest mapped ancestor, so mapping a top-level category is usually enough. A product's
g:google_product_category is resolved from its category's mapping (walking up the tree).
Generating & serving
The feed core owns generation, scheduling and serving (see its README). With this connector installed:
- generate:
sake tasks:ProductFeed-Generate --channel=google(or let the recurringGenerateProductFeedJobdo it), written topublic/feeds/google.xml; - serve:
https://your-shop/feed/google(the core's serving route) — point Google Merchant Center at that URL, or at the static file directly.
The g: field map
| Google attribute | Source (CatalogProductData unless noted) |
|---|---|
g:id |
feedId() (= conversion-tracking content_ids) |
title / description / link |
title() / description() / link() |
g:image_link / g:additional_image_link |
imageLink() / additionalImageLinks() |
g:availability |
availability() → in_stock / out_of_stock / preorder / backorder |
g:price / g:sale_price |
formattedPrice() / formattedSalePrice() ("12.95 EUR") |
g:brand / g:gtin / g:mpn |
brand() / gtin() / mpn() (gtin/mpn via silvershop-suite/product-identity) |
g:identifier_exists |
no only when no gtin + mpn + brand, else omitted |
g:condition |
condition() → new / refurbished / used |
g:google_product_category |
the mapped GoogleShoppingCategory (id, or path) via the category parent-walk |
g:product_type |
productType() with the site root trimmed (product_type_trim_segments, default 1) |
g:item_group_id |
itemGroupId() (parent product) — variants are separate <item>s sharing it |
g:color / g:size |
matched from attributes() (color_attributes / size_attributes) |
g:shipping |
opt-in (shipping_enabled, default off) from configured flat rates |
All text is XML-escaped (XSS-safe) and the document is well-formed RSS 2.0.
Config
SilverShop\ProductFeed\Google\GoogleChannelFeed: google_product_category_as: 'id' # or 'path' product_type_trim_segments: 1 # drop the catalogue root from g:product_type shipping_enabled: false shipping: - { country: 'NL', service: 'Standard', price: '4.95 EUR' } SilverShop\ProductFeed\Google\Model\GoogleShoppingCategory: seed_on_build: true
Merchant Center setup
- Verify + claim your domain in Google Merchant Center.
- Products → Feeds → add a scheduled fetch feed pointing at
https://your-shop/feed/google. - Set the fetch frequency to match
GenerateProductFeedJob.regenerate_interval_mins(default nightly). - Map your categories (above) so
g:google_product_categoryis populated, and fix any attribute warnings in the Merchant Center diagnostics.
Licence
BSD-3-Clause.
Credits
Built and maintained by Remy Vaartjes (remy@xd.nl) — part of the SilverShop-Suite.