Skip to main content

GA4 - Google Analytics integration with Onclusive

D
Written by David Featherly

This document outlines how to connect GA4 property with the Onclusive platform in order to enable PR Attribution™. It consists of two parts:

1. Providing view only access to the GA4 Property

First, you would need to provide view only access to the GA4 property we are integrating with. To do so, you would navigate to your GA4 property and then:

  • Click Settings

  • Click Property access management

  • Click + in the top right of the screen > Add User

  • Add email analytics2@onclusive.com > choose Viewer as role and click Add

2. Create API credentials in Google Cloud console

a) Create Project

Log in to Google Cloud Console (https://console.cloud.google.com/) and create a new project.

Name it and click "Create".

b) Enable Google Analytics Data API

Go to Menu in top left > hover over APIs and Services and choose Library

In the Library search for Google Analytics Data API click on it and enable it. If it doesn't show the screen from below with the Enable button, it means it's already enabled.

c) Configure Consent screen and Publish app

In the left navigation click "OAuth consent screen". Make sure that User Type is set to "External". After that click "Create" button.

After that, fill out required fields:

Once you have this portion filled out click "Save and continue" button. For the Scopes and Test Users fields you don't need to fill out anything so just press "Save and continue". On Summary screen publish the app.

Go back to 0Auth Consent Screen and make sure that the app is published and "in production":

d) Create OAuth Client ID and Client Secret

Once you have consent screen completed, go back to Credentials tab and click Create Credentials > 0Auth client ID. Choose Web Application.

Add the following entries in Javascript origin and authorized redirect URIs

Add the following entries in Javascript origin and authorized redirect URIs

Once you click Create button, you will get a popup where you will see Client ID and Client Secret. Copy and save both of those, since that's what you would need to provide to Onclusive so API connection to Google Analytics can be established.

Note: In some cases the user who created the API keys needs to have access to the GA4 property data is pulled from, otherwise the api call with come back with the permission issue error.

Did this answer your question?