Connecting to Google Analytics

Google Analytics is a free web analytics service by Google that tracks and reports website traffic.

Data integration: Skyvia supports importing data from Google Analytics to other applications, exporting its data to CSV files, and replicating G Suite data to relational databases.

Backup: Skyvia Backup DOES NOT support Google Analytics backup.

Query: Skyvia Query supports Google Analytics.

Google Analytics-Specific Features and Limitations

Skyvia cannot write data to Google Analytics, these data are read-only.

In Data Integration product, Google Analytics connections are supported only for packages, using new data integration runtime. Make sure you select the Use new runtime check box on the tab bar if you want to use Google Analytics in your package.

Data Structure

Each Google Analytics connection works with data from a single Google Analytics View. You specify the View ID when creating a Google Analytics connection.

Skyvia represents Google Analytics data as a single table CompleteAnalytics with a number of fields, representing Google Analytics measurements and dimensions. Dimensions are attributes of your data, and their values are organized in rows. Metrics are quantitative measurements, and measurement values are organized into columns.

The returned data represents the metrics values, calculated for existing combinations of dimension values. For example, if you query the City dimension and some metrics, like Sessions and PageviewsPerSession, you will get rows for every city, from which there were website visits, with the corresponding metrics values:

City Sessions PageviewsPerSession
San Francisco 5,000 3.74
Berlin 4,000 4.55

If you add another dimension to the query, for example, browser, the results for cities will be split per browsers, and you will have rows for every city and browser combination, for which there were website visits:

City Browser Sessions PageviewsPerSession
San Francisco Chrome 3,000 3.5
San Francisco Firefox 2,000 4.1
Berlin Chrome 2,000 5.5
Berlin Safari 1,000 2.5
Berlin Firefox 1,000 4.7

Because of Google Analytics API limitations, Skyvia can query a limited number of metrics and dimensions in a single request: up to 7 dimensions and up to 10 metrics. Thus, you can select only a limited number of metrics and dimensions in your integration package tasks or queries.

Besides, not all metrics and dimensions are compatible with each other, and can be queried together. You may receive an error in case you query incompatible metrics and dimensions.

Querying Limitations

With Google Analytics, Skyvia is limited by Google Analytics API. Unlike for other sources, Skyvia does not perform complex queries against it locally, and is limited to what Google Analytics API allow. These limitations are applied in all Skyvia products, not just in Query.

Skyvia supports using the following operators for filtering: >,>=,<,<=, =, !=, between, in. You can use multiple filter conditions, united with either and or or logical operators. You cannot use both and and or, and all these operators must be on the same level. If you configure query visually or configure filtering in data integration, don’t add condition groups, except the main one.

However, if you perform filtering by both metrics and dimensions, you cannot use the or operator. You can only use the and operator for uniting conditions on metrics and on dimensions.

Date field is treated specially in filters - you can either use it once with a between condition, or use >/>= and </<= operators once.

Sorting is fully supported for Google Analytics.

Segments Support

Skyvia supports Google Analytics segments via the segment field. You can use it in filters to query data from specific segments. Yo can specify multiple segments in filters in the following way: segment = ['ALL_USERS','NEW_USERS']

Cohorts Support

Cohort is a group of users that has a common characteristic, for example, all users with the same Acquisition Date. Skyvia allows you to get cohort data from Google Analytics via the corresponding metric and dimension fields with names, starting from ‘Cohort_’. Note that if you query cohort data, you need to add a filter by the Cohort_Type field. Usually the filter Cohort_Type = 'FIRST_VISIT_DATE' is used. Some Cohort fields require additional filters.

Replication with Incremental Updates

Skyvia queries changed data from Google Analytics by the Date field. This field stores dates, without time part. Thus, when performing replication with incremental updates, Skyvia only queries updates up to previous day, not today’s updates. It also means that there is no point to schedule replication with incremental updates more often than once per day.

Creating Google Analytics Connections

To create a Google Analytics connection, perform the following steps:

  1. Click +NEW in the top menu.
  2. Open the Select Connector page by clicking Connection in the menu on the left.
  3. In the opened pane, click Google Analytics.
  4. In the Connection Editor page, specify a connection name that will be used to identify the connection.

    Connection Editor window

  5. Click Log In with Google Analytics.
  6. In the opened window enter your G Suite credentials and click Sign in.

    Sign In window

  7. Click the Allow button.
  8. Specify the View ID of your Google Analytics view that you want to work with. See the information on how to find it below.
  9. Optionally, you can click Advanced Settings and specify the Users Start Date. This parameter is used to determine the start date to query the Users metric from. By default, it is set to 08/22/2016. If you want to query user information from earlier dates, you also need to turn off the new calculation method in your Google Analytics. You can find more information on this here.
  10. Click the Create Connection button to create the connection.

Obtaining View ID

To obtain the view ID, perform the following steps:

  1. Sign in to Google Analytics and click Admin.

    Google Analytics

  2. Select the required account, property, and view that you want to connect to.
  3. Click View Settings.

    Google Analytics admin settings

  4. Under Basic Settings copy the View ID.

    Google Analytics view settings