ehsan-dashboards/dashboards/test_ga4_data.py

10 lines
413 B
Python

from google.oauth2 import service_account
from google.analytics.data_v1beta import BetaAnalyticsDataClient
KEY_FILE = '/home/hermeswebui/.hermes/webui/attachments/00e47f151810/ga4searchcomsol-e5e7219f50e9.json'
try:
client = BetaAnalyticsDataClient.from_service_account_file(KEY_FILE)
print("GA4 Data Client initialized successfully.")
except Exception as e:
print("GA4 Data Client init error:", e)