Print

Import Google Merchant Center Data to Google Sheets

premium

In this guide, we'll connect Google Merchant Center to Google Sheets, using the API Connector add-on for Sheets. API Connector doesn't have a native integration for this API so we'll set up a custom OAuth connection.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Set up Project

  1. Navigate to https://console.cloud.google.com/.
  1. Click the project dropdown menu
    bigquery-img1
  2. Click New Project
    bigquery-img2
  3. Give it a name and click Create
    googlemerchantcenter-createproject
  4. Still in your project, navigate to APIs & Services > Library and search for "Content API"
    googlemerchantcenter-contentapi
  5. Click on Content API for Shopping to open the details page, and click Enable
    googlemerchantcenter-enablecontentapi

Part 2: Get Credentials

  1. You'll now be back in your project. Click Create credentials (if you aren't on this page, click Enabled APIs & Services > Content API for Shopping from the sidebar on the left)
    googlemerchantcenter-createcredentials
  2. Fill out the Create Credentials form with the following settings:
    • Credential Type/Select an API: Content API for Shopping
    • Credential Type/What data will you be accessing: User data
    • OAuth Consent Screen/App name: select a name
    • OAuth Consent Screen/Email addresses: enter your email address
    • Scopes/Add or remove scopes: .../auth/content
    • OAuth Client ID/Application type: web application
    • OAuth Client ID/Application name: select any name
    • OAuth Client ID/Authorized redirect URL: https://script.google.com/macros/d/12COOkin8nodCH7fZGIBu0D2jWY8-AEA0uvElt4Ph4wRbLUD4wslqQUfG/usercallback

  3. Once you've completed those steps, download your credentials and click Done.
    googlemerchantcenter-downloadcredentials

Part 3: Connect Google Merchant Center to API Connector

  1. Open up Google Sheets and click Extensions > API Connector > Manage Connections
  2. Scroll to the bottom of the sidebar and click Add Custom OAuth
  3. Fill in the Custom OAuth modal as follows:
    • OAuth Grant TypeAuthorization Code
    • NameCustom GMC
    • Authorization Base URLhttps://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/content
    • Token URLhttps://oauth2.googleapis.com/token
    • Client IDprovided by Google in the credentials file
    • Client Secretprovided by Google in the credentials file
      googlemerchantcenter-customoauth
  4. Click Save, then click Manage Connections
  5. You should now see your new Google Merchant Center connection listed. Click Connect.
    googlemerchantcenter-customconnect
  6. You'll be prompted to log in and approve the connection. Click Allow.
    googlemerchantcenter-allow
  7. You can verify that your connection is now active on the Manage Connections screen.

Part 4: Pull Google Merchant Center API Data into Sheets

We're finally here....Let's get some data! You can see all the available endpoints in Google Merchant Center's documentation, but for this example we'll start with fetching product data. To do this we'll need your merchant ID, which you can get from the top menu bar while logged into the Google Merchant Center.
googlemerchantcenter-merchantId

Once you have your merchant ID, continue as follows:

  1. Open up Google Sheets and click Extensions > API Connector > Open > Create request.
  2. In the request form enter the following, substituting in your own merchant ID where it says your_merchant_id:
    • ApplicationCustom
    • MethodGET
    • Request URLhttps://shoppingcontent.googleapis.com/content/v2.1/your_merchant_id/products
    • OAuth: Custom GMC
  3. Create a new tab and click Set current to use that tab as your data destination.
  4. Name your request and click Run. A moment later you’ll see product data populate your Google Sheet
    googlemerchantcenter-response

Part 5: API Documentation

Official API documentation: https://developers.google.com/shopping-content/reference/rest/v2.1

Leave a Comment

Jump To