Google Analytics
The following are the requirements and connection instructions for using Google Analytics with Amazon AppFlow.
Notes
-
The Google Analytics connector transfers data only from Universal Analytics properties. If you want to transfer data from Google Analytics 4 properties instead, use the Google Analytics 4 connector.
In time, Google Analytics will end support for Universal Analytics properties, and that platform will fully support only Google Analytics 4 properties. For more information, see Introducing the next generation of Analytics, Google Analytics 4 (GA4)
. -
You can use Google Analytics as a source only.
Requirements
You must log in to the Google API Console at https://console.developers.google.com
-
Activate the Analytics API.
-
Create a new app named AppFlow. Set the user type as Internal. Add the scope for read-only access and add
amazon.com
as an authorized domain. -
Create a new OAuth 2.0 client. Set the application type as Web application.
-
Set the authorized JavaScript origins URL to
https://console.aws.amazon.com
. -
Set the authorized redirect URL to
https://
. For example, if you use Amazon AppFlow in the US East (N. Virginia) Region, set the URL toregion
.console.aws.amazon.com/appflow/oauthhttps://us-east-1.console.aws.amazon.com/appflow/oauth
. -
Provide Amazon AppFlow with your client ID and client secret. After you provide them, you are redirected to the Google login page. When prompted, grant Amazon AppFlow permissions to access your Google Analytics account. Note that your Google Analytics user account must also be a Google Workspaces user account.
For more information, see Management
API - Authorization
Connection instructions
To connect to Google Analytics while creating a flow
Sign in to the AWS Management Console and open the Amazon AppFlow console at https://console.aws.amazon.com/appflow/
. -
Choose Create flow.
-
For Flow details, enter a name and description for the flow.
-
(Optional) To use a customer managed key in the AWS Key Management Service (AWS KMS) instead of the default AWS managed KMS key, choose Data encryption, Customize encryption settings and then choose an existing KMS key or create a new one.
-
(Optional) To add a tag, choose Tags, Add tag and then enter the key name and value.
-
Choose Next.
-
Choose Google Analytics from the Source name dropdown list.
-
Choose Connect to open the Connect to Google Analytics dialog box.
-
Under Client ID, enter your client ID.
-
Under Client secret, enter your client secret.
-
Under Secret access key, enter your secret access key.
-
Under Data encryption, enter your AWS KMS key.
-
Under Connection name, specify a name for your connection.
-
Choose Continue.
-
-
You will be redirected to the Google Analytics login page. When prompted, grant Amazon AppFlow permissions to access your Google Analytics account.
Now that you are connected to your Google Analytics account, you can continue with the flow creation steps as described in Creating flows in Amazon AppFlow.
Tip
If you aren’t connected successfully, ensure that you have followed the instructions in the Requirements section.
Notes
-
When you use Google Analytics as a source, you can run schedule-triggered flows at a maximum frequency of one flow run per day.
-
Google Analytics can process 9 dimension and 10 metrics (including custom ones) as part of a single flow run.
-
If you choose Google Analytics, you can only specify JSON as the data format for the Amazon S3 destination file.
-
You can import custom dimensions and metrics from Google Analytics into Amazon S3. To specify custom dimensions or metrics, choose the upload a .csv file with mapped field option in the Map data fields step of the flow configuration. In the source field name in the CSV file, specify the custom dimension or the metric as
ga:dimension
orXX
ga:metric
, withXX
XX
containing the actual index (numerical value) that you provided to Google Analytics.The following is an example row in the CSV file:
ga:dimension24|DIMENSION, PriceDimension
This imports the custom dimension in Google Analytics to a field named
PriceDimension
in the destination Amazon S3 file.Note
The option to specify custom dimensions and metrics is available only when you upload a CSV file with mapped fields, and not when you manually map fields using the console.
Supported destinations
When you create a flow that uses Google Analytics as the data source, you can set the destination to any of the following connectors:
-
Lookout for Metrics
-
Amazon S3
-
Upsolver
You can also set the destination to any custom connectors that you
create with the Amazon AppFlow Custom Connector SDKs for
Python
Related resources
-
Management API - Authorization
in the Google Analytics documentation -
Create a Property
in the Google Analytics documentation -
Analyzing Google Analytics data with Amazon AppFlow and Athena
in the AWS Big Data Blog -
How to transfer data from Google Analytics to Amazon S3 using Amazon AppFlow