Giter Club home page Giter Club logo

ga_reporting_api's Introduction

GA_reporting_API

Use google analytics reporting api to fetch data from GA.

Read more about this at https://jingsblog.com/2018/11/27/get-unsampled-ab-test-data-from-google-analytics-by-using-analytics-reporting-api/

  • gaData.py

    • Have functions for connecting to GA and fetching data avoiding sampling.
      • To avoid sampling in each API request, something called nextPageToken has been used to enable more than 10,000 results in each API request.
      • In this code, by default, An API request will be made day by day no matter how large the date range you are giving, which means we sent request for data at a daily level.
      • If the data is somehow sampled, a samplesReadCounts and samplingSpaceSizes will be printed out so you know sampling happens.
    • Functions:
      • initialize_analyticsreporting(CLIENT_SECRETS_PATH)
      • return_ga_data(analytics, start_date, end_date, view_id, metrics, dimensions, segments = [], split_dates = True, group_by = [], SLEEP_TIME = 2 )
      • get_and_save_data(path, filesize, analytics, start_date, end_date, view_id, metrics, dimensions, segments, split_dates = True, group_by = [], SLEEP_TIME = 5 )
    • save_df_to_csv(df, path, filename )
  • Get_ClientID_List.ipynb

    • A Jupyter Notebook template for how to use gaData.py to get data from GA
  • key

    • a folder you should put your own client credentials

ga_reporting_api's People

Contributors

jing-jin-mc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.