Google Shopping - Merchant API

Magento 2 Google Shopping Merchant API Sync Explained

This guide explains how the Google Shopping API extension synchronizes your Magento products with Google Merchant Center in real-time.

XML Feed vs. API Sync

XML Feed (Google Shopping - Feed module)

  1. Magento generates an XML file with all product data
  2. The feed is delivered to Google via scheduled fetch (URL) or SFTP upload
  3. Batch-based: The entire catalog is sent each time

Ideal for: Stores with stable pricing and inventory that update on a predictable schedule (daily, hourly). Simple setup, reliable, and works great for most merchants.

API Sync (This add-on module)

  1. Product changes in Magento automatically trigger a sync
  2. Updates are sent directly to Google via their Merchant API
  3. Event-driven: Only changed products are synced

Ideal for: Stores with frequent price changes, dynamic inventory, or real-time stock from ERP/PIM systems. Keeps Google in sync without waiting for the next scheduled feed.

Using Both Together

This module is an add-on to the Feed module, not a replacement. Many stores benefit from using both:

  • XML Feed: Ensures Google always has a complete, up-to-date baseline of all products
  • API Sync: Pushes critical changes (price, stock) to Google immediately

This combination gives you the reliability of scheduled feeds plus the speed of real-time updates.

The Sync Process

Overview

  1. Product saved in Magento - You update a product in admin or via import
  2. Flagged for sync - The indexer marks the product as "needs update"
  3. Added to queue - A cron job picks up flagged products and adds them to the queue
  4. Synced to Google - The queue consumer sends the data to Google Merchant API
  5. Visible in Google Shopping - Changes appear in Google within minutes

Step 1: Change Detection

When you save a product in Magento (or stock updates via import), the extension automatically flags it for synchronization. This happens via Magento's indexer system - the same technology that updates your category pages and search results.

What triggers a sync:

  • Product save (admin or API)
  • Stock quantity change
  • Price update
  • Any attribute change that affects the feed

What doesn't trigger a sync:

  • Products not included in your feed (filtered out by category, attribute, etc.)
  • Disabled products
  • Out-of-stock products (if configured to exclude)

Step 2: Queue Processing

The extension doesn't sync immediately when you save a product. Instead, it uses Magento's message queue system:

  1. Cron job runs every few minutes - Picks up flagged products
  2. Products added to queue - Grouped in batches for efficiency
  3. Queue consumer processes - Sends data to Google

Why a queue?

  • Prevents timeout issues during bulk imports
  • Handles rate limits gracefully
  • Allows retries on failures
  • Doesn't slow down your admin panel

Step 3: Data Comparison

Before sending data to Google, the extension compares your current product data with what was previously synced:

  1. Fetches fresh product data from Magento
  2. Calculates a "fingerprint" (hash) of the data
  3. Compares with the stored fingerprint
  4. Only syncs if something actually changed

Why this matters:

  • Saves API quota - no unnecessary calls to Google
  • Faster processing - skips unchanged products
  • Accurate tracking - you know exactly what's synced

Step 4: Google API Call

When a product needs syncing, the extension:

  1. Transforms Magento data to Google's format
  2. Sends an update request to the Merchant API
  3. Records the response (success or error)
  4. Updates the product status in the grid

Sync Types

Full Product Sync

Updates all product attributes: title, description, price, images, shipping, etc.

Used when:

  • Product is first added
  • Any non-inventory attribute changes
  • Manual sync from admin grid

Inventory-Only Sync

Updates only price and availability - faster and with higher API limits.

Used when:

  • Only price changes
  • Only stock quantity changes
  • Scheduled inventory refresh

Product Statuses

In the admin grid (Marketing > Google Shopping API > Products), each product shows a status:

Status Meaning
Pending New product, never synced
Queued In queue, waiting to be processed
Synced Successfully synced to Google
Error Sync failed - check error message
Pending Delete Will be removed from Google

Timing

When do changes appear in Google?

Under normal conditions:

  • Indexer flags product: Instant (on save)
  • Cron picks up: Within 5 minutes
  • Queue processes: Within 1-2 minutes
  • Google reflects change: Within 5-30 minutes

Total: Typically under 15 minutes

What can slow things down?

  • Large queue backlog (bulk imports)
  • Google API rate limits
  • Cron not running
  • Queue consumers not running

Relationship with Feed Module

This module works alongside the Google Shopping Feed module, not as a replacement:

Feature Feed Module API Module
Data source Uses Feed module's product data Uses Feed module's product data
Attribute mapping Configured in Feed module Inherited from Feed module
Product filters Configured in Feed module Inherited from Feed module
Delivery method XML file for Google to fetch Direct API calls
Update speed Depends on fetch schedule Near real-time

Important: Both modules use the same product data configuration. If a product is excluded from your feed (via filters), it won't be synced via API either.

For a detailed guide on using both modules together, including how Offer IDs work and data source configuration, see Using Feed and API Together.

Configuration Impact

What's configured in Feed module (inherited)

  • Attribute mapping (which Magento attributes map to Google fields)
  • Product filters (which products to include/exclude)
  • Category mapping
  • Static values (brand, condition, etc.)

What's configured in API module

  • Google Cloud credentials (Service Account)
  • Merchant ID and Data Source
  • Sync intervals and batch sizes
  • Error retry settings

