Overview

The Google Analytics plugin enables Mitto to pipe data from Google Analytics and store the data in a database.

Steps to Create Google Analytics Jobs in Mitto

Click +Add Job.

Choose Google Analytics.

The Google Analytics plugin uses a credentials JSON file (from a Service Account). See the "Google Analytics Credentials Steps" instructions below for more information about the Service account credentials.

Drop in your JSON file and click Next.

If you've already dropped in the JSON file, you will see the screen below.

Click Next.

Specify the View ID and click Next. See the "Google Analytics Credentials Steps" instructions below for more information about the View ID.

The Mitto Google Analytics plugin allows the user to pick a combination of metrics and dimensions that will create a report from the Google Analytics API.

There are third party tools that can help with this process:

Select the metrics and click Next.

Select the dimensions and click Next.

Fill in the Specify the output form.

  • Title - The title of the resulting Mitto job.
  • Type - The destination database for this table. If using Mitto's PostgreSQL database, leave this as Local Database
  • Schema - The database schema the table will be created in.
  • Table - The database table the job will be creating.

Click Save.

Google Analytics Credentials Steps

Overview

In order to use Mitto's Google Analytics plugin, you need two things from Google Analytics:

  1. A credentials JSON file (from a Service Account)
  2. View ID for the specific View you want to pull data from

Both of these items require Google Analytics admin access. Log in with the correct admin account before performing any of the following steps.

Enable the API

Make sure that the Google Analytics API is enabled.

  1. https://console.developers.google.com/apis/library/analyticsreporting.googleapis.com
  2. Make sure you have the correct Project selected.
  3. Click "Enable"

Create a Service Account

https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount

A service account's credentials include a generated email address that is unique and at least one public/private key pair. If domain-wide delegation is enabled, then a client ID is also part of the service account's credentials.

Steps:

  1. Go to Google's IAM & admin "Service accounts page": https://console.developers.google.com/iam-admin/serviceaccounts
  2. Select the appropriate project
  3. Choose Role: Project → Viewer
  4. Check "Furnish a new private key" with "Key Type" JSON - You will download a JSON file that is needed by Mitto to access the Google Analytics API. This is the only time you will be able to retrieve this file so store it securely.
  5. Copy the "client_email" email address from the JSON file. This is needed at the end to add this service account to the Google Analytics view.


View ID

Overview: https://support.google.com/analytics/answer/1009618

A view is your access point for reports; a defined view of data from a property. You give users access to a view so they can see the reports based on that view's data. A property can contain one or more views.

To find the view id:

  1. Log in to Google Analytics (https://analytics.google.com)
  2. Choose 'Admin' in the lower left-hand corner - There may just be an orange gear icon.
  3. Choose the correct Account, Property, and View combination.
  4. Click 'View Settings' and the 'View ID' should be listed under 'Basic Settings'

Add the Service Account User to the Google Analytics View:

https://support.google.com/analytics/answer/1009702

You can add users at the account, property, or view level. The level at which you add a user determines that user's initial access. For example, if you add a user at the account level, then that user also has access to all the properties and views in the account, with the same set of permissions. If you add a user at the view level, then the user has access to only that view with the permissions you provide. You can change the level of access and permissions for a user at any time.

Steps:

  1. Log in to Google Analytics (https://analytics.google.com)
  2. Choose "Admin" in the lower left-hand corner - There may just be an orange gear icon.
  3. Choose the correct Account, Property, and View combination.
  4. Click "User Management".
  5. Click the Blue + and "Add new users".
  6. Enter the email address created for the Service account (from the JSON file), check "Read and Analyze", and click Add.

Google Analytics and Mitto Best Practices

Test Metrics and Dimensions Combinations Before Creating Your Mitto Jobs

Use a third party tool (Google Analytics Dimensions and Metrics Explorer) to determine the combinations of dimensions and metrics that work for your use case before you go through the Mitto plugin wizard process.

Naming Convention for Mitto Jobs and Database Schemas

Typically users pull data from more than one View ID in their Google Analytics, so naming convention on jobs and output schemas/tables is important. The default database schema is ga, but you should use something like ga_name_of_view_id_1, ga_name_of_view_id_2, etc if you are pulling from multiple GA views.

If you separate GA views into separate schemas, but keep the table names the same (for the same combination of dimensions and metrics), then you can easily start to analyze data across multiple view IDs or GA accounts entirely.