Py-ga-mob

PYGA: Python Google Analytics - Data Collection API

Download as .zip Download as .tar.gz View on GitHub

PYGA: Python Google Analytics - Data Collection API

pyga is an implementation 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

not yet implemented

To know more about mobiletracking see: https://developers.google.com/analytics/devguides/collection/other/mobileWebsites

Example

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

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

Thanks to: