# Google Analytics (v14-09-2016)

Information note **Google Analytics extraction is supported by Stitch**   
This integration is certified by Stitch. For support, contact [Support](https://community.qlik.com/t5/Support/ct-p/qlikSupport).

Information note **Keep up with the latest Google Analytics updates** with the [Google Analytics Integration Changelog](https://help.qlik.com/en-US/stitch/integrations/saas/google-analytics/changelog).

## Google Analytics integration summary

Stitch’s Google Analytics integration replicates data using the [Google Analytics Reporting API v4](https://developers.google.com/analytics/devguides/reporting/core/v4/). Refer to the [Schema](https://help.qlik.com/en-US/stitch/integrations/saas/google-analytics/v14-09-2016#schema) section for details about the data Stitch will replicate.

**Note**: A single Google Analytics integration is limited to 10 Metrics and 7 Dimensions. This is due to limits enforced by Google. Refer to [Google’s documentation](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#metrics) for more info.

## Google Analytics feature snapshot

A high-level look at Stitch's Google Analytics (v14-09-2016) integration, including release status, useful links, and the features supported in Stitch.

| **STITCH** |  |  |  |
| --- | --- | --- | --- |
| **[Release status](https://help.qlik.com/en-US/stitch/integrations/identify-an-integration-version)** | Deprecated on March 30, 2020 | **Supported by**<br><br>the Info icon<br><br>Indicates if the integration is supported by Stitch or the Singer community. | [Stitch](https://community.qlik.com/t5/Support/ct-p/qlikSupport) |
| **Stitch plan**<br><br>the Info icon<br><br>The type of Stitch plan required to use the integration. | Standard | **[API availability](https://help.qlik.com/en-US/stitch/developers/stitch-connect/guides/source-destination-reference)**<br><br>the Info icon<br><br>Indicates if the integration is available as a source in Stitch Connect. | the Remove icon<br><br>This version of the integration isn't available via the API.<br><br><br>Not available |
| **Singer GitHub repository** | Not applicable |  |  |
| **REPLICATION SETTINGS** |  |  |  |
| **[Anchor Scheduling](https://help.qlik.com/en-US/stitch/replication/replication-scheduling/anchor-scheduling)**<br><br>the Info icon<br><br>A type of replication scheduling where an integration's Replication Frequency is anchored to a time you select. | the Remove icon<br><br>Anchor Scheduling is not supported for this integration. The only available replication scheduling method is the Replication Frequency setting.<br><br><br>Unsupported | **[Advanced Scheduling](https://help.qlik.com/en-US/stitch/replication/replication-scheduling/advanced-scheduling)**<br><br>the Info icon<br><br>A type of replication scheduling that allows you to specify granular start times for data extraction using cron expressions. | the Remove icon<br><br>Advanced Scheduling is not supported for this integration.<br><br><br>Unsupported |
| **Table-level reset**<br><br>the Info icon<br><br>Indicates if data can be reset at the table level. If unsupported, data can only be reset at the integration level. | the Remove icon<br><br>Table-level resets are not supported for this integration. Resets are only supported at the integration level.<br><br><br>Unsupported | **[Configurable Replication Methods](https://help.qlik.com/en-US/stitch/replication/replication-methods)**<br><br>the Info icon<br><br>Indicates if Replication Methods can be defined by you for tables in the integration. | the Remove icon<br><br>Configurable Replication Methods are not supported for this integration. Stitch will use pre-defined replication methods for tables you set to replicate.<br><br><br>Unsupported |
| **DATA SELECTION** |  |  |  |
| **Table selection**<br><br>the Info icon<br><br>The ability to select individual tables for replication in the Stitch interface. If table selection is unavailable, all tables and all the columns they contain will be set to replicate by default. | the Remove icon<br><br>Table selection is not supported for this integration. All available table and fields will be automatically selected for replication.<br><br><br>Unsupported | **Column selection**<br><br>the Info icon<br><br>The ability to select individual columns for replication in the Stitch interface. If column selection is unavailable, all columns will be set to replicate by default. | the Remove icon<br><br>Column selection is not supported for this integration. All available columns in tables set to replicate will be selected.<br><br><br>Unsupported |
| **Select all**<br><br>the Info icon<br><br>Indicates if the integration supports selecting all available tables and columns. | the Remove icon<br><br>As this integration doesn't support table or column selection, all available tables and columns are automatically replicated.<br><br><br>Unsupported |  |  |
| **TRANSPARENCY** |  |  |  |
| **[Extraction Logs](https://help.qlik.com/en-US/stitch/replication/extractions/integration-extraction-logs)**<br><br>the Info icon<br><br>Logs detailing the Extraction phase of the replication process for a given integration. Includes error info, should an error occur. | the Remove icon<br><br>This feature is not supported for this version of the integration.<br><br><br>Unsupported | **[Loading Reports](https://help.qlik.com/en-US/stitch/replication/integration-loading-reports)**<br><br>the Info icon<br><br>Reports detailing the Loading phase of the replication process for a given integration. Includes the number of rows loaded for each table and error info, should an error occur. | the Success icon<br><br>This feature is supported for this version of the integration.<br><br><br>Supported |

## Connecting Google Analytics

### Google Analytics setup requirements

To set up Google Analytics in Stitch, you need:

* **At least Read & Analyze permissions in the account you want to connect to Stitch**. [See Google’s documentation for more info](https://support.google.com/analytics/answer/2884495?hl=en).

* **To have recent data in the account you want to connect to Stitch.** Verify that there is data from the past 30 days in the account before continuing.

* **To pause all ad-blocking software**. Because Google authentication uses pop ups, you may encounter issues if ad blockers aren’t disabled during the setup.

### Step 1: Add Google Analytics as a Stitch data source

1. [Sign into your Stitch account](https://app.stitchdata.com/).

2. On the Stitch Dashboard page, click the **Add Integration** button.

3. Click the **Google Analytics** icon.

4. Enter a name for the integration. This is the name that will display on the Stitch Dashboard for the integration; it’ll also be used to create the schema in your destination.

   For example, the name “Stitch Google Analytics” would create a schema called `stitch_google_analytics` in the destination. **Note**: Schema names cannot be changed after you save the integration.

### Step 2: Define the historical replication start date

The Sync Historical Data setting defines the starting date for your Google Analytics integration. This means that data **equal to or newer than this date** will be replicated to your data warehouse.

Change this setting if you want to replicate data beyond Google Analytics’s default setting of **30 days**. For a detailed look at historical replication jobs, check out the [Syncing Historical SaaS Data](https://help.qlik.com/en-US/stitch/replication/syncing-historical-saas-data-resetting-replication-keys) guide.

### Step 3: Create a replication schedule

Information note Replication schedules affect the time Extraction begins, not the time to data loaded. Refer to the [Replication Scheduling](https://help.qlik.com/en-US/stitch/replication/replication-scheduling) documentation for more information.

In the **Replication Frequency** section, you’ll create the integration’s [replication schedule](https://help.qlik.com/en-US/stitch/replication/replication-scheduling). An integration’s replication schedule determines how often Stitch runs a replication job, and the time that job begins.

Google Analytics integrations support the following replication scheduling methods:

* [Replication Frequency](https://help.qlik.com/en-US/stitch/replication/replication-scheduling/replication-frequency)

To keep your row usage low, consider setting the integration to replicate less frequently. See the [Understanding and Reducing Your Row Usage guide](https://help.qlik.com/en-US/stitch/getting-started/understanding-stitch-usage) for tips on reducing your usage.

### Step 4: Authorize Stitch and select a Google Analytics profile

1. Next, you’ll be prompted to log into your Google account and to approve Stitch’s access to your Google Analytics data. **Note that we will only ever read your data.**

2. Click **Allow** to continue.

3. After your credentials are validated, you’ll be prompted to select the Google Analytics profile you want to connect to Stitch:

   ![Selecting a Google Analytics profile.](https://help.qlik.com/en-US/stitch/images/integrations/ga-select-profiles.png)Selecting a Google Analytics profile.Selecting a Google Analytics profile.

   **Remember:** Profiles need to have Read & Analyze permissions to be detected by Stitch. If you don’t see the profile you want in this list, we recommend that you double-check the permission settings.

4. When finished, click **Continue.**

### Step 5: Select metrics and dimensions

Information note

Before you get started, note the following:

1. **Metric/Dimension combos that adhere to Google’s compatibility rules can be saved.** Stitch will display a notification if a conflict is found while adding Metrics and Dimensions. Integrations with incompatible Metric/Dimension combos can’t be saved.

   We recommend creating additional Google Analytics integrations for different reports if you run into compatibility issues.

2. **Metric/Dimension combos can’t be changed after the integration is saved.** The Primary Key Stitch creates for Google Analytics integration tables is a composite key composed of the Dimensions selected during setup. Adding or removing Dimensions will change the Primary Key, potentially leading to issues with identifying new data for replication or de-duping data.

3. **Google limits the number of Metrics and Dimensions you can select.** You can select up to 10 Metrics and seven Dimensions per integration. Refer to [Google’s documentation](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#metrics) for more info on these limits.

4. **Segments and Filters aren’t currently supported.** If you’re interested in us adding these features, please get in touch with us.

5. **Lifetime value and cohort metrics aren’t currently supported**. If you’re interested in us adding these features, get in touch with us.

After you grant Stitch access to your Google Analytics profile, you can select the specific Metrics and Dimensions you want to replicate to your destination.

1. In the Metrics and Dimensions fields, you can search or use the drop-down to explore your options:

   ![Selecting Metrics & Dimensions.](https://help.qlik.com/en-US/stitch/images/integrations/ga-add-metrics.gif)Selecting Metrics & Dimensions.Selecting Metrics & Dimensions.

2. Click the Metric or Dimension in the menu to add it to the configuration.

3. **To add a Custom Metric or Dimension,** type out the name exactly in its entirety. If you try to search for it and add a Metric/Dimension that looks like this - `ga:customMetricXX` - you’ll run into issues.

   For example: let’s say you want to add `custom metric 10` to the configuration. To add it, you would type `ga:metric10` in the Choose Metrics field like this:

   ![Adding a custom metric.](https://help.qlik.com/en-US/stitch/images/integrations/ga-add-custom-metric.gif)Adding a custom metric.Adding a custom metric.

   Information note **Tip:** **Not sure what the name of a custom Metric or Dimension is**? Sign into your Google Analytics Dashboard and open the Custom Metrics or Dimensions page (**Admin &gt; Property Column &gt; Custom Definitions &gt; Custom Metric/Dimension**).   
     
   In the row for the Metric or Dimension, take the number in the **Index** column and append it to either `ga:metric` or `ga:dimension`. For example: if the index for a custom Dimension is `1`, the name would be `ga:dimension1`

   1. As you add Metrics and Dimensions, Stitch will check for compatibility. If there are any conflicts, you’ll need to resolve them before you can save the integration. Use [Google’s Dimensions & Metrics Explorer](https://developers.google.com/analytics/devguides/reporting/core/dimsmets) as a guide when selecting Metrics and Dimensions.

   2. **Review your selections**. Remember: once saved, Metrics and Dimensions can’t be added or removed.

   3. When you’re finished, click **Save Integration**.

### Initial and historical replication jobs

After you finish setting up Google Analytics, its **Sync Status** may show as **Pending** on either the Stitch Dashboard or in the Integration Details page.

For a new integration, a **Pending** status indicates that Stitch is in the process of scheduling the initial replication job for the integration. **This may take some time to complete.**

Information note

**Initial replication jobs with Anchor Scheduling**

If using Anchor Scheduling, an initial replication job may not kick off immediately. This depends on the selected Replication Frequency and Anchor Time. Refer to the [Anchor Scheduling](https://help.qlik.com/en-US/stitch/replication/replication-scheduling#job-scheduling-and-anchor-times) documentation for more information.

#### Free historical data loads

The first seven days of replication, beginning when data is first replicated, are free. Rows replicated from the new integration during this time won’t count towards your quota. Stitch offers this as a way of testing new integrations, measuring usage, and ensuring historical data volumes don’t quickly consume your quota.

Information note **Replication will continue after the seven days are over**. If you’re no longer interested in this source, be sure to **pause** or **delete** the integration to prevent unwanted usage.

## Google Analytics replication

Every time Stitch runs a replication job for Google Analytics, the last 15 days’ worth of data will be replicated.

This is applicable to all tables in the integration.

Stitch replicates data in this way to account for updates made to existing records within the default attribution window of 15 days, thus ensuring you won’t make decisions based on stale (or false) data. **As a result, you may see a higher number of replicated rows than what’s being generated in Google Analytics**.

Setting the Replication Frequency to a higher frequency - like 30 minutes - can result in re-replicating recent data and contribute to greater row usage. Selecting a lower frequency can help keep your row count low.

## Google Analytics table reference

Information note

**Schemas and versioning**

Schemas and naming conventions can change from version to version, so we recommend verifying your integration’s version before continuing.

The schema and info displayed below is for **version 14-09-2016** of this integration.

Information note

**Table and column names in your destination**

Depending on your destination, table and column names may not appear as they are outlined below.

For example: Object names are lowercased in Redshift (`CusTomERs` &gt; `customers`), while case is maintained in PostgreSQL destinations (`CusTomERs` &gt; `CusTomERs`). Refer to the [Loading Guide](https://help.qlik.com/en-US/stitch/replication/loading/destination-guides) for your destination for more info.

### sample\_report

The `sample_report` table will contain the [Metrics and Dimensions selected during integration setup](https://help.qlik.com/en-US/stitch/integrations/saas/google-analytics/v14-09-2016#schema).

### Data pagination

Google Analytics data is paginated on a daily basis. This means that a single row in this table pertains to a specific day. Use the `start_date` and `end_date` columns to identify what day the row is for.

### Primary keys

The Primary Key for this table is a composite key made up of all **Dimension columns** and the `start_date` and `end_date` columns.

For example: If `referralPath` and `country` were Dimension columns in the table, both columns, along with `start_date` and `end_date` would make up the Primary Key for the table.

| **Replication Method [](https://help.qlik.com/en-US/stitch/replication/replication-methods)[the Info icon](https://help.qlik.com/en-US/stitch/replication/replication-methods)[](https://help.qlik.com/en-US/stitch/replication/replication-methods)** | Key-based Incremental |
| --- | --- |
| **Primary Keys ![](https://help.qlik.com/en-US/stitch/images/replication/primary-key-icon.svg)** | start\_date<br><br>end\_date |
| **Replication Key ![](https://help.qlik.com/en-US/stitch/images/replication/replication-key-icon.svg)** | start\_date |

sample\_report table schema

| **end\_date**<br><br><br>DATE-TIME |
| --- |
| **start\_date**<br><br><br>DATE-TIME |