Overview
Etlworks can extract data from the Google Analytics Reporting API as well as User Activity API.
Etlworks includes connectors for older Google Universal Analytics and Google Analytics 4.
When to use this connector
Read how to extract data from Google Analytics and load it into any destination.
Create a Google Analytics Connection
To work with Google Analytics, you will need to create a Connection. In the Connections
window, click +
, and type in google analytics
in the Search
field. Select either Google Analytics
to connect to older Google Universal Analytics properties or Google Analytics 4
to connect to GA 4 properties.
Authentication
To connect to a specific Google service, you will either be using the OAuth2 authentication (default) or the authentication with a Google Service Account.
OAuth2 authentication
To connect to the Google service using OAuth2 protocol, you will need to select OAuth2
as an Authentication type
and click Sign in with Google
. Read more about OAuth2 authentication with Google Services.
Authentication using Google Service account
To connect to the Google service using the service account, select the Service Account
as an Authentication type
. Then authorize the service account to access the specific property ID.
Parameters for authenticating with Google Service Account
Service Account Email
: a service account email must be authorized by the web property owner in Google Analytics Admin. Read about Google Service account email. The default isetl-framework@api-project-201080624425.iam.gserviceaccount.com
Service Account
: you can create your own service account in the Google API console, authorize it in Google Analytics Admin, and add it to this Connection. If nothing is entered in this field, the default account linked to the emailetl-framework@api-project-201080624425.iam.gserviceaccount.com
will be used.
Google Analytics Connection parameters
Google Analytics 4
Property ID
: A numeric Google Analytics 4 property identifier. Read more.Realtime
: Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties) and can be used for applications such as live counters of visitors on your website. Realtime reports support a limited subset of dimensions and metrics compared to the Core Reporting functionality of the Data API v1.Dimensions Filter Builder
: The JavaScript code which builds FilterExpression for dimensions. Example:-
importPackage(com.google.analytics.data.v1beta);
value = FilterExpression.newBuilder().setFilter(Filter.newBuilder().
setFieldName('city').
setStringFilter(Filter.StringFilter.newBuilder().
setMatchType(Filter.StringFilter.MatchType.BEGINS_WITH).
setCaseSensitive(false).setValue('pittsburgh')).build()).build();
-
Metrics Filter Builder
: The JavaScript code which builds FilterExpression for metrics. Example:-
importPackage(com.google.analytics.data.v1beta);
value = FilterExpression.newBuilder().setFilter(Filter.newBuilder().
setFieldName('city').
setStringFilter(Filter.StringFilter.newBuilder().
setMatchType(Filter.StringFilter.MatchType.BEGINS_WITH).
setCaseSensitive(false).setValue('pittsburgh')).build()).build();
-
Limit
: The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for. The Limit must be positive.
Universal Analytics
Web property URL
: the web property URL exactly as it is configured in the Google Analytics console. For example,www.etlworks.com
.View ID
: a view ID for the web property. It can be seen in Google Analytics Admin.Web property URL
andView ID
are mutually exclusive.Timeout
: the request timeout in minutes. The default value is3 minutes
. If the request is taking longer than configured or default value it will be automatically aborted.Filter
: thefilters
query string parameter restricts the data returned from the request. Example:qa:browser==Firefox
. Read more about filters. In Etlworks, you should not be URL-encoding filters.
All
Start Date
: start date for the request, formatted asYYYY-MM-DD
, or as a relative date (e.g.,today
,yesterday
, orNdaysAgo
where N is a positive integer).End Date
: end date for the request, formatted asYYYY-MM-DD
, or as a relative date (e.g.,today
,yesterday
, orNdaysAgo
where N is a positive integer).Dimensions
: Google Analytics dimensions to be included in the report. You can include multiple dimensions in the request. Read more about the dimensions here. If a dimension is not on the list, simply type in the dimension name, for example,ga:dimension6
, and clickEnter
.Enter the dimension's name exactly as in the dimensions and metrics explorer, including using the
ga:
prefix and capitalization.Metrix
: Google Analytics metrics to be included in the report. You can include multiple metrics in the request. Read more about the metrics here. If a metric is not on the list, simply type in the metric name, for example,ga:metric7
and clickEnter
.Enter the metric's name exactly as in the dimensions and metrics explorer, including usage of the
ga:
prefix and capitalization.Number of Retries
: the number of retries if the HTTP call was not successful. The maximum allowed number of retries is10
. The default is0
.Delay between retries
: delay in milliseconds between retries if the HTTP call was not successful. The maximum allowed delay is5 minutes
(300000 milliseconds). The default is0
.
Create a Connection to User Activity API
To extract data from User Activity API, you will need to create a Connection. In the Connections
window, click +
, and type in user activity
in the Search
field. Select the Google Analytics User Activity
from the gallery.
This connector supports only Universal Google Analytics properties because the User Activity API is not available [yet] for GA4 properties.
Google User Activity API Connection parameters
This connector shares many parameters with the Google Analytics connector, including Authentication. The selected parameters are unique for this connector.
Web property URL
: the web property URL exactly as it is configured in the Google Analytics console. For example,www.etlworks.com
.View ID
: a view ID for the web property. It can be seen in Google Analytics Admin.Web property URL
andView ID
are mutually exclusive.User ID
: a unique Id of the user for which the data is being requested.User ID Type
: a type of the user in the request. USER_ID - a single user, like a signed-in user account, that may interact with content across one or more devices and/or browser instances. CLIENT_ID - analytics assigned clientId.Start Date
: start date for the request, formatted asYYYY-MM-DD
, or as a relative date (e.g.,today
,yesterday
, orNdaysAgo
where N is a positive integer).End Date
: end date for the request, formatted asYYYY-MM-DD
, or as a relative date (e.g.,today
,yesterday
, orNdaysAgo
where N is a positive integer).Timeout
: the request timeout in minutes. The default value is3 minutes
. If the request is taking longer than configured or default value it will be automatically aborted.Number of Retries
: the number of retries if the HTTP call was not successful. The maximum allowed number of retries is10
. The default is0
.Delay between retries
: delay in milliseconds between retries if the HTTP call was not successful. The maximum allowed delay is5 minutes
(300000 milliseconds). The default is0
.
Comments
0 comments
Please sign in to leave a comment.