0

Cant establish persistent API connection to GA4 from Make (formerly Integromat). I use an HTTP OAuth 2.0 connection

I've enabled the Google Analytics Data API v1 In GCS I've created a project, Enabled the above mentioned API with authorized domains integromat.com and make.com and also created an OAuth 2.0 app. The scopes I added was:

I created credentials for a web app with the Authorized redirect URI’s of

The connection works but only for a short period (I assume the token expires). To try and mitigate this I created a service account. That does not work as I cant find a way to add an authorised URI to a service account. This is the Make error:

Error 400: redirect_uri_mismatch You can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy.

If you’re the app developer, register the redirect URI in the Google Cloud Console.

Request details: redirect_uri=https://www.integromat.com/oauth/cb/oauth2

Any ideas please? I’m truly stuck

1
  • Please edit your question and include your code. Commented Jan 28, 2023 at 15:45

1 Answer 1

0

Your question lacks a bit of information as to what it is exactly you are trying to do. However there is enough here that I can help you clear up a few issues or miss understandings.

Oauth2

Oauth2 allows your application to prompt a user to request permission to access their data. The authorizaton server returns to you an access token, this access token is good for only an hour and then it will expire.

If you are using a server sided programming language then you can request offline access, at which point the authorizaiotn server will return to you an access token and a refresh token. The refresh token can then be used by you when needed to request a new access token.

service accounts.

Service accounts can be used if you are only accessing private data that you the developer own. You can create a service account, then go in the admin section of the google analytics website and add the service account as a user it will then have access to that account. There will be no need to request consent of a user to access the data it will just work. Note: service accounts only work with server sided programming languages.

redirect uri issue.

The redirect uri must exactly match the web page that your application is sending. In this case the error messages says you are missing https://www.integromat.com/oauth/cb/oauth2 you should add that.

Google OAuth2: How the fix redirect_uri_mismatch error. Part 2 server sided web applications.

Sign up to request clarification or add additional context in comments.

1 Comment

I have to get offline access, & would therefore require a refresh token which I would store to use again and again, as the normal token expires within 1 hour. Ive not been able to set that up correctly, any assistance would be greatly appreciated. I will use the HTTP method via Integromat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.