# Google Search Console

Google Search Console is a free tool by Google that helps monitor, maintain, and troubleshoot a website’s presence in Google Search results. It provides insights into search traffic, indexing status, and potential issues affecting the site’s visibility.

### **How to use Google Search Console in ZBrain Flow** <a href="#how-to-use-google-search-console-in-zbrain-flow" id="how-to-use-google-search-console-in-zbrain-flow"></a>

**Step 1: Add Google Search Console to Flow**

1. Click the ‘+’ icon in ZBrain Flow.
2. In the search bar, type “Google Search Console”.
3. Select Google Search Console from the list of available connections.
4. Choose the action you want to perform from the available options:

| **Action name**      | **Description**                                                         |
| -------------------- | ----------------------------------------------------------------------- |
| **Search analytics** | Query traffic data for your site using the Google Search Console API.   |
| **List sitemaps**    | List all your sitemaps for a given site.                                |
| **Submit a sitemap** | Submit a sitemap for a site to Google Search Console.                   |
| **List sites**       | List all sites associated with your Google Search Console account.      |
| **Add a site**       | Add a site to the set of your sites in Google Search Console.           |
| **Delete a site**    | Remove a site from your Google Search Console account.                  |
| **URL inspection**   | Check the status and presence of a specific page within Google's index. |
| **Custom API call**  | Make custom API calls to specific endpoints in Google Search Console.   |

### **How to Create a Google Search Console Connection in ZBrain Flow** <a href="#how-to-create-a-google-search-console-connection-in-zbrain-flow" id="how-to-create-a-google-search-console-connection-in-zbrain-flow"></a>

To use Google Search Console in ZBrain Flow, you need to create a secure connection with your Google Search Console account.

**Steps for creating a connection:**

1. **Connection name**: Choose a unique name for your Google Search Console connection.
2. **Redirect URL**: Provide the redirect URL: `https://secrets.activepieces.com/redirect`.
3. **Client ID and Client Secret**:
   * Go to the Google Cloud Console (<https://console.cloud.google.com/>).
   * Create a new OAuth 2.0 client ID under APIs & Services > Credentials.
   * After creating the credentials, you will receive the Client ID and Client Secret, which you need to paste in the respective fields.
4. **Click connect**: Click 'Connect' to authenticate and authorize the connection with your Google Search Console account.

### **Available actions for Google Search Console in ZBrain Flow** <a href="#available-actions-for-google-search-console-in-zbrain-flow" id="available-actions-for-google-search-console-in-zbrain-flow"></a>

Here is a detailed guide to all available Google Search Console actions, including required configuration fields for each:

#### 1. **Search analytics** <a href="#id-1.-search-analytics" id="id-1.-search-analytics"></a>

**Configuration options:**

* **Connection**: Select your existing Google Search Console connection or create a new one.
* **Site URL**: Enter the URL of the site you want to query.
* **Start date**: Specify the start date of the date range in YYYY-MM-DD format.
* **End date**: Specify the end date of the date range in YYYY-MM-DD format.
* **Dimensions**: Define the dimensions by which to group the results, such as \["query", "page", "country", "device", "searchAppearance", "date"].
* **Filters**: Apply filters to restrict the data to specific subsets.
* **Aggregation type**: Choose how data is aggregated (e.g., "auto", "byPage", "byProperty").
* **Row limit**: Set the maximum number of rows to return.
* **Start row**: Specify the first row to return for paginated results.

#### 2. **List sitemaps** <a href="#id-2.-list-sitemaps" id="id-2.-list-sitemaps"></a>

**Configuration options:**

* **Connection**: Choose or create a connection.
* **Site URL**: Select the URL of the site whose sitemaps you want to list.

#### 3. **Submit a sitemap** <a href="#id-3.-submit-a-sitemap" id="id-3.-submit-a-sitemap"></a>

**Configuration options:**

* **Connection**: Choose or create a connection.
* **Site URL**: Select the URL of the site.
* **Sitemap Path**: Specify the path to the sitemap.

#### 4. **List sites** <a href="#id-4.-list-sites" id="id-4.-list-sites"></a>

**Configuration options:**

* **Connection**: Select or create a connection.

#### 5. **Add a site** <a href="#id-5.-add-a-site" id="id-5.-add-a-site"></a>

**Configuration options:**

* **Connection**: Select or create a connection.
* **Site URL**: Choose the URL of the site to be added.

#### 6. **Delete a site** <a href="#id-6.-delete-a-site" id="id-6.-delete-a-site"></a>

**Configuration options:**

* **Connection**: Select or create a connection.
* **Site URL**: Select the URL of the site to be removed.

#### 7. **URL inspection** <a href="#id-7.-url-inspection" id="id-7.-url-inspection"></a>

**Configuration options:**

* **Connection**: Select or create a connection.
* **Site URL**: Pick the URL of the site.
* **URL to Inspect**: Enter the URL of the page you want to inspect.

#### 8. **Custom API call** <a href="#id-8.-custom-api-call" id="id-8.-custom-api-call"></a>

**Configuration steps:**

* **Select an existing connection or create a new one**: Choose an existing connection or create a new one.
* **Enter the URL**: Enter the full URL or relative path to the base URL for the API endpoint.
* **Select the HTTP method**: Choose the appropriate HTTP request type:
  * **GET** – Retrieve data (e.g., performance data, site lists, sitemap status).
  * **POST** – Submit data (e.g., run search queries, submit sitemaps, request URL inspection).
  * **DELETE** – Remove a resource (e.g., delete a site or sitemap).
  * **PATCH / PUT / HEAD** – Rarely or not supported in Google Search Console; avoid unless explicitly required.
* **Add headers**: Define additional headers required for the API request.
* **Add query parameters**: Customize the request with query parameters.
* **Enter JSON body**: Provide structured data in JSON format for the request.
* **Set timeout (in seconds)**: Define a timeout duration to prevent long-running API calls from stalling.
