Skip to content
PYGA: Python Google Analytics - Data Collection API
Python Makefile
Find file
Latest commit 0343520 @kra3 Merge pull request #19 from zonito/patch-1
Represents an Event --> Fixed broken link
Failed to load latest commit information.
doc new version 2.3 which handles certain serialization scenarios around …
pyga Represents an Event --> Fixed broken link
.coveragerc Create .coveragerc
.gitignore Add some tests
.travis.yml Update .travis.yml
LICENSE added for pypi Update
Makefile Add some tests
README.rst Update README.rst
RELEASES Release 2.5.0 - Incrementing major version number Remove the namespace declaration


PYGA: Python Google Analytics - Data Collection API

Build Status

pyga is an iplementation of Google Analytics in Python;so that it can be used at server side. This project only helps you with Data Collection part of Google Analytics. ie., You can consider this as a replacement for ga.js at client side.

Google Provides Android SDK,iOS SDK + Flash SDK. And left everybody else with a single page documentation about GIF request parameters. Also with a basic sample of server side implementation in quite a few languages (perl, php, jsp).

Use Cases

  1. You want to track data from server side
  2. You're developing a mobile site and have to support devices w/o JS support

Supported Features

  • Page View

  • E-Commerce

  • Social Interaction

  • Custom Variables

  • Events

  • Campaigns

    not yet

  • Ad-Words

  • Search Engine

To know more about mobiletracking see:


from pyga.requests import Tracker, Page, Session, Visitor

tracker = Tracker('MO-XXXXX-X', '')
visitor = Visitor()
visitor.ip_address = ''
session = Session()
page = Page('/path')
tracker.track_pageview(page, session, visitor)

PHP version

Thanks to: Expicient Inc

And for you fans outthere, we even have mountain bikes named pyga ;)

Something went wrong with that request. Please try again.