You need the following information before you begin.

  • The client ID and client secret for the client application
  • The scope or scopes that define permissions for the client application

The Configuration Manager uses the authorization code grant to obtain access and refresh tokens from Google Cloud. The following steps describe how you can use the Configuration Manager to obtain access and refresh tokens. In addition, the Configuration Manager produces a connection URL that you can use in your application.

Note: You must allow popups in your browser to obtain access and refresh tokens with the Configuration Manager.
  1. .

    For detailed information on launching the Configuration Manager, see "Configuring data sources with the Configuration Manager."

    • Enter a connection string you provide by clicking the Edit button (); then, pasting your string into the Connection String field. If you prefer, you can also type a string directly into this field.
    • Enter values of the connection options you want to configure into the corresponding fields. The Google Analytics 4 Configuration Manager will generate a data source and connection string based on the values you specify.
  2. Enter values for the required connection options on the Connection tab.
    • Client ID
    • Client Secret
    • Scope

      The following scopes are the default scopes used by the driver.

      • View and download data:
        • https://www.googleapis.com/auth/analytics
        • https://www.googleapis.com/auth/analytics.readonly
      • View user permissions:

        https://www.googleapis.com/auth/analytics.manage.users.readonly

  3. Enter any additional values under the Connection tab, or other tabs, as desired.
  4. Retrieve access and refresh tokens.
    1. Click Fetch OAuth Token.
    2. If prompted, enter Google credentials.
    3. Provide consent to allow the Configuration Manager to retrieve the tokens.
    4. The Access Token and Refresh Token fields populate with values retrieved from Google Cloud.
  5. Click Test Connect to verify connectivity and run SQL queries against the service.

Results:

The Access Token and Refresh Token fields contain access and refresh tokens. You can use these tokens to configure the driver and access Google Analytics resources.

The connection string in the Connection String field may be copied and used in your ODBC application to access Google Analytics resources.

Note: Not all the values in the resulting connection string may be required. However, they may be used in your ODBC application. The driver ignores any values that are not required.