Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Alteryx Server running GA4

Mark_Lurie
8 - Asteroid

Has anyone successfully connected Alteryx Server to GA4?

 

When I try to run the GA4 tool locally (running from my Server instance of Designer), I get the following error on the tool:

 

{"error":"invalid_grant","error_description":"Bad Request"}

 

Running it:

Error: Google Analytics 4 Input (1): Issue in Authentication
Error: Google Analytics 4 Input (1): Issue in Getting Report Data
Error: Google Analytics 4 Input (1): <class 'AttributeError'>: 'NoneType' object has no attribute 'get'

 

My team member can run it locally and it runs fine:


Info: Designer x64: The Designer x64 reported: Running at a Low Priority.
Info: Designer x64: The Designer x64 reported: Allocating requested memory would be more than available physical memory. Reverting to 944.7 MB of memory.
Info: Designer x64: The Designer x64 reported: This is AMP Engine; running 4 worker threads; memory limit 944.7 MB.
Info: Google Analytics 4 Input (16): GoogleAnalytics4Input tool started.
Info: Google Analytics 4 Input (20): GoogleAnalytics4Input tool started.
Info: Google Analytics 4 Input (12): GoogleAnalytics4Input tool started.
Info: Google Analytics 4 Input (18): GoogleAnalytics4Input tool started.
Info: Google Analytics 4 Input (18): Plugin class successfully loaded.
Info: Google Analytics 4 Input (20): Plugin class successfully loaded.
Info: Google Analytics 4 Input (12): Plugin class successfully loaded.
Info: Google Analytics 4 Input (16): Plugin class successfully loaded.
Info: Google Analytics 4 Input (18): GoogleAnalytics4Input tool done.
Info: Google Analytics 4 Input (20): GoogleAnalytics4Input tool done.
Info: Google Analytics 4 Input (12): GoogleAnalytics4Input tool done.
Info: Google Analytics 4 Input (16): GoogleAnalytics4Input tool done.

4 REPLIES 4
jessarthur
7 - Meteor

was this ever resolved? Seeing something similar in my environment and curious if the fix is simply using a custom app instead of "sign in via browser" option.

apathetichell
20 - Arcturus

I have never done this but I am fairly confident that I could get this to work.

 

1) --- @jessarthur --- for Server based workflows you cannot auth via browser - you must auth via service account key --- or native GCP Service Account identity. If you are doing the later - you must generate the equivalent of a service account key via GCP (like the GCP token service). This will require scripting via run command which you must create/run.

 

2) --- follow this instructions -> https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart#rest --- follow the part on how to auth via rest. If you are not using a VM with a native GCP identity/service account - ask chat gpt how to run

 $(gcloud auth application-default print-access-token) with a GCP service account key - in either python or GCP CLI.

 that will create your bearer token.

jessarthur
7 - Meteor

appreciate your reply. I'm not sure that's what I'm looking for. To add more context, we're able to log into the GA4 tool (authenticate) using DCM via client id and client secret from custom app. We can see properties, dimensions, and metrics in the configuration window to pull data. However, when hitting run, we get the errors shown in OP's screenshot.

apathetichell
20 - Arcturus

@jessarthur--- you are on Designer - not Server - correct?  I'd be interested if this worked if you followed  the user part of the quickstart --- can you confirm that you have followed these instructions?

https://support.google.com/analytics/answer/9305788#zippy=%2Cin-this-article

 

IE that the users who are granted access via the Oauth browser flow have access to whatever they need in GA4?

 

My hunch is it's either:

1) user permissioning - user does not have the permission to do X/Y.

2) client permissioning - oauth scope provided to the custom client in GCP is not sufficient for what it's trying to do. Double check that the correct permissions are granted.

3) users are clicking the consent screen but box which grants specific consent is not checked.