Google Analytics - Amazon AppFlow

Google Analytics

The following are the requirements and connection instructions for using Google Analytics with Amazon AppFlow.

Note

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 and do the following:

  • 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 as follows:

    • https://console.aws.amazon.com/appflow/oauth for the us-east-1 Region

    • https://region.console.aws.amazon.com/appflow/oauth for all other Regions

  • 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.

For more information, see Management API - Authorization in the Google Analytics documentation.

Connection instructions

To connect to Google Analytics while creating a flow

  1. Open the Amazon AppFlow console at https://console.aws.amazon.com/appflow/.

  2. Choose Create flow.

  3. For Flow details, enter a name and description for the flow.

  4. (Optional) To use a customer managed CMK instead of the default AWS managed CMK, choose Data encryption, Customize encryption settings and then choose an existing CMK or create a new one.

  5. (Optional) To add a tag, choose Tags, Add tag and then enter the key name and value.

  6. Choose Next.

  7. Choose Google Analytics from the Source name dropdown list.

  8. Choose Connect to open the Connect to Google Analytics dialog box.

    1. Under Client ID, enter your client ID.

    2. Under Client secret, enter your client secret.

    3. Under Secret access key, enter your secret access key.

    4. Under Data encryption, enter your AWS KMS key.

    5. Under Connection name, specify a name for your connection.

    6. Choose Continue.

  9. 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 Getting started with 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:dimensionXX or ga:metricXX, with 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.

  • Google Analytics 4 properties are not yet supported. When you create a property in Google Analytics, you must select Create both a Google Analytics 4 and a Universal Analytics Property or Create a Universal Analytics Property only, as shown in the following screenshot. For more information, see Create a Property in the Google Analytics documentation.

    
                            Universal Analytics property setup in Google Analytics

Related resources