Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

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: 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:

Recent activity

Kirill Klenov

Commits by Kirill Klenov were pushed to kra3/pyga

6bc9b6c - ver 2.4.2
Kirill Klenov

Commits by Kirill Klenov were pushed to kra3/pyga

2b7bb9c - increment version
Kirill Klenov

Commits by Kirill Klenov were pushed to kra3/pyga

3143800 - Add some tests
Arun Karunagath

Commits by Arun Karunagath were pushed to kra3/pyga

0f87507 - minor release to fix brocken installtion. Wonder how it went un-noticed this long
Kirill Klenov

Commits by Kirill Klenov were pushed to kra3/pyga

714183f - Update MANIFEST.in
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.