Can I use Service Account with Google Analytics? - google-analytics

Since few day I am trying to get user profile with my C# using Using OAuth 2.0 for Server to Server Applications with JWT.
For google drive i know that we can use server to server method, but i am not sure for Google Analytics. Can we use it ?

Yes you can!
Service Accounts
Useful for automated/offline/scheduled access to Google Analytics data for your own account. For example, to build a live dashboard of your own Google Analytics data and share it with other users.
There are a few steps you need to follow to configure service accounts to work with Google Analytics:
1. Register a project in the APIs Console.
2. In the Google APIs Console, under the API Access pane, create a client ID with the Application Type set to Service Account.
3. Sign-in to Google Analytics and navigate to the Admin section.
4. Select the account for which you want the application to have access to.
5. Add the email address, from the Client ID created in the APIs Console from step #2, as a user of the selected Google Analytics account.
6. Follow the instructions for Service Accounts to access Google Analytics data.
Source: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAuthorization

Not yet. See Service Accounts have arrived.
Service accounts are currently supported by the following Google developer services:
Google Cloud Storage
Google Prediction API
Google URL Shortener
Google OAuth 2.0 Authorization Server
Google APIs Console
Google APIs Client Libraries for Python, Java, and PHP
Over time, more Google APIs and client libraries will be supported.
Sign up for Google Developers Blog and the Analytics Blog feeds. They will post when GA is opened to service accounts, if it ever is.

Related

new Google Identity Services JavaScript library - how can i make authorised requests to google api?

according to google:
The older Google Sign-In platform library:
apis.google.com/js/platform.js, and Google APIs client library for
JavaScript: gapi.client, are no longer required for user
authentication and authorization. They have been replaced by a single
new Google Identity Services JavaScript library:
accounts.google.com/gsi/client.
with the older library you could both authenticate users to your site and you could make authorized requests to google api such as calendar.
there is no information in the docs, as far as i can see, reagrding how to make authenticated requests to google api's such as calendar.
is the new api only replacing the old for apps that only do sign in.
am i missing a way of using the new api to make authenicated requests.
FYI:
On Feb/15/2022, Google announced the availability of Authorization in Google Identify Service SDK:
https://developers.googleblog.com/2022/02/announcing-authorization-support-for.html
here is the docs:
https://developers.google.com/identity/oauth2/web/guides/overview

Google Analytics - Does the Service Account have to be created from the Google profile that hosts the Google Analytics Account?

I am currently using access and refresh tokens to pull data from the Google Analytics Reporting API (v4). As I work to automate the extraction of data from Google Analytics, I hope to shift to using a Service Account. My question is does the Service Account have to be created from the Google profile that hosts the Google Analytics Account?
Anyone can create the service account but in order for the service account to have access to the analytics data you must take the service account email address and add it as a user in the Google analytics admin section at the account level then it will be able to read the data.
So as long as you know someone with admin access to the google analytics account it doesnt matter who creates the service account.

Login for Google Cloud Endpoints portal page without Google account

I have found the tutorial Using Firebase to authenticate users that explains how to authenticate users with Firebase to access different services.
However I haven't found how to enable Firebase login for the whole Google Cloud Endpoints portal page (like for example https://endpointsportal.ourproject.cloud.goog/).
How can I achieve this?
I think the only identity supported today is GCP meaning Cloud Endpoints Portal doesn't support 3rd party sign in. You can use Firebase to authenticate against the API, but not to log into the portal.

Firebase Analytics to Google Analytics, how to retrieve the Client ID?

we are planning to move from the GA SDK to the Firebase SDK. Within the GA SDK there were options to retrieve the google analytics client ID (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid). This was fundamental since we transferred this value to the WebView (within the app), so that the customers tracking across native/webview was possible.
Does anybody know how to retrieve this client ID within firebase analytics SDK (iOS & Android)?
Thanks!
The short answer is no - the client ID equivalent (app instance ID) is not currently accessible through an SDK API.
The longer answer :
Firebase Analytics currently only supports logging events from native code. And so, the js code in your webview would call native code to log events and you don't need access to the app instance ID.

Using Google Drive Realtime API in context of a service account

I've been playing around with the Google Drive API with a view to building a small ASP.NET app which allows online collaboration on simple documents.
I have built a test app which uses a service account to upload and access files in Drive for my Google Apps account. I wanted to use a service account because the idea I'm working with will not be viable if collaborators have to authenticate with Google accounts.
The next step is investigating the Google Drive Realtime API. The tutorial at that link uses a web application client ID and requires that you authenticate your Google account before you can edit the example text file.
Do you know if it's possible to use a service account here so that changes are made in an anonymous context? If so, can you point me at an example because my Google searches aren't helping.
The realtime API does not allow anonymous access. All users must have a Google account.

Resources