Connect to Google Analytics

In Oracle Analytics, you can connect to a Google Analytics data source and analyze Google Analytics data. For example, you might analyze the number of hits to website landing pages over time.

Before you start, set up a Google Analytics application. See the Google documentation. To analyze historical data, obtain a JSON file from your Google Analytics V4 environment that specifies the custom tables to analyze. See Specifying Google Analytics Custom Tables in a JSON File.
  1. Ask your Oracle Analytics administrator to allow connections to Google.
    Your Oracle Analytics administrator must register the following domains as safe:
    api.google.com
    *.google.com
  2. On the Oracle Analytics Home page, click Create, then click Connection.
  3. Click Google Drive or Google Analytics to display the Create Connection dialog.
  4. Enter a Connection Name and optional Description.
  5. Copy the URL displayed in the Redirect URL field.
  6. In the Google application, on the Credentials page, paste the Redirect URL value into the Google "Authorized redirect URIs" field, then click Add.
  7. In Google, on the Credentials page copy the "Client secret" value and the "Client ID" value.
  8. In Oracle Analytics, paste the Google "Client secret" value into the Client Secret field.
  9. In Oracle Analytics, paste the Google "Client ID" into the Client ID field.
  10. In the Google application, copy the "Account ID" from the Account details and copy the "Property ID" from the Property details.
    In the Google administration settings, navigate to Account, then Account details to obtain the "Account ID", and navigate to Property details to obtain the "Property ID".
  11. In Oracle Analytics, use the "Account ID" and "Property ID" that you copied in the previous step to specify the Account ID value and the Property ID value.
  12. Optional: If you want to analyze historical data from Google Analytics, click Import File, and select a JSON file that specifies the Google Analytics V4 custom tables to analyze.
  13. Click Authorize if you're creating a connection or Re-Authorize if you're updating a connection.
  14. In the Google prompt to authorize the connection, click Allow.
    The Create Connection dialog refreshes and displays the name of the Google account, and its associated email account.
  15. Click Save.
  16. Use the connection to connect to your data. For example, from the Home page, click Create, then click Dataset, then select the connection that you just created.

Specifying Google Analytics Custom Tables in a JSON File

In Oracle Analytics, you can specify custom tables to analyze historical web-usage data from Google Analytics and generate reports that are similar to Google Analytics reports. For example, you might analyze the number of hits to landing pages over time.

This example Oracle Analytics report visualizes the number of hits to website landing pages over time.
Description of google-analytics-report.png follows
Description of the illustration google-analytics-report.png

Before you connect to Google Analytics, you need a JSON file that specifies the Google Analytics historical tables to analyze. You can obtain a ready-made JSON file from the Google Analytics V4 website, in the Dimensions & Metrics Explorer area under Demos & Tools.

Example JSON File With Historical Tables for Website Landing Pages

{"LandingPage":["_landingPage", "_dateHourMinute", "averageSessionDuration", "keyEvents", "newUsers", "sessions", "totalRevenue", "totalUsers"]}

Changing the Default Date Range

By default, data from the last 30 days is retrieved for analysis. Append a dateRanges tag to specify a different time range. For example, to retrieve data from the last 100 days specify "dateRanges":[{ "startDate":"100daysAgo", "endDate":"today"}

{"User":["_audienceName", "_deviceCategory", "_yearMonth", "_country", "_userAgeBracket", "firstTimePurchaserRate", "activeUsers", "active1DayUsers", "active28DayUsers", "active7DayUsers", "engagedSessions"],
"dateRanges":[{ "startDate":"100daysAgo", "endDate":"today"}]}

Locating Custom Tables When You Create a Dataset

When you create a connection to Google Analytics, use the Import File option under Add Custom Tables to specify the Google Analytics historical tables to analyze.

When you create a dataset based on a Google Analytics connection created with historical tables, navigate to the GOOGLEANALYTICSV4 schema.
Description of google-analytics-schemas.png follows
Description of the illustration google-analytics-schemas.png

Then scroll down to locate the historical tables.
Description of google-analytics-custom-tables.png follows
Description of the illustration google-analytics-custom-tables.png