> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xsiam/configure-cortex-xsiam/cortex-xsiam-data-sources/vendor-specific-data-sources-and-connectors/google/google-analytics.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# Google Analytics

Use Google Analytics data with Cortex XSIAM.

The capabilities and sub-capabilities listed for this connector are available with any active Cortex XSIAM or Cortex Cloud Posture Security license.

This connector includes the following capabilities and sub-capabilities (if applicable):

* **SaaS Posture Configuration Monitoring:** Detect, monitor and alert on settings of your SaaS application.
  * **saas-posture-config-remediation:** Help remediate the misconfigured security settings of your SaaS application.

### How to configure the Google Analytics connector

To access Google Analytics, Cortex XSIAM requires the following information, which you will specify during the connection process.

* **Service Account Email:** The `client_email` value from your Google Cloud service account JSON key file. Cortex XSIAM uses this value to identify the service account during authentication.
* **Service Account JSON Credential File:** The JSON key file downloaded from Google Cloud Console. Cortex XSIAM uses the `client_email` and `private_key` fields in this file to sign authentication tokens and call the Google Analytics Admin API.

Perform the following procedures in the order that they appear below.

#### Task 1: Create a Service Account and Download the JSON Key

1. Navigate to the [Google Cloud Console](https://console.cloud.google.com) and select an existing project or create a new one using the project dropdown at the top of the page.
2. Navigate to **APIs & Services** → **Credentials** (or **IAM & Admin** → **Service Accounts**).
3. Click **Create Credentials** → **Service account**.
4. Enter a **Service account name** (for example, `sspm-google-analytics`) and click **Create and Continue**.
5. Skip the optional **Grant this service account access to project** and **Grant users access to this service account** steps. Click **Done**.
6. Open the newly created service account, select the **Keys** tab, and click **Add Key** → **Create new key**.
7. Select **JSON** and click **Create**. Your browser downloads a `.json` key file.
8. Store the downloaded JSON file securely.

   > Do not continue to the next step unless you have downloaded the JSON key file. You must upload this file to Cortex XSIAM during the onboarding process. The file contains the `client_email` and `private_key` fields that Cortex XSIAM uses to authenticate to the Google Analytics API.

#### Task 2: Enable the Google Analytics Admin API

1. In the same Google Cloud project, navigate to **APIs & Services** → **Library**.
2. Search for **Google Analytics Admin API**, open the result, and click **Enable**.

   > If the API is not enabled, API calls will return a `403 SERVICE_DISABLED` error even if authentication succeeds.

#### Task 3: Grant the Service Account access in Google Analytics

> A service account created in Google Cloud has no visibility into any Google Analytics account until it is explicitly added as a user in Google Analytics. Complete this step before attempting to connect.

1. Open the downloaded JSON key file and copy the `client_email` value (for example, `sspm-google-analytics@your-project-id.iam.gserviceaccount.com`).
2. Navigate to [Google Analytics](https://analytics.google.com) and click the **Admin** gear icon.
3. At the **Account** level, select **Account Access Management** and click **+** → **Add users**.
4. Paste the service account email address.
5. Assign one of the following roles:
   * **Viewer** or **Analyst** — sufficient for read-only posture scanning of accounts, data-retention settings, and property configurations.
   * **Administrator** — required if the connector needs to read user access bindings or broader admin data.
6. Uncheck **Notify by email** (service accounts do not have an inbox) and click **Add**.

#### Task 4: Connect Google Analytics to Cortex XSIAM

1. In Cortex XSIAM, navigate to **Settings** → **Data Sources & Integrations**.
2. Click **+ Add new**.
3. In the **Add Data Source** page, search for Google Analytics.
4. Under **Recommended**, hover over the new Google Analytics integration and click **Add Instance** to launch the configuration wizard.
5. Under the **Capabilities** tab, enter a name for your application.
6. Select **Security Posture** under **Default Capabilities**. Click **Next**.
7. Under the **Connection** tab, enter the **Service Account Email** (`client_email` from the downloaded JSON file) and upload the **Service Account JSON Credential File**.
8. Under the **Configuration** tab, select a **Sync Interval**. Choose a meaningful **Tag** to distinguish between various applications in different environments.
9. A confirmation message shows that Google Analytics is successfully connected. Confirm the **Summary** details and click **Save instance**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xsiam/configure-cortex-xsiam/cortex-xsiam-data-sources/vendor-specific-data-sources-and-connectors/google/google-analytics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
