Skip to main content

OAuth 2.0 for Google Analytics

This section describes the steps to configure the Cloud Portal to integrate with Google Analytics using OAuth 2.0 to authenticate.

Create OAuth 2.0 Client App for Google Analytics

Enable external user in project

You must enable external access to the project containing your Google Analytics data.


This step configures access through the consent screen for your project. If you have previously completed this step for the project, you can skip this section.


  1. Navigate to the Google Console for your project:

  2. From the left menu, select APIs & Services > OAuth consent screen.

  3. For User Type, select External.

  4. Click Create.

  5. You can provide a logo and name for this client. For example:


    You can use your own logo and product name if preferred.

    1. Right-click the logo in the Cloud Portal and download it to your desktop. Right-click the image and select Save As.... Upload it to the consent screen.

    2. The name of the product can be: .

  6. Do not add Scopes or Test Users.

  7. Save your changes.

Create OAuth 2.0 credentials

You must create a set of credentials to use when accessing your Google project.


  1. From the APIs & Services menu, select Credentials.

  2. At the top of the screen, click +CREATE CREDENTIALS.

  3. Select OAuth client Id.

  4. For Application type, select Web application.

  5. Fill the values for the following settings:




    Provide a descriptive name. Example: Google_Analytics

    Authorized JavaScript origins

    Do not add a value for this setting.

    Authorized Redirect URIs

    Set the value to the following:

  6. Click Create.

  7. Retain the values for ClientId and Client Secret. These values must be applied in the Cloud Portal.

Enable API access

You must enable access to Google Analytics APIs through your project. You can enable one or more of the APIs listed below.


  1. Navigate to listed URL.

  2. Click Enable.

Create OAuth 2.0 Client for Google Analytics

After the Google Analytics app is created, you must create an OAuth 2.0 client in the Cloud Portal, which is used to integrate with the OAuth 2.0 connected app that you created above.


You must create one OAuth 2.0 client in the Cloud Portal for each Google Analytics connected app that you wish to use.


  1. Login to the Cloud Portal as a workspace administrator.

  2. In the lefthand menu, select User menu > Admin console > OAuth2.0 Clients.

  3. In the OAuth2.0 Clients page, click Register OAuth2.0 Client.

  4. Specify the new client. Apply the following values:




    Set to google_analytics.


    Display name for the OAuth 2.0 client in the Cloud Portal.

    Client ID

    Set this value to the Client Id value that you retained from your Google Analytics app.

    Client Secret

    Set this value to the Client Secret value that you retained from your Google Analyticsapp.

    Authorization URL

    Set this value to the following:

    Token URL

    Set this value to the following:


    Please insert the following value:

    Access Token Expires In

    Set this value (in milliseconds) to 3600000 (1 hour).

    Refresh Token Expires In

    Set the value to0(does not expire).

  5. To save your OAuth 2.0 client, clickSave.

For more information, see Create OAuth2 Client.

Create Google Analytics Connection

After you have created the two OAuth 2.0 client references, you can create a connection to your Google Analytics data.


You must create a separate connection for each OAuth 2.0 client that is available in the Cloud Portal.

For more information, see Google Analytics Connections.