Connecting to Google Analytics
Google Analytics (GA) is a service offered by Google that compiles statistics regarding visitors to a website.
This article shows you how to set up a data connector to extract data from your Google Analytics account.
2. Google Analytics account
You must have a Google Analytics account in order to create this data connector in Dundas BI.
To sign up, go to: http://www.google.com/analytics/
3.1. Developers console project
You need to create or use an existing project in the Google Developers Console as a first step.
Go to https://console.developers.google.com/project and sign in to your Google/Gmail account.
Once signed in, you'll see a list of existing projects (if there are any) or you can click Create project to create a new one.
In the New Project dialog, enter a name and location for your project and then click Create.
3.2. Enable the analytics API
Make sure you are logged into the Developers Console and your project is selected as the current project.
Then click the menu button in the top-left corner.
In the left menu, expand APIs & Services and click Library.
Scroll down and click the Google Analytics API tile.
Click Enable to enable the Google Analytics API.
3.3. Service account credentials
This section shows you how to generate Service account credentials which will allow Dundas BI to access your Google Analytics data.
From the left navigation, click Credentials. Click Create credentials and select the Service account key option.
Set the Service account dropdown to New service account. Enter the Name for your service account and then specify a Role. Ensure that the JSON key type is selected.
Click Create to generate and download a certificate file. This file will be needed later to set up a data connector in Dundas BI.
The Service account created dialog is displayed and shows the password for the private key. Copy and paste this password into Notepad for later use.
Close the dialog to see the list of service account keys which includes the one you just created.
Click Manage service accounts in the top-right corner.
Copy and paste the Service account email address into Notepad for later use. You'll need to enter this email address when setting up the data connector in Dundas BI.
3.3.1. P12 file type
If you require the P12 file type instead of the default JSON, you will require some additional information.
Now that the client credentials have been generated, sign in to your Google Analytics account in order to give authorization to these credentials.
Go to the Admin area and click User Management.
In the Add permissions box, paste the Service account email address that you recorded earlier. Then click Add.
4. Dundas BI data connector
From the main menu, click New, and then select Data Connector.
In the New Data Connector dialog, click inside the Name box. Enter a name for your data connector.
Click the Data Provider dropdown and choose Google Analytics.
Click Choose File and select the certificate file.
If the certificate file is of a P12 file type, you have to provide the client credential information that you generated previously:
- Paste the Service Account E-Mail Address that you recorded previously.
- Enter the private key password for the certificate file.
Define the Sampling Level:
- DEFAULT - balances speed and accuracy
- SMALL - smaller sample size, fast
- LARGE - more accurate, slower
Click Test Connection to check the connection to your GA account.
If the test is OK, click the submit button at the bottom to create the data connector and perform data discovery.
5. Displaying Google Analytics data
To see the Google Analytics data, create a new metric set or dashboard.
Go to the Explore window, expand your data connector and its cube, then drag its measures and dimensions to the canvas.