skillfed

sphinxcontrib-googleanalytics

Sphinx extension googleanalytics

sphinxcontrib-googleanalytics v0.5 98.1K downloads/30d#13,102 on PyPI24
Permissive license BSD-3-Clause AGING released

What it is and what it does

sphinxcontrib-googleanalytics is a Sphinx extension that automatically injects Google Analytics tracking code into HTML documentation generated by Sphinx. It requires only Sphinx as a runtime dependency and integrates via a simple configuration entry in conf.py, where you supply your Google Analytics tracking ID.

The extension is designed for documentation authors who want to monitor how their generated HTML docs are being accessed and used. It operates at build time, adding tracking instrumentation to the final HTML output without requiring manual edits to individual pages.

Use it for:

  • Track visitor traffic and engagement metrics for published Sphinx documentation sites.
  • Monitor which documentation pages are most frequently accessed by users.
  • Gather analytics on documentation usage to inform content prioritization and updates.
  • Measure the reach and adoption of technical documentation across teams or projects.

Worth the install?

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

Adds Google Analytics tracking to Sphinx-generated HTML documentation by injecting tracking code into built pages.

Yes, if you maintain Sphinx documentation and want built-in Google Analytics integration without manual HTML editing. The low install friction and permissive license make it a straightforward addition. However, verify compatibility with your current Google Analytics setup (GA4 vs. legacy), and note that the package is aging—last updated 445 days ago—so check whether it still works with recent Sphinx versions before committing to production use.

Install

sphinxcontrib-googleanalytics on PyPI

pip

pip install sphinxcontrib-googleanalytics

uv

uv add sphinxcontrib-googleanalytics

poetry

poetry add sphinxcontrib-googleanalytics

Installing sphinxcontrib-googleanalytics

Before you install

Low install friction; single wheel dependency on Sphinx. Maintenance status is aging—last release was 445 days ago, though the repository remains active and not archived.

License in practice

BSD-3-Clause permissive license; you may use, modify, and distribute this package freely in commercial or private projects provided you retain the license notice.

Quickstart

pip install sphinxcontrib-googleanalytics

In conf.py:
extensions = ['sphinxcontrib.googleanalytics']
googleanalytics_id = 'UA-123-123-123'

Verify before relying

  • Whether the package works with current Google Analytics tracking implementations (GA4 vs. legacy Universal Analytics)
  • Python version compatibility, as requires_python is unspecified in the fact sheet

Package facts

License BSD-3-Clause (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — Sphinx
Maintenance aging — 445 days since the last release
Last repo commit
First released
Downloads 98,134/month — #13,102 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sphinxcontrib_googleanalytics-0.5-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonTopic :: DocumentationTopic :: Utilities

Tags

sphinx google analyticsdocumentation trackingsphinx analytics extensiongoogle analytics sphinx plugintrack sphinx docssphinx web analyticsdocumentation usage tracking
sphinx-extensionanalytics

More Utilities packages