diff --git a/docs/configuring.rst b/docs/configuring.rst index 67c91bce..94beb09d 100644 --- a/docs/configuring.rst +++ b/docs/configuring.rst @@ -19,7 +19,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via html_theme_options = { 'canonical_url': '', - 'analytics_id': '', + 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard 'logo_only': False, 'display_version': True, 'prev_next_buttons_location': 'bottom', diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index 7d9a25df..dccfac1d 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -221,6 +221,23 @@ }); + {# Do not conflict with RTD insertion of analytics script #} + {% if not READTHEDOCS %} + {% if theme_analytics_id %} + + + + {% endif %} + {% endif %} + {%- block footer %} {% endblock %}