The CDATA connections in Infoworks allows users to connect to various sources, one such is Google Analytics. Connecting to Google Analytics to fetch the data requires OAuth authentication. The auth mechanism should set in such a way that refresh of access token is done automatically. Please follow below steps for the same. 


  1. Set the jdbc url as


  2. Add the email id of the Google Analytics user as the username. You can find the list of users in the Account User Management section in Google Analytics. Set the password to * .

  3. Obtain the Oauth2 credentials, client id and client secret, from this page. If there are no credentials in OAuth client id section, you can create one using "create credentials".

  4. We now need to obtain the OAuth refresh token. Paste the below URL in the your browser after replacing the client id with your client id

    This URL will be redirected to another URL of this fashion. Save the redirected URL and copy the string which is of the form code=xxxxxxxxxxxxxx till '&scope'

  5. At this point we have code (from step 4), clientid and client secret. Based on these values run the following curl request

    curl --location --request POST '' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-raw 'code=4/0Axxxxxxxxxxxxxxxxxxxxxxxx&'

    This request outputs the a refresh_token in the json response, which should be saved.

  6. We, now, have ClientId, Client Secret and Refresh Token. Set the following connection parameters in the source set up page.

    OAuthClientId: your-client-id-from-step3
    OAuthClientSecret: your-client-secret-from-step3
    InitiateOAuth: GETANDREFRESH
    OAuthRefreshToken: your-refresh-token-from-step5
    Profile: your-profile-id-from-google-analytics-page

    Please see the screenshot below.

    NOTE: one can generate refresh token very easily here

    Application Infoworks versions: 4.2x