Connector Google Analytics

Last modified by jhurst on 2024/04/02 14:25

 Configuration: Authentication data for Digdash
 (service account + P12 file + Google Analytics account’s ID)

Context

This document explains how to get authentication information that Digdash needs to connect to your Google Analytics account.

We need the following information:

  • Service account
  • P12 file
  • Google account’s ID

Prerequisites

  • Being a G Suite subscriber or Cloud Identity subscriber
  • Having an activated Organization resource on your domain

Creating a new project

Go to your Google Cloud console at:

https://console.cloud.google.com/projectselector/home/dashboard?supportedpurview=project

google_analytics_connector_config_en_html_181801a2a7fd7771.png

 

You can either select an existing project or create a new project.

We are going to focus on the creation.

Then click on Create.

The next screen allows you to define the project. Give it a name and choose its associated Organization.Then click on Create.

google_analytics_connector_config_en_html_df76892efb913ae4.png

 

Please wait for a few seconds, the creation takes a few seconds.

  • google_analytics_connector_config_en_html_fe28954d2392b1bc.png
  • The Organization resource is the root node in the Google Cloud Platform resource hierarchy and is the hierarchical super node of projects. A project is then defined after an Organization and the choice is definitive.
  •  

Activating Google Analytics API

Go to your Google Cloud console at:

https://console.cloud.google.com/projectselector/home/dashboard?supportedpurview=project

Select the new project we just created.

google_analytics_connector_config_en_html_2aabb4d8e5e905f0.png

 

google_analytics_connector_config_en_html_a731c259e2abab2a.png

 

In the left side bar, go to API & services > Library

google_analytics_connector_config_en_html_9046131ba6772a4.png

 

Get down on the page to find Other > Analytics API. Click on it.

google_analytics_connector_config_en_html_b6510cafb3c5948c.png

 

In the next screen, click on Enable.

google_analytics_connector_config_en_html_2f4c69ab0ddf2ceb.png

 

Creating a service account and a P12 file

In the left side bar, go to API & services > Credentials

google_analytics_connector_config_en_html_1286373fbe7a35cc.png

 

In the next screen, click on Create credentials > Service account key

google_analytics_connector_config_en_html_a068c26f94e2d318.png

 

In the next screen, select New service account in the dropdown list Service account and enter a name in Service account name. This generates a Service account ID in an email address form (ending with gserviceaccount.com).

google_analytics_connector_config_en_html_e12bda205963e9f1.png

 

In the Role list, select Project > Owner

In the options Key type, select P12 then click on Create.

google_analytics_connector_config_en_html_d7b65b751eed32aa.png

 

The P12 file will be downloaded automatically on your disk, please save it preciously. Click on Close.

google_analytics_connector_config_en_html_17b76a337cbe4f5f.png

 

In the next page, click on Manage service accounts (on the right).

google_analytics_connector_config_en_html_70fd7d22ff2995f5.png

 

Then, get the Service account ID (in an email address form).

google_analytics_connector_config_en_html_5e3c9dd16d7c4116.png

 

Connecting service account and Google Analytics account

Now, we are going to connect the service account we created to your Google Analytics account.

Go to your Google Analytics account at:

https://analytics.google.com/analytics/web/

In the left side bar, click on Admin

google_analytics_connector_config_en_html_ec2f8d8418b19ee4.png

 

Then click on User Management

google_analytics_connector_config_en_html_5df7afd42864fc5c.png

 

Add the service account ID (in an email address form) and let Read & Analyse in the list next to the field.

google_analytics_connector_config_en_html_d8e9357e5bf34acc.png

 

Please wait for a few seconds so the changes are taken in count (about 3 minutes).

Getting Google Analytics account’s ID

This is the ID you will need to enter in Digdash Enterprise Studio.

Go to your Google Analytics account at:

https://analytics.google.com/analytics/web/

You can display all your Google Analytics accounts clicking on the button All accounts at the top right corner of the page.

google_analytics_connector_config_en_html_ff83bfd3b44dc33e.png

 

This lists all your Google Analytics accounts with their names, their IDs (first column). Please take note of the Google Analytics account’s ID you want to work with (the one that is linked to our service account).

google_analytics_connector_config_en_html_875a04a8c4dc17f6.png

 

Connecting to Google Analytics via Digdash Enterprise Studio

When in Digdash Enterprise Studio, choose a new Google Analytics datasource.

In the interface, enter the corresponding information:

  • Service account : it is the service account name we got in an email address form (in the example: testaccount@projet-test-155909.iam.gserviceaccount.com)
  • P12 file: It is the P12 downloaded when creating the service account)
  • Account ID: this is the identifier retrieved from Google Analytics, in the example 64134024)

Load the objects.

google_analytics_connector_config_en_html_e2f0a34d952c9108.png

 

(the screenshot is only indicative and does not necessarily include the data from the previous examples)

google_analytics_connector_config_en_html_469c99f6b2e0fa7.png