Search code examples
google-analyticsgoogle-oauthgoogle-analytics-apiservice-accountsgoogle-developers-console

Is it possible to create Service account and get p12 key programmatically for google accounts?


I need to extract Google Analytics data through it's API. However I do not want to generate any account and key manually (the reason is I do not want to let this technical this to be performed by any non-techie person) and want to dump that data for analysis purpose.


Solution

  • In order to use any of Googles APIs they need to know who you are. You as a developer are identified by the project you create on Google Developer console. Once the project is created you can create a number of different types of credentials including Service account credentials and Oauth2 Credentials.

    Answer: No there is no way to programmaticlly create service account credentials. Nor is it possible to use the a Google api without first creating a project on Google developer console.

    Note: Google Cloud Resource Manager does exist but is very limited in what it allows you to do.

    If someone else is going to be running your application to access their Google analytics Data you should idealy be using Oauth2 in your application and not a service account.

    Service accounts are designed as way for the developer to grant others access to data owned by the developer in question. They are not really intended for novice users to be creating their own projects on google developer console and generating credentials.