Error Handling

Automatic Retries

When a sync fails, the extension:

  1. Logs the error with details
  2. Keeps the product in "Error" status
  3. Retries after a configurable interval (default: 4 hours)

Common Errors

Error Cause Solution
Invalid price Price format issue Check price attribute mapping
Missing required field Required Google field empty Check attribute mapping for title, description, etc.
Image not accessible Google can't fetch image Ensure images are publicly accessible
Product not found Product doesn't exist in data source Verify data source configuration

Manual Intervention

From the admin grid, you can:

  • View error details - Click the status to see the full error
  • Retry single product - Use the "Sync" action
  • Retry multiple products - Select products and use mass action

Monitoring

Admin Grid

Marketing > Google Shopping API > Products

Shows all products with their sync status, last sync time, and any errors.

CLI Commands

# Check overall sync status
bin/magento googleshopping:api:status --store=1

# Manually sync specific products
bin/magento googleshopping:api:sync --store=1 --product-ids=1,2,3

# Test connection
bin/magento googleshopping:api:test-connection --store=1

Logs

Debug logging (when enabled) writes to:

var/log/googleshopping_api.log

Best Practices

Initial Setup

  1. Configure the Feed module first (attribute mapping, filters)
  2. Set up API module credentials
  3. Test connection
  4. Use "Initialize Products" to populate the sync table
  5. Monitor first batch for errors

Ongoing Operations

  • Keep cron running reliably
  • Monitor the Products grid for errors
  • Check Google Merchant Center for disapprovals
  • Review logs periodically

Large Catalogs

For stores with 10,000+ products:

  • Increase batch size (up to 1000)
  • Ensure queue consumers are running
  • Consider dedicated cron for queue processing
  • Initial sync may take several hours

Troubleshooting

Products not syncing

  1. Check if cron is running: bin/magento cron:run
  2. Check if product is in feed: Review Feed module preview
  3. Check product status in grid: Look for errors
  4. Check queue: bin/magento queue:consumers:list

Changes not appearing in Google

  1. Verify product shows "Synced" status
  2. Check last sync time in grid
  3. Wait 15-30 minutes for Google to process
  4. Check Merchant Center for product disapprovals

High error rate

  1. Review error messages in grid
  2. Check attribute mapping in Feed module
  3. Verify all required fields are mapped
  4. Test with a single product first

Further Reading

Article Updated:
star star star star star
star star star star star
Alexandru-Manuel Carabus
Magmodules sets the bar for Magento module quality and support—we check their catalog first for client feature requests, and they’re our first choice for licenses.
Google 11 Nov 2025
star star star star star
star star star star star
Matt Austin
Possibly the fastest support response times of any Magento Extension vendor. Great extensions too!
Google 09 Sep 2025
star star star star star
star star star star star
Jan Privé
Dankzij de heldere uitleg en snelle reactie van Magmodules kon mijn vraag, en dus mijn Magento-probleem, binnen enkele uren worden beantwoord. Doeltreffend, zonder moeilijke termen, gewoon zo als het zou moeten zijn.... Bedankt!
Google 05 Sep 2025
star star star star star
star star star star star
Denis Metzler
To evaluate a provider, it is not enough to consider only the product offered, but also its after-sales service, such as support and troubleshooting. Magmodules has been extremely satisfactory at all levels on multiple occasions and sets the bar at the top when comparing the competition.
Google 02 Sep 2025
star star star star star
star star star star star
Bleijenberg winkelinrichting en materialen
Goed bereikbaar, reageren snel en denken oplossingsgericht. Een aanrader.
Google 30 Jul 2025
star star star star star
star star star star star
Patrick Verduijn
Magmodules biedt plugins aan die van hoge kwaliteit zijn tegen een goede prijs, waar dit bedrijf in uitblinkt is de bereidheid om de zeldzame feedback & problemen met de plugins te willen onderzoeken, mee te willen denken in het debuggen van problemen en goede oplossingen toe te passen. In mijn decennium ervaring met Magento & 3th parties is Magmodules absoluut een uniqum binnen de markt.
Google 25 Jul 2025
star star star star star
star star star star star
Erik de Groot
Magemodules heeft hele sterke Magento extensies en een proactieve support. Al jaren heel erg tevreden over jullie service en producten!
Google 18 Jul 2025
star star star star star
star star star star star
René Zeuner
We are using the Mollie Magento extension from Magmodules. It works excellently without flaws. Very fast, competent and friendly support. Thanks!
Google 30 Jun 2025
star star star star star
star star star star star
R. U.
Erg goed team, reageren snel en duidelijk en hebben met toegang tot onze database erg goed geholpen (eigenlijk een gratis customization).
Google 18 Jun 2025
star star star star star
star star star star star
Hugo de Groot
Uitstekende support! Wij gebruiken o.a. de Rich Snippets Suite extensie voor onze Magento 2 webshop (Hyvä) en hadden een specifieke vraag over structured data op PLP-pagina’s. Binnen no-time kregen we een inhoudelijk en duidelijk antwoord. Zeer prettig contact en goed onderbouwde uitleg. Absoluut een betrouwbare partner voor Magento-extensies!
Google 13 Jun 2025