Google Analytics is a service for web analytics that tracks and provides data regarding user engagement with your website or application.
Service account credentials are more suitable for server-to-server interactions.
To obtain API credentials using a GCP service account, follow these steps:
Note: For service account authentication, use the
client_email
.
The config
section in a YAML file includes the following properties:
Connectorname: Google_analytics
project_id: ID of the project
client_email: Email of the client
private_key: Private key
version: 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>