Skip to content

Python script to find the Top n pages from your Google analytics account and write the data to a file/stdout

Notifications You must be signed in to change notification settings

callicoder/python-google-analytics-popular-pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analyzer

Python script to find the Top n pages from your Google analytics account and write the response to a file/stdout in json/yaml format

How to run

  • Use virtualenv to create a virtual environment

    # Create a virtual env
    $ virtualenv venv
    
    # Activate virtual env
    $ source venv/bin/activate
  • Install dependencies using pip

    $ pip install -r requirements.txt
  • Specify Google service account credentials file location

    Follow these instructions to create a service account in Google console. Download the key.json file and set the KEY_FILE_LOCATION in .env.

    Note: You'll also need to enable Google analytics APIs.

  • Add Google Analytics VIEW_ID in environment

    Follow these steps to get the VIEW_ID for your analytics account:

    • Sign in to Google Analytics.
    • Click Admin, and navigate to View.
    • In the VIEW column, click View Settings.
    • You'll find View ID in Basic Settings.
  • Run the script

    $ python main.py 

About

Python script to find the Top n pages from your Google analytics account and write the data to a file/stdout

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages