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

# Google Analytics GA4 as a data source

> Bring data from Google Analytics GA4 to Nekt.

Google Analytics GA4 (Google Analytics 4) is Google's web analytics platform that provides comprehensive insights into website and app performance. It tracks user interactions, conversions, and engagement metrics, helping businesses understand audience behavior and optimize their digital presence.

<img height="50" src="https://mintcdn.com/nekt/0tn1_nwKYqAHn7jo/assets/logo/logo-google-analytics.png?fit=max&auto=format&n=0tn1_nwKYqAHn7jo&q=85&s=2dba5e30f7fde3bff83bf9040d76c1d1" data-path="assets/logo/logo-google-analytics.png" />

## 1. Add your Google Analytics GA4 access

1. In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Google Analytics GA4 CRM option from the list of connectors.

2. Click **Next** and you'll be prompted to fill the configuration.

   **Default configuration**

   * **Authorization**: first of all, authorize Nekt through the **Google Authorization** button.
   * **Property ID**: add the property ID associated with your website. Check [GA4 documentation](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id#what_is_my_property_id) to discover where you can find this information.
     and select the date of the first reports you want to retrieve.
   * **Start date**: the date of the first report you want to retrieve.

   **Advanced configuration**

   By default, the connector is configured to generate the following reports:

   | Report Name                  | Dimensions                                                                          | Metrics                                                                                                                                                                                                          |
   | ---------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Website Overview**         | date                                                                                | activeUsers <br /> newUsers <br /> sessions <br /> sessionsPerUser <br /> averageSessionDuration <br /> screenPageViews <br /> screenPageViewsPerSession <br /> bounceRate <br /> engagementRate                 |
   | **Traffic Sources**          | date <br /> source <br /> medium <br /> sourcePlatform                              | activeUsers <br /> sessions <br /> sessionsPerUser <br /> bounceRate <br /> engagementRate                                                                                                                       |
   | **Locations**                | date <br /> country <br /> countryId <br /> region <br /> city <br /> cityId        | activeUsers <br /> newUsers <br /> sessions <br /> sessionsPerUser <br /> averageSessionDuration <br /> screenPageViews <br /> screenPageViewsPerSession <br /> bounceRate <br /> engagementRate                 |
   | **Four Weekly Active Users** | date                                                                                | active28DayUsers                                                                                                                                                                                                 |
   | **Weekly Active Users**      | date                                                                                | active7DayUsers                                                                                                                                                                                                  |
   | **Daily Active Users**       | date                                                                                | active1DayUsers                                                                                                                                                                                                  |
   | **Devices**                  | date <br /> deviceCategory <br /> deviceModel <br /> operatingSystem <br /> browser | activeUsers <br /> newUsers <br /> sessions <br /> sessionsPerUser <br /> averageSessionDuration <br /> screenPageViews <br /> screenPageViewsPerSession <br /> bounceRate <br /> engagementRate                 |
   | **Transactions**             | date                                                                                | activeUsers <br /> averageRevenuePerUser <br /> newUsers <br /> purchaseRevenue <br /> sessions <br /> totalRevenue <br /> transactions                                                                          |
   | **Pages**                    | date <br /> hostName <br /> pagePath <br /> sessionMedium <br /> sessionSource      | activeUsers <br /> bounceRate <br /> engagedSessions <br /> engagementRate <br /> eventCount <br /> screenPageViews <br /> screenPageViewsPerUser <br /> screenPageViewsPerSession <br /> userEngagementDuration |

   However, you also have the ability to build your own reports. You can configure that by clicking on **Advanced settings** and defining the following parameters:

   1. **Report name**: the name of the report, which will be converted into a stream name. It should have spaces and special characters.
   2. **Dimensions**: the list of dimensions you want to add to the report.
   3. **Metrics**: the list of metrics you want to add to the report.

   [Here's the list](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema) of available Dimensions & Metrics from Google Analytics.

   We also support custom dimensions. In that case, you should add to the **Dimensions** list using the prefix `customEvent:` or `customUser:` followed by the name of the event. Which prefix to use depends on the scope defined for the custom dimension (user vs event). For example, of your custom event name has an `Event` scope and the name of the event is `page_view`, you should include this dimension as `customEvent:page_view`.

   **IMPORTANT:** in order for custom dimensions to be available in the API, you have to ensure the dimension was created in the Google Analytics panel and has at least 1 event associated with it. It may take up to 24h for the event to propagate.

   {" "}

   <Note>
     {" "}

     The name of the dimensions and metrics should match the exact name from the
     [Google Analytics documentation](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema).{" "}
   </Note>

   {" "}

   <Note>
     {" "}

     There are certain combinations of dimensions and metrics that are not allowed
     by Google. You can check and validate it on [this link](https://ga-dev-tools.google/ga4/dimensions-metrics-explorer/)
     before building your the report.{" "}
   </Note>

3. Click **Next**.

## 2. Select your Google Analytics GA4 streams

1. The next step is letting us know which streams you want to bring. The streams available are related to the reports mentioned in the previous section. You can select entire groups of streams or only a subset of them.

   > Tip: The stream can be found more easily by typing its name.

2. Click **Next**.

## 3. Configure your Google Analytics GA4 data streams

1. Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: depending on the data you are bringing to the lake, you can choose between INCREMENTAL and FULL\_TABLE. Read more about Sync Types [here](https://docs.nekt.com/get-started/core-concepts/types-of-sync).

2. Click **Next**.

## 4. Configure your Google Analytics GA4 data source

1. Describe your data source for easy identification within your organization. You can inform things like what data it brings, to which team it belongs, etc.

2. To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

3. Optionally, you can define some additional settings (if available).

* Configure Delta Log Retention and determine for how log we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

### Check your new source!

1. Click **Next** to finalize the setup. Once completed, you'll receive confirmation that your new source is set up!

2. You can view your new source on the [Sources](https://app.nekt.ai/sources) page. Now, for you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you have to wait for the pipeline to run. You can now monitor it on the [Sources](https://app.nekt.ai/sources) page to see its execution and completion. If needed, manually trigger the pipeline by clicking on the refresh icon. Once executed, your new table will appear in the Catalog section.

## Troubleshooting

### Reports returning 0 records (Data Thresholding)

If your reports are returning 0 records, the issue might be related to **data thresholding** — a privacy protection mechanism in Google Analytics GA4.

**What is data thresholding?**

GA4 hides data when there are fewer than approximately 40-50 users per segment to protect user privacy. This happens when your report combines multiple dimensions that create very granular segments, making individual users potentially identifiable.

**Dimensions commonly affected by thresholding:**

* `userAgeBracket` (age demographics)
* `userGender`
* Other user demographic dimensions

**Example scenario:**

If your report combines dimensions like:

* `userAgeBracket` (thresholded dimension)
* `deviceCategory` → `operatingSystem`
* `country` → `region` → `city`
* `date`

This creates very specific segments (e.g., "18-24 year olds using Windows in Paris on 2025-01-01") that likely fall below the \~50 user threshold, causing all data to be hidden.

**How to resolve:**

1. **Reduce dimension granularity**: Remove or consolidate dimensions to create larger user segments
2. **Remove demographic dimensions**: Consider removing `userAgeBracket`, `userGender`, or similar thresholded dimensions
3. **Use broader time ranges**: Instead of daily reports, try weekly or monthly aggregations
4. **Simplify location data**: Use `country` alone instead of `country` → `region` → `city`

<Warning>
  Data thresholding is a Google Analytics privacy feature and cannot be disabled. The only solution is to adjust your report configuration to create less granular segments.
</Warning>

> If you encounter any issues, reach out to us via Slack, and we'll gladly assist you!

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Google Analytics GA4 skills file" icon="wand-magic-sparkles" href="/sources/google-analytics-ga4.md">
  Google Analytics GA4 connector documentation as plain markdown, for use in AI agent contexts.
</Card>
