Online Data Provider: Google Analytics version 4

[Version: 2023 - August]
[Build: 23.08.31502]

What has happened?

The latest version of Google Analytics is called Google Analytics version 4 (or simply GA4).

Prior to that, Google Analytics was also known as Universal Analytics. By July 1, 2023 Google has decided that Universal Analytics will stop processing data, and by that time, you should have switched to GA4 to continue using the services of Google Analytics.

Read more about Google's decision here: Universal Analytics is going away

What should you do?

For TARGIT users, processing data from Google Analytics via TARGIT's data providers in Data Discovery or in InMemory ETL, you should also, as soon as possible, make the switch to GA4.

From this version, TARGIT 2022 Winter, TARGIT can use GA4 as a data source. The new provider is one of our Online Data Providers, meaning that if Google should decide to change anything in their API that breaks the connection, TARGIT will quickly detect it and correct it. You won't need to install any new drivers to get it up and running again.

The old Google Analytics provider will be able to co-exist with the new provider, and keep providing data until July 1, 2023.

You will need to enable GA4 for your Google account. Google documentation: Make the switch to Google Analytics 4


Your TARGIT license needs to support the Google Analytics Online Data Provider. Contact your TARGIT Account Manager if it doesn't.

How to register Google OAuth App

Note: Registration of the Google OAuth App is optional. You can use the TARGIT Google Analytics data provider out-of-the-box. 

Create a new project

  1. Go to
  2. Give your project a name and select a location
  3. Click Create


Configure project

  1. Under APIs & Services, select OAuth consent screen
  2. Select External User Type and click Create
  3. On the next screen, fill out App Name, User support email and Developer contact information
  4. Click Save and continue
  5. Go to the Credentials tab
  6. Click Create credentials and select OAuth client ID
  7. Select Web application in the dropdown, and give it a name
  8. Click Add URI under Authorized Javascript origins and enter as URI
  9. Click Createimage2023-2-8_9-54-24.png
  10. Copy the Client ID and Client secretimage2023-2-8_9-55-11.png

Publish app

  1. Go to the OAuth consent screen and click Publish App. Confirm in the Dialog.image2023-2-8_10-32-50.png
  2. After a while (5-15 minutes), the application will work.


Enable the Google Analytics Admin API

  1. Go to
  2. Click Enable


Enable the Google Analytics Data API

  1. Go to
  2. Click Enable



Get Refresh Token

  1. Go to and enter Client ID and Client secret
  2. Click Authenticate App
  3. Copy token

Set Up Connection

In ETL Studio or Data Discovery, set up your connection to Google Analytics 4.

ETL Studio

  1. Click Add Data Source
  2. Select Google Analytics 4
  3. Fill out Client ID, Client secret, and Refresh token
  4. Select dimensions and measures to include — use the validate button to make sure they have a relation
  5. Use Import to add data source to your project

Data Discovery

  1. Add a new data source
  2. Select Google Analytics 4
  3. Fill out Client ID, Client secret, and Refresh token
  4. Select dimensions and measures to include — use the validate button to make sure they have a relation
  5. Build a cube using the new data source

Google Analytics Snippet

Google Analytics online data provider allows you to retrieve Google Analytics user data by using the new Google Analytics V4 API.

Firstly, you need to get the user Refresh Token using the

Please make sure that the Client ID and Client Secret are the same on the website and in the snippet. These parameters are hidden by the optional parameters.

When you type Refresh Token, snippet will fetch all available Google Analytics properties for user. For the selected property snippet will show all available dimensions and metrics. 

After selecting the necessary dimensions and metrics, you can validate your query by clicking Validate button. This is to check if the selected dimensions and metrics are completely valid.


Was this article helpful?
1 out of 1 found this helpful



Please sign in to leave a comment.