Search results

Connecting Bold BI to Google Analytics 4 data source

The Bold BI dashboard designer supports connecting to Google Analytics 4 web services through the REST API.

Choose Google Analytics 4 data source

To configure the Google Analytics 4 data source, follow the below steps:

  1. Click on the Data Sources button in the configuration panel to add a new data connection.

    Data source icon

  2. Click on CREATE NEW to launch a new connection from the connection panel.

  3. Select the Google Analytics 4 connection in the connection panel.

    Choose data source

NOTE: You can also create a data source from the home page by clicking on the Data Sources menu on the left menu panel and selecting Create Data Source from the data sources page.

Choose data source from server

Authentication with Google Analytics 4

Use the following steps to authenticate with the Google Analytics 4 web service:

  1. Click on the data source, which will prompt a login window. Enter the credentials of your Google Analytics 4 account to authorize.

  2. Click on Allow in the authorization window to accept the scopes requested by Bold BI dashboards.

    NOTE: If permission is denied, the account will not be accessible from the dashboard.

  3. Provide a name to identify the account and click Next.

  4. You have now successfully authorized your connection. Click Connect to continue with the data source connection.

  5. If you want to connect via a previously connected account, refer to the Connected Accounts..

    NOTE: To connect to another account click Connect New Account.

Connect to Google Analytics 4

Create Google Analytics 4 data source

After successful authentication, the NEW DATA SOURCE configuration panel will open. Follow the below steps to create Google Analytics 4 data source.

  1. Enter a name and description (optional) for the data source.

  2. Select the account and property value.

  3. You can choose a specific start date and end date using the date picker controls provided. If you select the launch date option, the initial launch date of Google Analytics 4 will be considered as the start date for the API. If no end date option is chosen, the current date will be used as the end date to pull data up to date during data source creation and refresh.

  4. Choose multiple metrics and dimensions to replace in Raw Body.

  5. Click Custom URL to enter the URL and Raw Body manually. Refer to the Google Analytics 4 API documentation for more details. URL Example:https://analyticsadmin.googleapis.com/v1beta/{entity=properties/*}:runAccessReport

    Raw Body Example: [{"dateRanges":[{"startDate":"2020-11-04","endDate":"2023-05-03"}],"dimensions":[{"name":"deviceCategory"}],"metrics":[{"name":"sessions"}]}]

  6. By default, PUT method for the REST API in the Method combo box.

  7. In Page(s), enter the maximum number of rows fetched from the Google Analytics 4 data source. This value is used to fetch the data from the Google Analytics 4 data source via pagination.

  8. Choose a time interval for the Refresh Settings using the combo box to trigger the Reset API request periodically to keep the data in sync with our dashboard.

  9. Select JSON data type in the Data Format combo box.

  10. The authentication type will be automatically set to Google Analytics 4 since OAuth is used for authenticating with the Google Analytics 4 account.

    Choose data source from server

You can also edit the connection information set here using the Edit Connection option.

Additional information

Accessing API

For API access, ensure you have the Read and Analyze permissions.

Modes

Simple mode : Provides an interface to build a query that retrieves data from the Google Analytics 4 account.

Page(s) Most REST APIs return only fewer data on a single API request. To pull the amount of data you need, set a value in this field. Pagination is handled internally and will fetch the amount of data you need.
Refresh Settings A period will pass before the next refresh call is triggered. This will automatically trigger a call for the API configured in the data source to keep the data up to date. If you do not want to sync your new data, choose ‘Never.’
Dimensions/Metrics Dimension/Metrics may require additional input sometimes

Setting up the URL and Raw Body

  1. The URL is generated automatically once the properties of your account are selected.

    URL Example:https://analyticsdata.googleapis.com/v1beta/<GA4_PropertyID>:runReport

  2. Generate Raw Body for Google Analytics 4 by selecting the required start date, end date, Metrics, and Dimensions from the Bold BI.

    Example: [{“dateRanges”:[{“startDate”:”<:startDate>”,“endDate”:”<:endDate>”}],“dimensions”:[{“name”:”<:dimensions>”}],“metrics”:[{“name”:”<:metrics>”}]}]({"dateRanges":[{"startDate":"2020-11-04","endDate":"2023-05-03"}],"dimensions":[{"name":"eventName"}],"metrics":[{"name":"eventCount"}]})

For more information on the API endpoints available for this data source, refer to their official API Documentation

Sample Raw Body

Event Count by Event Name:

[{“dateRanges”:[{“startDate”:“2020-11-04”,“endDate”:“2023-05-03”}],“dimensions”:[{“name”:“eventName”}],“metrics”:[{“name”:“eventCount”}]}]

Sessions by Device Type:

[{“dateRanges”:[{“startDate”:“2020-11-04”,“endDate”:“2023-05-03”}],“dimensions”:[{“name”:“deviceCategory”}],“metrics”:[{“name”:“sessions”}]}]

Preview and data import

  • Click Preview & Connect to connect with the configurations that have been set.

  • The Choose Schema(s) dialog opens. The schema represents the key fields of JSON data retrieved from the Google Analytics 4 Rest API request. This dialog displays a list of schemas in Treeview and their corresponding values in the grid for preview. Select the required schema(s) from Treeview to use in the designer and click Connect.

    Preview

  • Now, the data design view page with the selected table schema opens. Drag and drop the table. Query Editor

  • Click Save to save the data source with a relevant name.

Connected accounts for OAuth data sources

If you have already logged into the account and authenticated with the web data source, the account information will be listed here. You can select one of the accounts or connect to a new account by clicking the Connect New Account button.

OAuth

You can edit, delete, and re-authorize this account from the Connected Accounts page.

Manage Accounts

NOTE: To obtain the client ID and client secret for the Google-related data sources, Refer to the Google OAuth Documentation.

Data Transformation

Editing a Data Connection

Dashboard Designer Walkthrough

Google Analytics 4 Integration

How to set up OAuth 2.0 authorization to access Google applications in Bold BI