skillfed

universal-analytics-python3

Universal analytics python library

universal-analytics-python3 v1.1.1 176.2K downloads/30d#10,250 on PyPI7
Permissive license Abandoned released

What it is and what it does

This library provides a Python interface to Google Analytics using the Universal Analytics Measurement Protocol. It wraps HTTP calls to Google's analytics endpoint, allowing you to track events, pageviews, social interactions, timing data, and other analytics events from Python code—either synchronously or asynchronously, and optionally in batches. The interface is loosely modeled after analytics.js, so developers familiar with that API will recognize the patterns.

The package depends only on httpx for HTTP transport and supports both single-request and batch-request workflows. It covers the main tracking types (pageview, event, social, timing, transaction, item, screenview, exception) and accepts parameters in multiple formats—named arguments, property dictionaries, or analytics.js field names. However, the project has been abandoned since 2021-04-28 and is no longer maintained, which means any issues or incompatibilities will not be addressed.

Use it for:

  • Track backend events (purchases, signups, errors) to Google Analytics from a Python application.
  • Send server-side pageview data to Google Analytics for server-rendered or hybrid web applications.
  • Batch multiple analytics events into a single HTTP request to reduce network overhead.
  • Implement asynchronous analytics tracking in async Python applications without blocking request handlers.
  • Run A/B tests by setting experiment and variation IDs before sending pageview or event hits.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Sends event and pageview data to Google Analytics via the Universal Analytics Measurement Protocol, supporting synchronous and asynchronous HTTP requests and batch submissions.

No—not for new projects. The package is abandoned (last release 2021-04-28, no commits since), and maintenance risk is high. If you must integrate with legacy Universal Analytics properties, this library will work for basic tracking, but you assume all maintenance risk. For new work, use a maintained alternative.

Install

universal-analytics-python3 on PyPI

pip

pip install universal-analytics-python3

uv

uv add universal-analytics-python3

poetry

poetry add universal-analytics-python3

Installing universal-analytics-python3

Before you install

Low install friction with a single runtime dependency (httpx). However, the package is abandoned—last release was 2021-04-28, with no recent maintenance activity. Use only if you accept the risk of unpatched issues.

License in practice

Distributed under the MIT license (permissive), which allows commercial and private use with minimal restrictions.

Quickstart

pip install universal-analytics-python3

from universal_analytics import Tracker, HTTPRequest

with HTTPRequest() as http:
    tracker = Tracker("UA-XXXXX-Y", http, client_id="unique-id")
    tracker.send("event", "Subscription", "billing")

Requires a valid Google Analytics property ID (UA-XXXXX-Y format) and a unique client ID for tracking.

Verify before relying

  • Whether Google Analytics still accepts the Universal Analytics Measurement Protocol or requires migration.
  • Compatibility of httpx dependency with current versions, given abandonment since 2021-04-28.
  • Whether batch request functionality works reliably with current Google Analytics endpoints.
  • Support status for Python versions beyond 3.9 (classifiers list 3.7, 3.8, 3.9).

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — httpx
Maintenance abandoned — 1,934 days since the last release
Last repo commit
First released
Downloads 176,240/month — #10,250 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: universal_analytics_python3-1.1.1-py3-none-any.whl

Keywords: python, analytics, google-analytics

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

google analytics python clientuniversal analytics measurement protocolsend events to google analyticsanalytics tracking librarypython analytics integration
analyticsabandoned

More WWW/HTTP packages