Goal:
In this repo I want to give marketers, organizations, and businesses easy access to their GA-4 API data and give them the ability to connecting it to a database as well as creating CSV and Excel files.
Instructions:
- Install the dependencies (see below)
- Enable the Google Analytics Data API here!
- Rename it to "credentials.json," it will be something along the lines of "1234141.json"
- With the downloaded JSON file, place into a folder where you'll be doing you're testing
- Look inside credentials.json file with notepad and look for email like: "[email protected]", share it with your analytics property giving it admin access
- With the QuickStart.py file, place your specific property view (your GA4 view ID) and your credentials file name into the specific place.
- Create a blank SQLite database and name it to you're likeing and save.
- Update the QuickStart.py file to also have your directory location of the database you created.
- Run the program and the results will now be in the SQLITE database, the excel spreadsheet, and the csv.
If you'd like to view the data with Power Bi:
Reference this: https://apps.provingground.io/docs/tracer-v1-0-documentation/tracer-power-bi-workflow/how-to-use-sqlite-as-a-power-bi-data-source/
If you'd like to add more more metrics/dimensions:
Reference this: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema
Future stuff to add:
- DAG Airflow Component w/ Email Notification
- Connectors to other databases (SQL Server, PostGreSQL, MySQL)
pip install git+https://github.com/googleapis/google-api-python-client
pip install pandas
pip install git+https://github.com/DataSolveProblems/jj_data_connector.git