> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postqueen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google My Business setup

> Register the Google My Business application and give PostQueen its keys

Register a Google Cloud application, enable the Business Profile APIs, and put the OAuth keys in your environment so your own instance can connect the channel.

<Note>
  This integration allows you to post updates to your Google Business Profile. Before you start, make sure you have a Google account and a verified Google Business Profile.
</Note>

<Warning>
  The **Google My Business API** requires approval from Google. You must submit an access request through Google's [access request form](https://developers.google.com/my-business/content/prereqs#request-access). Approval can take a few days up to a week.
</Warning>

## Setup

<Steps>
  <Step title="Go to Google Cloud Console">
    Make sure you are logged in to your Google account and visit the [Google Cloud Console](https://console.cloud.google.com/projectselector2/apis/credentials). Make sure to read the terms and conditions and "Agree and Continue".
  </Step>

  <Step title="Create or Select a Project">
    Create a new project by clicking on the "Create Project" button, or select an existing project. Fill in the project name and details, then click "Create".

    <Tip>
      You can use the same Google Cloud project for both YouTube and Google My Business integrations.
    </Tip>
  </Step>

  <Step title="Enable Required APIs">
    Click **Enable APIs and Services** at the top of the dashboard. Search for and enable each of the following APIs:

    * `Google My Business API` - This will only appear after your access request has been approved
    * `My Business Account Management API`
    * `My Business Business Information API`

    For each API, click the **Enable** button on the API's detail page.
  </Step>

  <Step title="Configure OAuth Consent Screen">
    Navigate to the **OAuth consent screen** tab. If not already configured:

    1. Select "External" user type (unless you have a Google Workspace organization)
    2. Fill in the required app information
    3. Add yourself as a test user
    4. Save and continue through the wizard

    On the **Scopes** step, add the three PostQueen asks for. The connect is refused if any one of
    them is missing:

    ```
    https://www.googleapis.com/auth/userinfo.profile
    https://www.googleapis.com/auth/userinfo.email
    https://www.googleapis.com/auth/business.manage
    ```
  </Step>

  <Step title="Create OAuth Credentials">
    1. Navigate to the **Credentials** tab
    2. Click on **Create Credentials** and select **OAuth client ID**
    3. For Application Type, select **Web application**
    4. Enter a name for your application

    <Snippet file="oauth2redirect.mdx" />

    **Your Google My Business OAuth2 Redirect URI:**

    * Production: `https://postqueen.example.com/integrations/social/gmb`
    * Local development: `http://localhost:4200/integrations/social/gmb`
    * Docker: `http://localhost:4007/integrations/social/gmb`

    Add your redirect URI under **Authorized redirect URIs**, then click **Create**.
  </Step>

  <Step title="Copy your credentials">
    After creating the credentials, you will see your `Client ID` and `Client Secret`. Copy these and add them to your `.env` file:

    ```env theme={"system"}
    GOOGLE_GMB_CLIENT_ID=""
    GOOGLE_GMB_CLIENT_SECRET=""
    ```

    <Note>
      These are the same credentials used for YouTube integration. If you have already configured YouTube, you do not need to add new environment variables - just ensure the GMB redirect URI is added to your existing OAuth credentials.
    </Note>
  </Step>

  <Step title="Restart PostQueen">
    Stop PostQueen if it is running, and restart it with the updated environment variables.
  </Step>

  <Step title="Add Google My Business in PostQueen">
    Go to the PostQueen web interface, click on the "Add Channel" button, and select "Google My Business". You should be redirected to Google to authorize the application.
  </Step>
</Steps>

<Check>
  The channel is in the left sidebar with its avatar and name. That is the whole confirmation: if it is in the list, she can post to it.
</Check>

## Troubleshooting

### API Access Not Approved

If you cannot find the "Google My Business API" in the API library, your access request may still be pending. Check your email for updates from Google, or resubmit the [access request form](https://developers.google.com/my-business/content/prereqs#request-access).

### 403 Forbidden Errors

Make sure all three required APIs are enabled:

* Google My Business API
* My Business Account Management API
* My Business Business Information API

## Next steps

<CardGroup cols={2}>
  <Card title="What she can post to Google My Business" icon="https://mintcdn.com/forceplay/LL5FipRv-7nhg1To/images/channels/google-business.svg?fit=max&auto=format&n=LL5FipRv-7nhg1To&q=85&s=72c001245575c7c7705243680c356f53" href="/providers/google-my-business" width="64" height="64" data-path="images/channels/google-business.svg">
    Limits, post types and settings
  </Card>

  <Card title="Configuration reference" icon="list" href="/configuration/reference">
    Every variable she reads
  </Card>

  <Card title="Connect errors" icon="plug-circle-xmark" href="/troubleshooting/oauth-connect">
    Invalid state, invalid\_grant and the rest
  </Card>

  <Card title="Another channel" icon="plug" href="/providers/overview">
    Every network, and what each one asks for
  </Card>
</CardGroup>
