Google Shopping - Merchant API

Using XML Feed and API Together in Magento 2 (Google Shopping)

This guide explains how to use the XML Feed module and the API module together for optimal product synchronization with Google Merchant Center.

Why Use Both?

The XML Feed and API modules serve different purposes and work best when combined:

Module Strength Use Case
XML Feed Complete catalog export Scheduled baseline sync (daily/hourly)
API Module Real-time updates Immediate price/stock changes

Together they provide:

  • A reliable baseline that ensures all products are in Google
  • Fast updates for time-sensitive changes (flash sales, stock depletion)
  • Redundancy if one method temporarily fails

How Google Matches Products

The Offer ID

The Offer ID is the unique identifier that links your Magento products to Google Merchant Center listings. It's the key that allows both Feed and API to update the same product.

Format in Magento: Typically your product SKU or entity ID Example: ABC-12345 or 24-MB01

When you send product data to Google (via Feed or API), the Offer ID tells Google: "This is product ABC-12345, update its data."

How Matching Works

Example: Product with SKU "ABC-12345"

  1. XML Feed sends product data with offerId: ABC-12345
  2. API Module sends product data with offerId: ABC-12345
  3. Google sees the same Offer ID and updates the same product

Both methods update the same product in Google because they use the same Offer ID.

Important: The Offer ID configured in the Feed module must match the Offer ID used by the API module. By default, both use the same source (configured in Feed module settings), so this happens automatically.

Data Sources in Merchant Center

Google Merchant Center uses Data Sources to organize incoming product data. Feed and API use different types:

File Data Source (XML Feed)

  • Type: Scheduled fetch or SFTP upload
  • Contains: Complete product catalog
  • Updates: On your configured schedule

Merchant API Data Source (API Module)

  • Type: Merchant API
  • Contains: Individual product updates
  • Updates: Real-time when products change

How Multiple Data Sources Work

Google can combine data from multiple sources for the same product:

  1. Primary source provides the base product data
  2. Supplemental sources can add or override specific fields

When using Feed + API together, you have two options:

Option A: Separate Data Sources (Recommended)

  • Feed uploads to File data source
  • API updates to Merchant API data source
  • Google merges both, with most recent data taking precedence

Option B: API as Primary

  • API module handles all product data
  • Feed serves as backup/verification only

For Most Merchants

  1. Keep your existing Feed setup (SFTP or scheduled fetch)

    • Runs daily or hourly
    • Ensures complete catalog is always in Google
  2. Add the API module for real-time updates

    • Pushes changes immediately when products are saved
    • Handles price and stock updates between feed runs

Configuration Checklist

  1. Feed Module

    • Attribute mapping configured
    • Offer ID field set (usually SKU)
    • SFTP or scheduled fetch active
  2. API Module

    • Same store view as Feed
    • Merchant API data source created
    • Auto Sync enabled
  3. Verify Offer ID Match

    • The "id" field in Feed module settings
    • Should match what API module sends as offerId
    • Check a synced product in both to confirm

Offer ID Configuration

Where It's Set

The Offer ID is configured in the Feed module under attribute mapping:

Stores > Configuration > Magmodules > Google Shopping - Feed > Attribute Mapping

Look for the id field mapping. Common options:

  • SKU (recommended) - Unique, human-readable
  • Entity ID - Magento's internal ID (numeric)
  • Custom attribute - If you have a dedicated identifier

Best Practices

  1. Use SKU if your SKUs are unique and stable
  2. Never change the Offer ID of existing products - Google treats it as a new product
  3. Keep it consistent across all stores/feeds for the same product
  4. Alphanumeric characters only - avoid special characters

What Happens If Offer IDs Don't Match?

If Feed sends offerId: SKU123 and API sends offerId: 456:

  • Google sees these as two different products
  • You'll have duplicates in Merchant Center
  • Changes via API won't affect the Feed product

Timing and Priority

Which Update "Wins"?

When both Feed and API send data for the same product, Google uses the most recent data for each field.

Example scenario:

  1. 08:00 - Feed runs, sends price: €50
  2. 10:00 - You change price to €45 in Magento
  3. 10:01 - API sends price: €45
  4. Google now shows: €45 (most recent)
Update Type Method Why
Complete catalog refresh Feed (daily) Ensures nothing is missed
Price changes API (immediate) Time-sensitive for ads
Stock changes API (immediate) Prevents selling out-of-stock
New products Feed or API Either works
Product removal Both API for speed, Feed confirms

Handling Conflicts

Price Discrepancies

If Feed and API show different prices:

  1. Check timestamp of last Feed run
  2. Check API sync status for the product
  3. The most recent update should be in Google

Missing Products

If a product is in Feed but not syncing via API:

  1. Check if product passes Feed module filters
  2. Check API module product grid for errors
  3. Verify product was initialized in API module

Duplicate Products

If you see duplicates in Merchant Center:

  1. Check Offer ID in Feed export
  2. Check Offer ID in API sync log
  3. Ensure both use the same identifier

Monitoring

Feed Module

  • Check generated XML for correct Offer IDs
  • Monitor SFTP upload logs
  • Review Merchant Center processing reports

API Module

  • Check Products grid for sync status
  • Verify Offer ID matches Feed
  • Monitor error rates

Merchant Center

  • Products > Diagnostics for issues
  • Check "Data sources" for last update times
  • Verify product count matches expectations

FAQ

Do I need both data sources?

Yes, if using both modules. Each module needs its own data source type in Merchant Center.

Will I get charged twice for the same product?

No. Google Shopping charges are based on clicks, not on how many times you upload product data.

Can I disable the Feed and use only API?

Technically yes, but not recommended. The Feed serves as a safety net ensuring all products remain in Google even if API sync has issues.

What if I only want API for price/stock?

The API module supports inventory-only sync. Full product data comes from Feed, real-time price/stock from API.

How do I verify products are matched correctly?

  1. Note a product's SKU in Magento
  2. Find it in Feed XML export - check the <g:id> value
  3. Find it in API sync log - check the offerId
  4. Find it in Merchant Center - check the Offer ID
  5. All three should match
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