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 Google Analytics 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, which use a new data integration runtime.
Make sure that the Use new runtime checkbox is selected 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. You 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:
- Click +NEW in the top menu.
- Open the Select Connector page by clicking Connection in the menu on the left.
- In the opened pane, select Google Analytics.
-
In the Connection Editor page, specify a connection name that will be used to identify the connection.
- Click Sign In with Google.
-
In the opened window, enter your Google credentials and click Sign in.
- Click the Allow button.
- Specify the View ID of your Google Analytics view that you want to work with. See the information on how to find it below.
- 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.
- Click the Create Connection button to create the connection.
Obtaining View ID
To obtain the view ID, perform the following steps:
-
Sign in to Google Analytics and click Admin.
- Select the required account, property, and view that you want to connect to.
-
Click View Settings.
-
Under Basic Settings copy the View ID.
Supported Actions and Actions Specifics
Google Analytics connector supports the following actions:
- Execute Command in Source and Lookup Data Flow components and in Import and Export tasks in the Advanced mode.
-
Execute Query in Source Data Flow components and in Import and Export tasks in the Advanced mode.
- Lookup in Lookup Data Flow components.
Note that Google Analytics connector allows only obtaining data from Google Analytics, not writing to it.