diff --git a/docs/setup/setting-up-site-analytics.md b/docs/setup/setting-up-site-analytics.md index 95ad071d2..989d80547 100644 --- a/docs/setup/setting-up-site-analytics.md +++ b/docs/setup/setting-up-site-analytics.md @@ -55,9 +55,9 @@ following lines to `mkdocs.yml`: 1. Go to your Google Analytics __admin settings__ 2. Select the property for the respective tracking code - 3. Select the __Data Streams__ tab and click the corresponding URL - 4. Click the gear icon within the __Enhanced measurement__ section - 5. Ensure that __Site search__ is enabled + 3. Select the __data streams__ tab and click the corresponding URL + 4. Click the gear icon within the __enhanced measurement__ section + 5. Ensure that __site search__ is enabled === ":material-google-analytics: Universal Analytics" @@ -261,6 +261,27 @@ e.g. your privacy policy: [custom cookies]: #custom-cookies [extra.consent enabled]: ../assets/screenshots/consent.png +## Usage + +### Hiding the feedback widget + +When [Metadata] is enabled, the [feedback widget][extra.analytics.feedback] can +be hidden for a document with custom front matter. Add the following lines at +the top of a Markdown file: + +``` bash +--- +hide: + - feedback +--- + +# Document title +... +``` + + [Metadata]: extensions/python-markdown.md#metadata + + ## Customization ### Custom site analytics diff --git a/src/partials/integrations/analytics/google.html b/src/partials/integrations/analytics/google.html index 685d3c756..599d05537 100644 --- a/src/partials/integrations/analytics/google.html +++ b/src/partials/integrations/analytics/google.html @@ -45,9 +45,8 @@ if (document.forms.search) { var query = document.forms.search.query query.addEventListener("blur", function() { - if (this.value) { - gtag("event", "search", {search_term: this.value}) - } + if (this.value) + gtag("event", "search", { search_term: this.value }) }) }