Connecting to Google Analytics

Contents[Hide]

1. Overview

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/

Google Analytics account
Google Analytics account

3. Setup

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.

Create a new project
Create a new project

In the New Project dialog, enter a name for your project and then click Create.

Enter the project name
Enter the project name

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.

Click the menu button
Click the menu button

In the left menu, click API Manager.

Click the API Manager
Click the API Manager

Click the Google APIs tab to see the available APIs.

Click the Analytics API link.

API Library
API Library

Click Enable to enable the Analytics API.

Click Enable
Click Enable

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.

In the API Manager, click Credentials in the left navigation. On the right, click Create credentials and select the Service account key option.

Add Service account credentials
Add Service account credentials

Set the Service account dropdown to New service account. Then enter the Name for your service account.

Under Key type, select the P12 option and click Create to generate a certificate file. This file will be needed later to set up a data connector in Dundas BI.

Create a P12 key
Create a P12 key

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.

If you're using Chrome browser, the generated certificate file which has the extension p12 should have already been downloaded to your computer.

P12 key file and password is generated
P12 key file and password is generated

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.

Click Manage service accounts
Click Manage service accounts

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.

Service account email address
Service account email address

3.4. Authorization

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 on the left.

Sign in to Google Analytics and go to User Management screen
Sign in to Google Analytics and go to User Management screen

In the Add permissions for box, paste the Service account email address that you recorded earlier. Then click Add.

Add permissions for the email address
Add permissions for the email address

4. Dundas BI Data Connector

Set up the data connector in Dundas BI as follows.

From the main menu, click New, and then select Data Connector.

In the New Data Connector dialog, click inside the File Name box. Enter a name for your data connector.

Click the Data Provider dropdown and choose Google Analytics.

Next, supply the 3 pieces of client credential information that you generated previously:

  1. Paste the Service Account E-Mail Address that you recorded previously.
  2. Click Choose File and select the certificate file (e.g., from your Downloads folder).
  3. Enter the private key password for the certificate file.

Choose the certificate file
Choose the certificate file

Click Define Structure to define a data connector table that will hold the Google Analytics information you are interested in. Google Analytics provides a lot of data/statistics but you may not need all of it. Using Define Structure allows you to choose specific metrics and dimensions only.

In the Define Data Structure dialog, click Add Table.

Click Add Table
Click Add Table

Select New Table 1 in the TABLES list and scroll down to the TABLE DETAILS section.

Click the Profile box and select your Google Analytics profile from the dropdown menu.

Click the Metrics box and enter a comma-separated list of metrics. The auto-complete dropdown menu shows you the available choices such as ga:users or ga:visits.

Click the Dimensions box and enter a comma-separated list of dimensions such as ga:city or ga:country.

Specify a start and end date.

Choose metrics and dimensions
Choose metrics and dimensions

Available metrics
Available metrics

Click Submit to return to the New Data Connector dialog.

Click Test Connection to check the connection to your GA account.

If the test is OK, click Submit to create the data connector and perform data discovery.

5. Displaying Google Analytics data

To see the Google Analytics data, create a new dashboard, go to the Explore window, expand your data connector, and drag New Table 1 to the dashboard canvas.

Viewing your Google Analytics data
Viewing your Google Analytics data

6. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri