GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DataSolveProblems/GoogleAnalytics4: Google Analytics 4 API

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
ga4
ga4
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Google Analytics 4 Python API v1

Simple module to work with Google Analytics 4 API.

Features:

  • Run real time report
  • Run Google Analytics report

Installation

pip install install google-analytics-data Requirements: Python 3.6+

Basic Usage

  1. Create a Google Cloud Account
  2. Start using ga4
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)

About

Google Analytics 4 API

Resources

Readme
MIT license
Activity

Stars

6 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.