The following steps detail how to obtain a client ID, client secret, and refresh token that can be used for authentication with Google related tools.
- Open https://console.developers.google.com
- Login with the Google account associated with the data you would like to analyze
- Create a new project by clicking the Select a project dropdown (top-right corner) and selecting Create a project...
- Enter a Project name of your choosing and click Create
- From the project Dashboard click Enable and manage APIs
- Select the proper API from the Google APIs list
- For Google Analytics tool
- Analytics API
- For Google Sheets tools
- Drive API
- For Google Analytics tool
- Click on Enable API
- Click on Credentials
- Click on the New Credentials dropdown and select OAuth client ID
- Click on Configure consent screen
- Enter a Product name and click Save
- Select the Web application radio button, add https://developers.google.com/oauthplayground as an Authorized redirect URI, and click Create
- A window will pop-up with your client ID and client secret; save these for future reference and click OK
- Go to https://developers.google.com/oauthplayground
- Click on the gear icon in the top-right corner of the page, click the checkbox for Use your own OAuth credentials, enter the client ID and client secret from step 13, and click close
- Copy/paste the respective scopes into Input your own scopes and click Authorize APIs:
- For Google Analytics tool
- For Google Sheets tools
- Click Allow
- Click Exchange authorization code for tokens and save the Refresh token
- Test the authorization by sending a request for an available operation from List possible operations
- If successful, the client ID, client secret, and refresh token that you obtained in the prior steps can now be used for authentication with the Google related tools.