universal-analytics-python3
Universal analytics python library
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-python3uv
uv add universal-analytics-python3poetry
poetry add universal-analytics-python3Installing 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
analytics-pythonA Python client library that sends analytics…
permissive · top 5,000 on PyPI
snowplow-trackerSends event data from Python applications to…
permissive · top 1,000 on PyPI
google-analytics-dataPython client library for querying Google…
permissive · top 5,000 on PyPI
openvino-telemetrySends telemetry data from OpenVINO toolkit…
permissive · top 5,000 on PyPI
kanaries-trackSends event and metric data to Kanaries' data…
permissive · top 15,000 on PyPI
django-analyticalIntegrates multiple third-party analytics…
permissive · top 15,000 on PyPI
analytics-mcpRuns an MCP server that exposes Google…
permissive · top 15,000 on PyPI
amplitude-analyticsOfficial Amplitude backend SDK for Python that…
permissive · top 5,000 on PyPI
minimal-snowplow-trackerSends event data from Python applications to…
permissive · top 5,000 on PyPI
aiotractiveAsynchronous Python client for the Tractive pet…
permissive · top 15,000 on PyPI