Connect Google Analytics with Bold Data Hub
The Bold Data Hub Google Analytics connector loads web analytics data from Google Analytics into Bold Reports®. Google Analytics tracks user engagement with your website or application. You can authenticate with OAuth or with a service account.
Service Account Credential
Service account credentials for the Bold Data Hub Google Analytics connector are more suitable for server-to-server interactions.
Grab Google Service Account Credentials
You get Google service account credentials for Bold Data Hub from the Google Cloud console of your GCP account.
-
Sign in to https://console.cloud.google.com.

-
Create a service account if necessary.
-
Enable the Google Analytics API (refer to Google documentation for detailed instructions).
-
Generate credentials:
- Navigate to IAM & Admin in the console’s left panel, and then select Service Accounts.
- Find the service account you want to use and click the three-dot menu under the Actions column.
- Create a new JSON key by selecting Manage Keys > ADD KEY > CREATE.
- Download the “.json” file containing the necessary credentials for future use.
How do I share the Google Analytics property with the API?
You share the Google Analytics property by adding the service account or OAuth email as a user with at least viewer privileges. Bold Data Hub can then read the property.
Note: For service account authentication, use the
client_email.
- Log into your Google Analytics account.
- Choose the website property you wish to share.
- In the lower-left corner, click the Admin tab.
- In the Account column, go to Account Access Management.
- Click the blue + icon in the top right corner of the screen.
- Choose Add users and enter the email from the service account or OAuth authentication methods. Make sure to grant at least viewer privileges.
- Click Add in the top right corner to complete the process.
Connection Properties
The Google Analytics connector in Bold Data Hub reads the following properties from the config section of a YAML file:
Connectorname: Google_analytics
project_id: ID of the project
client_email: Email of the client
private_key: Private keyExample Configuration
The following Bold Data Hub YAML template shows a complete Google Analytics extractor configuration:
version: 1.0.1
encrypt_credentials: false
plugins:
extractors:
- name: Google_analytics_data
connectorname: Google Analytics
config:
project_id: <PROJECT ID>
client_email: <CLIENT EMAIL>
private_key: <PRIVATE KEY>
properties:
property_id: <PROPERTY ID>
query:
- resource_name: sample_analytics_data1
dimensions: ["browser", "city"]
metrics: ["totalUsers", "transactions"]
- resource_name: sample_analytics_data2
dimensions: ["browser", "city", "dateHour"]
metrics: ["totalUsers"]
start_date: <START DATE>How do I connect Google Analytics in Bold Data Hub?
You connect Google Analytics in Bold Data Hub with either OAuth authentication or service authentication.
OAuth Authentication with Google Analytics
OAuth authentication with Google Analytics in Bold Data Hub uses your client ID and client secret.
-
Double-click the connector. An Authentication Setup window opens.

-
Enter the Client ID and Client Secret and click Ok.

-
Click Allow in the authorization window to accept the scopes requested by Bold DataHub.
-
Update the project ID, client ID, and client secret in the template, and update the resources in the
propertiesproperty. -
Click Save and choose the destination to save the pipeline.

Creating a pipeline in Bold Data Hub automatically creates a data source in Bold Reports®. The Bold Reports® data source is a live data source to the destination database used in Bold Data Hub.

Service Authentication with Google Analytics
Service authentication with Google Analytics in Bold Data Hub uses the client email and private key from your service account.
-
Click the
Bold Data Hubicon on the Navigation Pane.
-
Click
Add Projectand enter a name for the new project.
-
Select the newly created project and add the
Google Analyticstemplate.
-
Update the project ID, client email, and private key secret in the template. Also, update the resources in the
propertiesproperty and save it to the Bold Reports® Data Store.
Warning:
1. The `Encrypt_Credentials` property should be set to false when updating the new access token on the template. If you have modified other properties, such as 'select' or 'account id', the `Encrypt_Credentials` property must be set to true.
2. The default lifetime of the access token is 1 hour. Therefore, you need to convert it to a long-lived access token to use the same token for 60 days. Existing tables should be maintained even if the token has expired or is being used as an invalid token.How do I schedule the Google Analytics pipeline?
You schedule the Google Analytics pipeline in Bold Data Hub from the schedules tab, or you run it on demand.
-
To configure interval-based scheduling, click the schedules tab, select the created pipeline, click the schedule icon, and configure the schedule.


-
For an on-demand refresh, click the
Run Nowbutton.
-
Check the schedule history with the history option and the logs.

-
Click Logs to see whether the run is completed and the data source is created in Bold Reports®.

-
Click the
Edit DataSourceoption to view the created tables.
Frequently asked questions
Which email do I share the Google Analytics property with?
For service account authentication, share the property with the client_email of the service account, and grant at least viewer privileges.
Which authentication methods does the Google Analytics connector support?
The Bold Data Hub Google Analytics connector supports OAuth authentication and service account authentication.