Code Monkey home page Code Monkey logo

google-analytics-data-ga4-api-pull-to-sqlite's Introduction

Google Analytics Data (GA4) API Pull to SQLite

alt text

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:

  1. Install the dependencies (see below)
  2. Enable the Google Analytics Data API here!
  3. Rename it to "credentials.json," it will be something along the lines of "1234141.json"
  4. With the downloaded JSON file, place into a folder where you'll be doing you're testing
  5. Look inside credentials.json file with notepad and look for email like: "[email protected]", share it with your analytics property giving it admin access
  6. With the QuickStart.py file, place your specific property view (your GA4 view ID) and your credentials file name into the specific place.
  7. Create a blank SQLite database and name it to you're likeing and save.
  8. Update the QuickStart.py file to also have your directory location of the database you created.
  9. 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)

Dependencies:

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

google-analytics-data-ga4-api-pull-to-sqlite's People

Contributors

dsilverio123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.