Access Keys:
Skip to content (Access Key - 0)

Description

The Google Analytics step, which is located under the Input category in Spoon, allows you to access your Google analytics data to generate reports or to populate your data warehouse. It uses the Google Analytics 3.0 API.

Prerequisites

  1. You must have a Google Analytics account, and be an owner of the Analytics account that will be used.
  2. The Google Analytics step requires an API key. The method that we support involves generating a private key, creating a service account, and adding the service account's email as a user on your Google Analytics account.  Here is how to do this.
    1. Go to http://console.developers.google.com and sign in with your credentials.
    2. In the Projects page, click Create Project, then when the New Project dialog appears, provide a project name and click Create.
    3. In the left menu pane, select APIs & Auth, then APIs.   
    4. In the API Library, search for Analytics API.  Select Analytics API from the search results, then click the Enable API button.  
    5. In the left menu pane, click Credentials, then click the Create new Client ID button under the OAuth section.  
    6. In the Create Client ID window, select Service account from the available options, then click Create Client ID.  A message indicating that a new public/private key pair is generated appears.  A JSON file is also downloaded, but you won't need it.  
    7. In the OAuth section, click the Generate new P12 key button, then save the file to a safe location.  Saving the file is important because you can not download it again.  You will also need to reference the path to this file when you fill out the Google Analytics step.
    8. Copy the Service Account's Email Address (<random characters>@developer.gserviceaccount.com).  You will paste it in another field later in these instructions.
    9. Go to http://google.com/analytics and sign in with your credentials.  
    10. Click  the Admin menu option, then click User Management.  
    11. In the Add permissions for field, enter the Service Account's email address you copied previously.  Make sure the user has, at minimum, the Read and Analyze permission.

Google Analytics Connection Settings

Option Description
Application Name
Enter an application name such as "PDI" or leave the default.
OAuth Service Email Your Google Developer Service Account's Email Address (e.g. "<random characters@developer.gserviceaccount.com>").
Key file The path to the P12 private key associated with your OAuth Service account.
Specify tableId directly
Check this option if you want to specify the tableId directly without getting the tableId from the profile.
Get tableId from profile
Select the tableId from your profile.

Query Definition

Option Description
Start Date Specifies the start date associated with the query.  The date must be entered in the following format: YYYY-MM-DD.
End Date Specifies the end date associated with the query. The date must be entered in the following format: YYYY-MM-DD.
Dimensions Specifies the dimension fields for which you want to query.  The Google Analytics API documentation provides you with a list of valid inputs and metrics that can be combined.
Metrics Specifies the metrics fields you want returned.  At least one metric must be provided.
Filters Specifies the filter (described in the Google Analytics API documentation).  Here is an example: 'ga:country==Algeria'.
Sort Specifies a field on which to sort.  Here is an example: 'ga:city'.
Specify a segment for the query Allows you to specify a segment for the query.  A segment is analogous to a database "view."
Use custom segment
Check this option, when you want to specify a custom segment.  A segment is analogous to a database "view."
Use predefined segment
Select from the predefined segments. A segment is analogous to a database "view."

Fields

Click Get Fields to retrieve a list of possible fields based on the query you defined.
Click Preview to preview data based on the defined query.

References

  • Google Analytics Query Explorer: This tool lets you play with the Core Reporting API by building queries to get data from your Google Analytics profiles. You can use these queries in the step.
  • Reference guides for Google Analytics:, Dimensions & Metrics.

This documentation is maintained by the Pentaho community, and members are encouraged to create new pages in the appropriate spaces, or edit existing pages that need to be corrected or updated.

Please do not leave comments on Wiki pages asking for help. They will be deleted. Use the forums instead.

Adaptavist Theme Builder (4.2.0) Powered by Atlassian Confluence 3.3.3, the Enterprise Wiki