Google Analytics 4
  • 8 Minutes to read
  • Dark
    Light

Google Analytics 4

  • Dark
    Light

Article Summary

Google Analytics 4 (GA4) is a web analytics platform that provides businesses with advanced tracking and measurement capabilities, focusing on a user-centric data model that enables tracking of user interactions across multiple devices and platforms, allowing for a more comprehensive understanding of customer behavior and journey. GA4 also incorporates machine learning features to provide actionable insights and predictions for businesses to optimize their marketing strategies.

Refer to Google's official documentation to see all available endpoints from the GA4 API.

If you have multiple GA4 accounts and would like to extract the same data from all of them, it's possible through multi-account extraction (MAE). Contact our Solutions team to enable this feature.

DATADDO TIP

If you want to use MAE, make sure your Include property ID option is turned on. to be able to identify which records belong to each account when doing your data analysis.

Authorize Connection to Google Analytics 4

To authorize this service, use OAuth 2.0 to share specific data with Dataddo while keeping usernames, passwords, and other information private.

  1. On the Authorizers page, click on Authorize New Service and select your service.
  2. Follow the on-screen prompts to grant Dataddo the necessary permissions to access and retrieve your data.
  3. [Optional] Once your authorizer is created, click on it to change the label for easier identification.

Ensure that the account you're granting access to holds at least admin-level permissions.

For more information, see our article on authorizers.

How to Create a Google Analytics 4 Data Source

  1. On the Sources page, click on the Create Source button and select the connector from the list.
  2. From the drop-down menu, choose your authorizer.
    Didn't find your authorizer?

    Click on Add new Account at the bottom of the drop-down and follow the on-screen prompts. You can also go to the Authorizers tab and click on Add New Service.

  3. Name your data source and select your metrics and attributes.
  4. [Optional] Configure your advanced settings. If you are unsure about how to proceed, we recommend skipping this step.
  5. Configure your sync frequency or set the exact synchronization time under Show advanced settings.
    DATADDO TIP

    If you need to load historical data, refer to the Data Backfilling article.

  6. Preview your data by clicking on the Test Data button in the top right corner. You can adjust the date range for a more specific time frame.
  7. Click on Save and congratulations, your new data source is ready!


Limitations

Metrics and Dimensions Combinations

Not all GA4 metrics and dimensions combinations will work, even though they might be available to select. For available combinations, refer to the official GA4 website.

Rows Limit per Batch

The GA4 API allows the extraction of up to 10,000 rows at a time. In case you need need to extract more rows, load data in multiple batches using manual data load.

Historical Data Limitation

The GA4 API allows you to extract up to 1 year of historical data.

Fresh Data Unavailable

Google takes between 24 – 72 hours to process data which is why it’s possible to get data only from 3 days ago or older.

You can extract last 3 days of GA4 data but keep in mind that this data will most likely change.

Send fresh GA4 data to a

Fresh GA4 Data to a Data Warehouse

First, make sure that deduplication is possible in your case. Then set

  1. Click on your data source.
  2. In the Snapshotting tab, select Replace.
  3. In the Advanced tab, change the date range expression to 3d1 or 3d0.
    Google Analytics 4 - fresh data to DWH date range.png
  4. Save your configuration.
  5. When creating a data flow, select upsert (limited to 4 unique columns) as your write mode.
DATADDO TIP

In case upsert is not possible (e.g. you need more than 4 unique columns), you can deduplicate in your own storage using thedataddo_extraction_timestamp field.

Fresh GA4 Data to a Dashboarding App

Create two data sources, one for historical data, the second for fresh data.

[Data Source 1: Historical Data]
This data source will add data from 4 days ago to your table every day. Click on your data source and set the following:

[Data Source 2: Fresh Data]
This data source will be a running window of the last three days (it will always contain the last 3 days' fresh data without duplicates). Click on your data source and set the following:

As both of these sources have the same schema, they can be added into the same flow. For more information, see the article on data union.

Troubleshooting

Data Preview Unavailable

No data preview when you click on Test Data might be caused by an issue with your source configuration. The most common causes are:

  • Date range: Try a smaller date range. You can load the rest of your data afterward using manual data load.
  • Insufficient permissions: Please make sure your authorized account has at least admin-level permissions.
  • Invalid metrics, attributes, or breakdowns: You may not have any data for the selected metrics, attributes, or breakdowns.
  • Incompatible combination of metrics, attributes, or breakdowns: Your selected combination cannot be queried together. Please refer to the service's documentation to view a full list of metrics that can be included in the same data source.

Duplicates

Duplicates may be the result of selecting too many dimensions during data source configuration. Choose fewer dimensions or make sure they are compatible.

Example: We want to get the total daily number of sessions.

Original table

DateNumber of Sessions
Jan 1 20222
Total number of sessions: 2

When the pagepath dimension (what pages are visited by every user) is added, we get the following numbers:

DateNumber of SessionsPage
Jan 1 20222Page 1
Jan 1 20221Page 2

Total number of sessions: 3

The issue: One user visited both Page 1 and Page 2 during the same session. The same session appeared twice in combination with each page and resulted in a duplicate.

Missing Data Error

Missing data occurs when the total values was broken down into subcategories and the sum of the two subcategories differs. When working with your data, you need to keep this difference in mind.

When Google is unable to retrieve the subcategory information on all of its users, this value is left blank. These blank values are then disregarded instead of being put into their own category. This error happens most often with gender or country dimensions.

Example: We want to find out how many men and how many women visited the website last week.

Original table

TotalNumber
Total Users500

When the gender dimension is added, the table will look like this:

TotalNumber
Total Female Users200
Total Male Users200

The issue: 100 from the total is missing as Google was not able to retrieve information on 100 users’ genders and the undetermined values were not put into a separate row.

No Data Error

If you have no data in your source, it may lead to a broken data source and issues with synchronization. Check the Allow Empty box in the source's settings, to send empty data to your destination.

Too Much Data Error

Please note that when you repeatedly attempt to extract unavailable GA4 data, you may encounter a 5xx error. After several tries, data extraction will be blocked for 16 hours. This error often shows up when there's a too much data in your GA4.

Failed to Save Extracted Data to Storage Error

When it GA4 hasn't received any information for a dimension, it will return (not set) as a value which is a string. This may cause your data source to break if the expected data type is integer.

  1. To fix this issue, change the data type of the field to string. Click on the data source and navigate to the Schema tab.
  2. If your data source is connected to a data destination, don't forget to change the data type in the destination as well.

Related Articles

Now that you have successfully created a data source, see how you can connect your data to a dashboarding app or a data storage.

Sending Data to Dashboarding Apps

Sending Data to Data Storages

Other Resources


Was this article helpful?