diff --git a/docs/requirements.txt b/docs/requirements.txt index 1fecad963..ec7730e44 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ sphinx >=7.0.0,<9.0.0 furo myst-parser +sphinxcontrib-googleanalytics diff --git a/docs/source/conf.py b/docs/source/conf.py index 767e47042..52c189ecb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -38,6 +38,7 @@ "sphinx.ext.napoleon", "sphinx.ext.todo", "myst_parser", + "sphinxcontrib.googleanalytics", # Rez custom extension 'rez_sphinxext' ] @@ -117,6 +118,19 @@ todo_emit_warnings = False +# -- Options for googleanalytics extension ---------------------------------- +# https://github.com/sphinx-contrib/googleanalytics + +# ReadTheDocs used to support Google Analytics natively. But they no more do +# since July 2024. See https://github.com/readthedocs/readthedocs.org/issues/9530#issuecomment-2233541583 + +if not os.environ.get("READTHEDOCS"): + # Don't activate if run locally + googleanalytics_enabled = False + +# https://jira.linuxfoundation.org/plugins/servlet/desk/portal/2/IT-26436 +googleanalytics_id = "G-G11PX36QZS" + # -- Custom -----------------------------------------------------------------