Google Analytics 4

Google Analytics 4 is a free web analytics service by Google that tracks and reports website traffic.

This connection uses the Google Analytics Data API v1, which gives access to Google Analytics 4 (GA4) report data. Use this connector to access Google Analytics 4 properties only. It is not compatible with Universal Analytics. For more details, see the API documentation.

Data integration: Skyvia supports importing data from Google Analytics 4 to other applications, exporting its data to CSV files, and replicating Google Analytics data to relational databases.

Backup: Skyvia Backup DOES NOT support Google Analytics 4 backup.

Query: Skyvia Query supports Google Analytics 4.

Establishing Connection

To create a connection to Google Analytics 4, sign in to Google Analytics 4 with your credentials and select Account and Property.

Creating Connection

ga4-connection

To connect to Google Analytics 4, perform the following steps:

  1. Click Sign In with Google in the Connection Editor.
  2. Enter your Google credentials and click Sign in.

    google-drive-sign-in-2023

  3. Click Allow

    google-analytics-permissions

  4. Select Account and Property from the corresponding drop-down lists.

Additional Connection Parameters

Metadata Cache

You can specify the period after which Metadata Cache expires.

Analytics Start Date

This parameter defines the start date for reading data from the CompleteAnalytics object. The default value is the August 14, 2015.

Use Display Names

This parameter determines whether to use the display or API names for the objects in the connector. Skyvia uses API names by default.

Display names may contain spaces or other special characters. API names capitalize the first letter in the object name. For example, the audienceName field display name is Audience Name, and its API name is AudienceName.

Connector Specifics

Skyvia cannot write data to Google Analytics 4. Its data is read-only.

Data Structure

Skyvia represents Google Analytics 4 data as two objects CompleteAnalytics and RealtimeAnalytics with a number of fields representing Google Analytics 4 metrics and dimensions. Dimensions are attributes of your data. Dimension values in report responses are strings. For example, the dimension City indicates the city from which an event originates. It can be San Francisco or Berlin, or other city.

Metrics are the quantitative measurements of a report. For example, the metric eventCount is the total number of events.

The returned data represents the metrics values calculated for existing combinations of dimension values. For example, if you query the City dimension and some metrics, like Sessions, you will get rows for every city from which there were website visits, with the corresponding metrics values:

City Sessions
San Francisco 5,000
Berlin 4,000

If you add another dimension to the query, for example, Browser, the results for cities will be split per browser, and you will have rows for every city and browser combination for which there were website visits:

City Browser Sessions
San Francisco Chrome 3,000
San Francisco Firefox 2,000
Berlin Chrome 2,000
Berlin Safari 1,000
Berlin Firefox 1,000

Due to Google Analytics 4 API specifics, you can query 9 dimensions and 10 metrics max in a single request to the CompleteAnalytics object. You can query 4 dimensions and 4 metrics in a single request to the RealtimeAnalytics object.

Consider metrics and dimensions compatibility when querying. You may receive an error if you query incompatible metrics and dimensions.

Cohorts Support

A cohort is a group of users that has a common characteristic. The only supported characteristic is the first session date (users with the same FirstSessionDate field value).

Skyvia allows getting cohort data from Google Analytics 4 via the corresponding metric and dimension fields with the Cohort_ prefix in their names.

Cohort dimensions: Cohort, CohortNthDay, CohortNthWeek, CohortNthMonth.

Cohort metrics: CohortActiveUsers, CohortTotalUsers.

Cohort parameters: CohortGranularity, CohortStartOffset, CohortEndOffset.

When you use cohort dimensions or metrics in your query, the cohort parameters are applied by default. You can redefine their values by adding them to your query. The CohortGranularity valid values are Daily (default), Weekly, Monthly. The default value for CohortStartOffset is 0. The default value for CohortEndOffset is 10. More details about cohorts are available here.

Filtering Specifics

Skyvia supports using the >,>=,<,<=, =, !=, BETWEEN, and IN operators for numeric and date fields (all metrics and some dimensions).

String fields (dimensions) support the following operators: =, !=, LIKE, IN, IS NULL, IS NOT NULL.

The Date field in regular reports, the FirstSessionDate in cohort reports, and the MinutesAgo field in the RealtimeAnalytics object support the >,>=, <, <=, =, and BETWEEN operators.

If the FirstSessionDate is used beyond cohort reports, it supports the =, !=, LIKE, IN, IS NULL, IS NOT NULL operators.

Cohort parameters fields support only the = operator.

You can use multiple filter conditions and combine different operators.

Skyvia supports sorting for all fields except the cohort parameters. Sorting by multiple fields is also supported.

Incremental Replication and Synchronization

Skyvia supports Replication with Incremental Updates for the CompleteAnalytics object.

Skyvia queries changed data from Google Analytics 4 by the Date field of the CompleteAnalytics object. This field stores dates without the time part. When performing replication with Incremental Updates, Skyvia only tracks updates up to the last day. Skyvia doesn’t track the updates made on the current date.

It means there is no point in scheduling replication with Incremental Updates more than once daily.

Skyvia doesn’t support Synchronization for Google Analytics 4.

Supported Actions

Google Analytics 4 connector supports the following actions: