    {% if envvars('ANALYTICS') == '1' %}
    <div class="consent-banner page-content">
        {{ md(_("Is it OK to collect the following information of your visit?")) }}

        <ul>
          <li>
            {{ md(_("The pages you visit.")) }}
          </li>

          {% if envvars('ANALYTICS_SDK') != 'cleaninsights' %}
          <li>
            {{ md(_("The first 2 octets of your current IP address.")) }}
          </li>
          {% endif %}

          {% if envvars('ANALYTICS_SDK') != 'cleaninsights' and envvars('ANALYTICS_LINK_TRACKING') == '1' %}
          <li>
            {{ md(_("Which links you click, including download links.")) }}
          </li>
          {% endif %}

          {% if envvars('ANALYTICS_BROWSER_DETECTION') == '1' %}
          <li>
            {{ md(_("Information about the browser you're using and the language in use.")) }}
          </li>
          {% endif %}
        </ul>

        {% macro render_policy_link() %}<a href="policy" target="_blank">{{ _("full privacy policy") }}</a>{% endmacro %}
        {{ _("To learn more about why we're collecting this information, for how long, and with whom we share this information with, please visit our %(link_to_policy)s.")|format(link_to_policy=render_policy_link())|safe }}

        <div class="consent-buttons">
          <a class="button" id="consent-ok">{{ md(_("Accept")) }}</a>
          <a class="button" id="consent-cancel">{{ md(_("Decline")) }}</a>
        </div>
    </div>

    <script>
      // Consent UX and "Decline" button
      const banner  = document.getElementsByClassName('consent-banner')[0]
      const cancel  = document.getElementById('consent-cancel')

      // Handle the "Decline" button
      cancel.onclick = () => {
        banner.style.display = 'none'
      }

      // Thanks https://stackoverflow.com/questions/16947459/is-it-possible-to-check-the-value-of-firefox-dnt-with-javascript
      var isDNT = navigator.doNotTrack   === "yes" ||
                  navigator.doNotTrack   === "1"   ||
                  navigator.msDoNotTrack === "1";

      // Only display the consent banner if Do Not Track is disabled
      // We're respecting the DNT setting even if it's deprecated
      // Check the Onion Launchpad Analytics documentation for details
      if (!isDNT) {
        banner.style.display = 'block'
      }
    </script>

    {% if envvars('ANALYTICS_SDK') == 'cleaninsights' %}
      {% include 'macros/clean-insights.html' %}
    {% else %}
      {% include 'macros/matomo.html' %}
    {% endif %}
    {% endif %}
