Uploading products to Merchant Center from Magento 2
Google Merchant Center is an online tool provided by Google that allows businesses to upload and manage their product information so it can be displayed in Google Shopping, Search, and other Google services. It serves as a bridge between your e-commerce platform and Google, enabling you to promote your products to potential customers. By having your products uploaded in Merchant Center you can easily create customized Google Ads campaigns by pulling products from specific feeds.
Merchant Center allows you to keep your products up to date and always let Google know about your product details, recent changes, price updates etc. It is imperative to keep your products uploaded to Merchant Center with the most accurate data.
UPLOADING PRODUCTS TO MERCHANT CENTER
There are multiple ways to upload products to merchant center starting from manual input to XML feeds and file uploads. In this article we shall review a modern and alternative method of uploading products to Merchant Center and keeping them up to date. The read is focused towards store owners running Adobe Commerce (Magento 2) ecommerce platform.
STANDARD WAYS TO ADD PRODUCTS TO MERCHANT CENTER
The usual approach used to update Merchant Center is through a special XML files (feeds). These files are provided in an XML format and contain all the attributes and values of the products that need to be added or updated in Merchant Center. Adding the XML feed itself can be done in multiple ways. Most common one is to generate a XML feed URL, then add this URL in a new data source in Merchant Center and have Google automatically update products using this feed URL as data source. You can also upload a manual file or use SFTP to automate the process.
All these however require generating an XML feed with specific structure, keeping this feed up to date as well. The approach works but it's often prone to user errors and may require certain level of understanding what XML is, how XML format looks like etc. which for an end user could be cumbersome.
A MODERN AND EASIER WAY
In 2024 Google introduced their new Merchant Center API (BETA). The Google Merchant Center API allows developers to programmatically manage and automate tasks related to their Google Merchant Center account. It is a RESTful API that provides a way to upload, update, and retrieve product data, manage account information, and handle other operations more efficiently than using the Google Merchant Center web interface.
The API allows for updates to happen behind the scenes and in real time. In the case of using an XML file to update Merchant Center, this file has to be updated but this can't happen everytime a single products gets updated. This implies using a scheduled proccess for generating these XML files which leads to a time delay between actual product update and Merchant Center update.
Merchant API eliminates this by allowing for real time products updates. A product can be updated the moment it gets updated in Magento 2 which in effect syncs Magento 2 product data with Merchant Center products.
A READY MERCHANT API EXTENSION FOR MAGENTO 2
We have designed and created a modern Google Merchant Center API extension for Magento 2 to offer our clients an automated real time communication between Magento 2 and Merchant Center.
NEW PROJECT
All other methods are easier to start but bring difficulties later. With the Merchant API initial configuration is a bit harder but once done, the whole process is automated from then on. Configuration requires Merchant API to be enabled in Google Cloud Platform first.
To create a NEW PROJECT:
1. Go to Google Cloud Platform
2. Click Projects / New project
3. Give your project some meaningful name
4. Click CREATE
5. Once project is created make sure to select it as current project


ENABLING MERCHANT API
Once project is created, the Merchant API must be enabled for that project.
To enable Merchant API:
1. Go to Dashboard
2. From the Quick Access panel select APIs and Services
3. On the next screen Click + ENABLE APIS AND SERVICES
4. Find Merchant API (by typing Merchant API in the fast search)
5. Click Enable BUTTON to enable the Merchant API
CREDENTIALS AND AUTHORIZATION
Last but not least, we need to authorize the API to manager Merchant Center account. That is done via so called Service account
To create a new Service account:
1. Click + CTREATE CREDENTIALS
2. From the dropdown select Service account
3. Add name to your service account
4. Click Create and Continue
5. On the next screen for Role pick "Owner" and click Continue
6. Click DONE to create the Service account

JSON KEYS
From Service accounts section select your newly created service account. Once selected, click Keys. From Add key dropdown select Create New Key, for Key type select JSON and click Create. You shall be given a link to download a JSON key file which you can store anywhere in your computer.
MERCHANT CENTER AUTHORIZATION
On the service accounts page click Details and copy the email of the service account, it will be in the following format: merchant-api-account@stunning-saga-441609-v5.iam.gserviceaccount.com 1. Once copied, go to your Merchant Center account at Google 2. Click the gearbox icon located in your top right corner and then select People & Access 3. In People section click 'Add person' and insert the email of the service account. 4. On next screen for access type select Standard and Performance and Insights checkboxes. You can leave Admin unchecked. 5. Click Add user button located in your bottom right corner.
FINISH
If you followed all the steps described above, now you have created a new project in Google Cloud Platform and have correctly authorized this project to access your Merchant Center account and manage your products.
With this the hard part is over.
We have prepared a short video on how to configure and use the extension itself available on YouTube - Google Merchant API for Magento 2