haerriz / module-google-shopping-feed
Google Merchant Center API and Google Shopping Feed XML/CSV Generator for Magento 2
Package info
github.com/haerriz/magento2-google-shopping-feed
Type:magento2-module
pkg:composer/haerriz/module-google-shopping-feed
Requires
- php: ~8.1.0||~8.2.0||~8.3.0
- google/shopping-merchant-datasources: ^0.1.0
- google/shopping-merchant-products: ^0.1.0
- magento/framework: ^103.0.0 || ^104.0.0
- magento/module-backend: ^102.0.0 || ^103.0.0
- magento/module-catalog: ^104.0.0 || ^105.0.0
- magento/module-config: ^101.0.0 || ^102.0.0
- magento/module-cron: ^100.4.0 || ^101.0.0
- magento/module-store: ^101.0.0 || ^102.0.0
- magento/module-ui: ^101.0.0 || ^102.0.0
Requires (Dev)
README
Multi-channel product feed generator for Magento 2 with Google Merchant API sync, FTP/SFTP delivery, taxonomy mapping, cron scheduling, and admin wizard tooling.
Supported channels: Google Shopping, Meta/Facebook, Instagram, Snapchat, TikTok, Pinterest, Microsoft/Bing, Amazon, eBay, Rakuten, OpenAI/ChatGPT Commerce.
Requirements
- Magento Open Source / Adobe Commerce 2.4.x
- PHP 8.1 / 8.2 / 8.3
- Magento cron configured
- Optional:
phpseclib(via Magento dependencies) for SFTP - Optional: Google Cloud service account for Merchant API sync
Installation
composer require haerriz/module-google-shopping-feed bin/magento module:enable Haerriz_GoogleShoppingFeed bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Manual install:
mkdir -p app/code/Haerriz/GoogleShoppingFeed
# Copy the module contents into app/code/Haerriz/GoogleShoppingFeed
bin/magento module:enable Haerriz_GoogleShoppingFeed
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
After upgrading from an older release, run bin/magento setup:upgrade so declarative schema adds new profile fields such as identifier_exists_mode and export_configurable_mode.
Configuration
- Go to Stores → Configuration → Haerriz Extensions → Product Feed
- Enable the module
- (Optional) Configure Google Merchant API:
- Merchant Account ID
- Service Account JSON key (stored encrypted)
- Target country / currency
- API mode (
productionorsandbox)
- Create feed profiles under Marketing → Google Shopping Feeds
Feed profile wizard
- General: name, status, channel, filename
- Exclude categories
- Rename / map categories to channel taxonomy
- Basic product attributes (SKU, title, price, description, availability)
- Optional attributes (brand, GTIN, MPN, condition, UTM)
- Schedule (cron expression)
- Destination: Local / FTP / SFTP / Merchant API
Feed QA and identifiers
- Live Preview shows completeness guidance for missing image, link, price, brand, GTIN, MPN, and description fields.
- The QA report button downloads a CSV with
sku,missing_field,severity, and remediation guidance. - By default, critical QA misses log warnings only. To block remote delivery when image/link/price are missing, enable Stores → Configuration → Haerriz Extensions → Product Feed → General Settings & Cron → Block Delivery on Critical QA Issues.
identifier_exists_mode=autowritesidentifier_exists=nowhen both GTIN and MPN are absent. Usealways_yesoralways_noonly when your catalog policy requires it.- Configurable products default to child variants only. The profile
export_configurable_modecan switch to parent-only or parent-and-children.
CLI Commands
# Generate one profile php bin/magento haerriz:feed:generate --profile=1 # Validate mapping/config php bin/magento haerriz:feed:validate --profile=1 # Import Google taxonomy php bin/magento haerriz:feed:import-taxonomy # Sync / reconcile Merchant API php bin/magento haerriz:feed:merchant-sync php bin/magento haerriz:feed:merchant-reconcile # Consume queued jobs / cleanup artifacts php bin/magento haerriz:feed:consume-jobs php bin/magento haerriz:feed:cleanup-artifacts
Security notes
- Delivery passwords and Google service-account JSON are encrypted with Magento's encryptor.
- Remote FTP/SFTP host validation blocks private, loopback, link-local, and reserved IPs (SSRF hardening).
- Profile duplication scrubs credentials and resets lock/retry runtime state.
- Admin ACL resources separate profile management, generation, downloads, jobs, and credentials.
Supported product types
| Type | Feed behavior |
|---|---|
| Simple | Exported as one offer |
| Virtual / Downloadable | Exported as one offer (no shipping weight metadata) |
| Configurable | Expands to enabled child variants (item_group_id = parent SKU) |
| Grouped | Expands to enabled associated products |
| Bundle | Exported as the sellable parent offer |
Currency for price fields is taken from the profile currency, then store currency (no hardcoded INR).
Marketplace Readiness
- Do not commit Merchant API service-account JSON, FTP/SFTP passwords, private keys, or webhook secrets. Configure them in Magento admin only.
- Run
bin/magento setup:di:compile,bin/magento setup:upgrade --dry-run=1where available, and module unit tests before packaging. - Verify ACL access for feed profile management, generation, downloads, jobs, and configuration.
- Confirm generated feeds are written under
pub/media, remote delivery credentials are encrypted, and QA warnings are reviewed before enabling delivery blocking.
Testing
vendor/bin/phpunit -c phpunit.xml
License
MIT License. Created by Haerriz.