Skip to content

Clean up and document analytics scripts

Sarah German requested to merge analytics-cleanup into main

What does this MR do and why?

  • Removes unused/outdated/duplicative analytics scripts (Facebook analytics and a duplicate copy of Google Tag Manager)
  • Loads all analytics code from the analytics.html template (we're removing gtm.html and moving that code into analytics.html)
  • Adds the async attribute to scripts that didn't already have it. We do not want these scripts to block
  • Removes outdated cookies page (we now use the OneTrust cookie preferences widget, which links to a SSoT cookies page in the handbook)
  • Adds documentation about in-use analytics scripts

Closes https://gitlab.com/gitlab-org/technical-writing/-/issues/722

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Compile for production to include analytics: NANOC_ENV="production" make compile
  3. Browse a few pages with the browser console open and check for analytics-related errors

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah German

Merge request reports