Clean up and document analytics scripts
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 removinggtm.html
and moving that code intoanalytics.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.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Compile for production to include analytics: NANOC_ENV="production" make compile
-
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German