Add feed to Google Merchant Center via API

Upload your product feed to Google Merchant Center (GMC) via API in Productsup.

Introduction

Follow this document to upload your product feed to Google Merchant Center (GMC) via API. To use the FTP upload, see the upcoming document Add Feed to Merchant Center via FTP, then use the Google Merchant Center export template in the platform.

Note

The API only uploads delta files, which means it only uploads new or products with changes.

Note

When you use the API to upload your feed, the platform processes changes immediately and only syncs the changes.

Requirements

To use the API feature, you must:

  1. First, create a feed and use the Google Content API for Shopping export template, not the Google Merchant Center export.

    Add Google Content API for Shopping export template in Productsup.
  2. Add authentication first. See Add OAuth authentication to external systems.

  3. Clean and separate your GMC product feed you uploaded by API and remove those you uploaded via FTP, etc. Combining both the product feed by FTP and API causes feed file conflicts. Switching between two export methods may lead to data loss.

  4. Confirm that the correct column settings for Google Content API for Shopping and the Google Merchant Center export template match. Mismatched settings may cause the platform not to pass column data to GMC.

  5. Once you have created and formatted an export feed on the Productsup platform according to Google's Product data specification, you now need to upload it on the GMC platform. First, you should create a GMC account, complete the shop information form, and verify your website on the GMC settings page.

Note

Google recommends that you limit the size of your batches to GMC via the Google Content API for Shopping (single). The default batch size is 1,000 products. You can expect that Productsup typically sends batch sizes ranging from 100 to 1,000 products.

Add the Google Content API for Shopping export template

  1. Go to Exports A/B from your site's main menu.

  2. Select ADD EXPORT and search for Google Content API for Shopping. Select Add and confirm adding it again as an export.

    add_google_cont_api_shop.png
  3. Prepare and map your feed for GMC.

    Note

    The API is more restrictive than the FTP upload. If you upload an incorrect category or missing mandatory attributes, the product upload fails.

  4. Select Add Destination and choose Google Content API (single account) from the drop-down list. You can optionally customize the destination's description in Name. Select Save.

    add_google_cont_api_destination_single.png
  5. In Merchant Center ID, enter the GMC ID that Google provided to you. If you have a multi-client GMC, enter an ID from your sub-account.

  6. Select the appropriate target country and language for the feed in Target Country and Target Language.

  7. Define how often you want the platform to perform a complete upload in Full Upload Interval (in days). The platform exports new, deleted, changed, and unchanged products to avoid expiration during a complete upload. The platform deactivates products after 30 days or sooner if a specified number of days have passed.

  8. In Merchant Center Cleanup, choose Yes to remove products within GMC that do not originate from this destination or select No.

  9. Choose the authentication in Authentication to use. As previously seen in step 2.

  10. Switch Enable Error Log File to On to access error files as a new data source. You can download the zipped error file from the Notifications window.

    notifications_window.png

    Tip

    The error logs may be spread across different files in the ZIP folder. You can search for something specific in the logs by searching using a keyword, for example, product ID. Some text editors let you search for a keyword across all files in a ZIP file.

  11. For Log API calls, switch this button to On to enable logs. You can find this log in the Notifications window.

  12. Switch Log headers of API calls to On to request to add response headers to the logs.

  13. Enter a date using the YYYYMMDD or YYYY-MM-DD format to stop logging API calls in API call logging end time. Do not let this feature run indefinitely, as it generates excessive files.

  14. Turn on the destination by switching Active to On.

  15. Select Save.

    settings_single.png

Add the Google Content API for Shopping (multi) export template

  1. Go to Exports A/B from your site's main menu.

  2. Select ADD EXPORT and search for Google Content API for Shopping (multi). Select Add and confirm adding it again as an export.

    add_google_cont_api_shop_multi_.png
  3. Prepare and map your feed for GMC.

    Note

    The API is more restrictive than the FTP upload. If you upload an incorrect category or missing mandatory attributes, the product upload fails.

  4. Select Add Destination and choose Google Content API (multi account) from the drop-down list. You can optionally customize the destination's description in Name. Select Save.

    add_google_cont_api_destination_multi.png
  5. In Parent Merchant Center, enter the sub-account GMC ID that Google provided to you.

  6. Merchant Reference Column

  7. Select the appropriate target country and language for the feed in Target Country and Target Language.

  8. Define how often you want the platform to perform a complete upload in Full Upload Interval (in days). The platform exports new, deleted, changed, and unchanged products to avoid expiration during a complete upload. The platform deactivates products after 30 days or sooner if a specified number of days have passed.

  9. Choose the authentication in Authentication to use. As previously seen in step 2.

  10. The Create Merchant Centers button lets you create new merchant accounts when you switch it to On. This only applies when you use the merchant center name or seller ID as the merchant reference.

  11. Switch Enable Error Log File to On to download the zipped error file from a notifications window.

  12. In Merchant Center Cleanup, choose Yes to remove products within GMC that do not originate from this destination or select No.

  13. In Reference Validation (regex), leave the default values #.+# in the field for Productsup to send products to and create accounts for merchant references that pass validation.

  14. In Merchant Reference Type, choose one of the following:

    • Merchant Reference Column contains the Merchant Center Name

    • Merchant Reference Column contains the Merchant Center ID

    • Merchant Reference Column contains the Seller ID

  15. Enter the name of each newly created merchant center account in New Merchant Account Name. This only applies if you use the seller ID as a merchant reference.

  16. Switch Remove Empty Subaccounts to On to remove empty sub-accounts before performing a run.

  17. For Log API calls, switch this button to On to enable logs.

  18. Switch Log headers of API calls to On to request to add response headers to the logs.

  19. Enter a date when you want to disable logging API calls in API call logging end time.

    Note

    This feature can generate an excessive number of files, as you should not leave this feature on indefinitely.

  20. Turn on the destination by switching Active to On.

  21. Select Save.

    settings_multi.png
    settings_multi_cont.png

Clean up your GMC

If you have never uploaded products in your GMC, skip this section and go to Export feed in GMC.

When you upload a feed in your GMC, the feed remains for up to 30 days unless you make changes to the products. Previously uploaded feeds conflict with the products you upload via API. Deleting a feed to clean your GMC has no effect. Instead, to properly clean your GMC, do one of the following:

  • Upload that same feed once again with the attribute expiration_date and mark the attribute expiration date using one (1) day in the future.

Or

  • Upload an empty feed.

Export feed in GMC

  1. Export the feed.

    Note

    Make sure to export unavailable products with the status, out of stock. Otherwise, they appear available in GMC.

    Once the run completes, you can see the result in the notifications:

    Export via API log file on exports in Productsup.
  2. If the export fails, you can check the error messages if you have switched Provide Log File (as import source) to On, as previously seen in step 10. Otherwise, correct your feed and try again.

    Export via API log file in Productsup.

    Note

    There is no file path for you to download client-side when you upload via API in GMC. In this case, you won't see anything in the Feeds tab. After a few minutes to hours, you can see products in the Products tab. After the first upload in GMC, it could take longer than expected before you see products. If there are existing products, the process can take less time.