Skip to content

Analytics is included in offline copies of the python documentation. #136194

Description

@Summertime

Bug report

Bug description:

<script defer data-domain="docs.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>

Appears in the documentation available for download at https://docs.python.org/3/download.html (specifically the HTML downloads).

This issue is across like, 4 repositories and I have no idea which is the root cause, so I'm leaving it here since there is a Docs folder.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Activity

  1. StanFromIreland commented on Jul 2, 2025

    @StanFromIreland
    Member

    cc @hugovk @AA-Turner

    (I’m also not sure where this should go.)

  2. vstinner commented on Jul 2, 2025

    @vstinner
    Member

    The markup comes from Doc/tools/templates/layout.html:

          {% if enable_analytics %}
          <script defer data-domain="docs.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>
          {% endif %}
    

    The doc is built by https://github.com/python/docsbuild-scripts/ which uses an PYTHON_DOCS_ENABLE_ANALYTICS environment variable.

  3. StanFromIreland commented on Jul 2, 2025

    @StanFromIreland
    Member

    Then it should be moved there I think, as it should not set PYTHON_DOCS_ENABLE_ANALYTICS for such builds, unless they reuse the same one.

  4. StanFromIreland commented on Dec 18, 2025

    @StanFromIreland
    Member
  5. hugovk commented on Dec 18, 2025

    @hugovk
    Member

    btw I recently learned:

    Did you know our script automatically disables itself when a site is opened on localhost (i.e., the address developers use when they are testing a website or app privately before it goes online)?

    This ensures that visits from developers and testers are not counted as real traffic, and you can blindly trust the stats you see on your dashboard – without any manual settings or code-work.

    https://fosstodon.org/@plausible/115650256539111737

    https://plausible.io/docs/troubleshoot-integration#are-you-running-on-localhost

  6. vstinner commented on Jan 6, 2026

    @vstinner
    Member

    our script automatically disables itself when a site is opened on localhost

    In that case, do we need to change the doc or not?

  7. hugovk commented on Jan 25, 2026

    @hugovk
    Member

    Not really, but let's do it to avoid any future confusion. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions