Skip to main content
Build Status https://img.shields.io/pypi/v/pyga.svg https://coveralls.io/repos/github/kra3/py-ga-mob/badge.svg?branch=master https://github.com/kra3/py-ga-mob/actions/workflows/codeql-analysis.yml/badge.svg

pyga is an implementation of Google Analytics (ga.js) 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).

PS: Google moved away from ga.js to analytics.js; a new operating standard for Google Analytics named “universal analytics”. Soon ga.js will be deprecated. I’m planning to have a pyga equivalent to the new standard. Read more here at https://developers.google.com/analytics/devguides/collection/upgrade/#upgrade-guides https://developers.google.com/analytics/devguides/collection/protocol/v1/#getting-started

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 mobile-tracking 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)

PHP version

Thanks to: Expicient Inc

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

Metadata

Release files for pyga 2.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyga 2.6.2
File Size Uploaded
pyga-2.6.2.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyga 2.6.2
File Interpreter ABI Platform
pyga-2.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 46.5 kB

Release files / pyga-2.6.2.tar.gz

Download URL pyga-2.6.2.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
09da0e36bc4d44a82ab3dbc6128300b14715b902d98311f0866162de45d2fddc
BLAKE2b-256 checksum
How to use checksums
14228053ffa1c6331b0606bb7c47fd5cd6fbc3716f2a6c76aa817ec469cc334e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Release files / pyga-2.6.2-py3-none-any.whl

Download URL pyga-2.6.2-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
062e0468915130cde882d52e4ca5bc0a01d21d66b5f23b6e1fec045dcefc5942
BLAKE2b-256 checksum
How to use checksums
10859b54a9f80fd5f368b43b3c00a1134be5e9e10cb30e84c6f24f3e93844956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

2.6.2 This release

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.1

2 release files

2.5.0

1 release file

2.4.2

2 release files

2.4.1

2 release files

2.4

2 release files

2.3

3 release files

2.2

3 release files

2.1

3 release files

2.0

2 release files

1.4

2 release files

1.3

1 release file

1.2

2 release files

1.1

2 release files

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page