Google Analytics Management API - Insert method - invalid accountId HTTP 400 - google-analytics

I am trying to add users to my Google Analytics account through the API but the code yields this error:
invalid accountId: xxxxxx#gmail.com."
Where I got account Id. Isn't It mean for user's Email ?

Account User Links: insert adds a new user to the given account if the user has fewer than 100 accounts.
Go to the admin section of the Google Analytics website.
You will find your account ID under basic Account settings.

Related

Google Analytics Reporting api can't access any GA4 only Universal

When trying to pull GA4 data from the api, it says the user doesn't have permission. I'm having no issues with the UA accounts.
However, my GA4 accounts are both:
tied to the same account as my Universal accounts
the api service email account is also attached to those account.
I'm wondering if perhaps the property id isn't what i use for ga4, as I did for the Univsal code.
Has anyone had this issue?
I have tried using both the property ID, the Stream ID and the Measurement ID with no luck.
user doesn't have permission
means exactly that the user you are authenticating with does not have permission to access the google analytics account you are trying to access.
You need to go into the GA4 account via the admin section on the website and grant it access
Its under property and access management, add the service account in there.

Google Analytics API Service User does not have sufficient permissions for this profile

I am using Google Analytics 4. I have created the json file for the service account, and got the email address. This email was added to my users as Admin in the Account Access Management, yet I am still getting the error that I do not have sufficient permissions for this profile.
Any idea what am I doing wrong please?

How to use google analytics Api without using google account

we are provide saas plugin to our customers, we need to get events for each customer's website without creating seperate GTM container and GA property , All the process will takes place in background.
There should be no login requried ,insted we will send the username and password to Google Aalytics through code(JavaScript).
so we need to use google analytics Api without google sign in
is there a way to do this
we are provide saas plugin to our customers, we need to get events for each customer's website
If you want to connect to the analytics accounts for your customers websites they you need to be authorized to access their private data.
no login requried ,insted we will send the username and password to Google Aalytics through code(JavaScript).
You can not login to anyones google account using login and password that was called client login and google disabled that in 2015. You will need to use Oauth2 request consent and gain authorization to access their private data.
so we need to use google analytics Api without google sign in
Sign in is authentication, the Google analytics api operations on authorization. The user needs to consent and grate you authorization to access their data.
is there a way to do this
No you can not access private user data without the owner of that data authorizing your access to that data.

My application cannot access g suite users Google calendar

I have a web app that manages users' Google Calendar. Recently, I got an "invalid credential" error when retriving calendar list and figured out the user account is a g suite account (because of different domain). However, I still can get the access token as well as refresh token. I also can get open ID information from the account. But just cannot access the calendar. Other accounts ends with gmail.com worked fine.
Did I miss anything in authentication for these g suite users?
Based from this documentation, this error usually occurs if the access token you're using is either expired or invalid.
Here are additional links which might also help:
Error accessing Google Calendar using OAuth2.0. and service account: "Invalid impersonation prn email address."
Invalid credentials: Google API calendar
Google Calendar API 401 "Invalid Credentials"

send google oauth email and password

I'm using oauth to authenticate in google calendar, but i'm trying to send user and password to avoid open the authentication popup.
I'ts like automatic authentication.
Is it possible?
Thanks.
Since you want your application to always create events in a single calendar that is under your control, here is how I would do it:
Create a service account in Google Cloud Console - recent instructions on how to do so can be found here: google oauth2 how to get private key for service account
Share your calendar with that service account: https://support.google.com/calendar/answer/37082?hl=en
Write your code to use the service account credentials (private key downloaded in step 1).
I didn't post any sample code, as I'm not sure what language you are using. The following has some discussion of this use-case in PHP: Access Google calendar events from with service account: { "error" : "access_denied" }. No google apps

Resources