Adding GA4 Connection to AWS AppFlow

amazon-web-servicesgoogle analyticsgoogle-cloud-platform

I am trying to add an AppFlow connection to an existing GA4 account, GA4 is already up and running and even pushing data to BigQuery.

However, when I try to create the connection in Appflow to start a flow from GA4 to Redshift. I get this error message

An error occured while creating the connection ga4.
Error authenticating to connector: Failed to validate Connection while attempting "ValidateCredentials with CustomConnector" with connector failure The request failed because the service Source Google Analytics 4 returned the following error: Details: Google Analytics 4 returned error message - Request failed with Status Code: 403, Error Reason: Forbidden. (Service: null; Status Code: 400; Error Code: Client; Request ID: null; Proxy: null)

Error Message Screenshot

I have followed this documentation. https://docs.aws.amazon.com/appflow/latest/userguide/connectors-google-analytics-4.html

I was able to create a GA UA connection, but it used a slightly different OAuth Configuration.

My GCP App is set to Production and is External, my Google Analytics API is enabled and the OAuth Web Application creds are created, and the Authorized redirect URIs is set to https://us-east-1.console.aws.amazon.com/appflow/oauth as suggested by the documentation.

When I add the clientID and clientSecret to AppFlow's connection and click connect, I get a google login pop up prompt, and when I login in it asks me to allow amazon.com to access my data and pull data etc, which I do allow, then the pop up disappears and the above error pops up in AWS.

GCP OAuth Configuration

Best Answer

I reached out to AWS Support and they told to enable "Google Analytics ADMIN API" in addition to "Google Analytics API". This resolved the issue.

They did mention they are working to update the documentation to mention that both api's need to be enabled.

Related Topic