| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Simple module to work with Google Analytics 4 API.
Features:
pip install install google-analytics-data Requirements: Python 3.6+
import os
import pandas as pd
from ga4 import GA4RealTimeReport
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'ga4_service_acct.json'
property_id = '307310528'
lst_dimension = ['country', 'city', 'deviceCategory']
lst_metrics = ['activeUsers']
ga4_realtime = GA4RealTimeReport(property_id)
report = ga4_realtime.query_report(
dimensions=lst_dimension,
metrics=lst_metrics
)
df = pd.DataFrame(data=report['rows'], columns=report['headers'])
print(df)| Back | FazBrowse Home | New Git URL |