Skip to content

docs: Enable Google Analytics and implement a pop-up cookie consent banner#722

Merged
skoech merged 1 commit into
mainfrom
enable-google-analytics
Apr 30, 2026
Merged

docs: Enable Google Analytics and implement a pop-up cookie consent banner#722
skoech merged 1 commit into
mainfrom
enable-google-analytics

Conversation

@skoech
Copy link
Copy Markdown
Collaborator

@skoech skoech commented Apr 30, 2026

Description

This PR enables Google Analytics (GA) for MicroCeph documentation. But to use GA on a Read the Docs (RTD) project, it is required to implement a consent collection mechanism before placing tracking cookies on a reader's device. The standard way we collect user consent is by using the web team’s cookie policy banner, which is visually consistent across our Ubuntu and Canonical properties. This is now also available for RTD projects.

The PR adds:

  • HTML templates: header.html that inserts the GA tracking tag onto each page, and footer.html that provides a link for users to change their data collection preferences. The files are available to download from the RTD-cookie-banner repository. The README file of the cookie banner repository contains the implementation instructions.
  • Configuration to support required template and static files

When this PR is merged, the cookie banner will be shown to our users, and GA collection will begin as soon as a user accepts tracking cookies.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update (change to documentation only)

How has this been tested?

  • I have built the documentation locally and verified that the cookie banner pops up when first visiting the site, using these commands (screenshot shown below):
cd docs

make clean
make install
make run

Note

You may need to clear your browser cache for changes to take effect, or use Incognito mode.

image ---
  • I have tested the tracker settings and verified that the toggles work as expected. I've done this by fiddling with the configuration choices under Manage your tracker settings:
image

Contributor checklist

Please check that you have:

  • self-reviewed the code in this PR
  • added code comments, particularly in less straightforward areas
  • checked and added or updated relevant documentation
  • checked and added or updated relevant release notes
  • added tests to verify effectiveness of this change

Signed-off-by: Sharon Koech <sharon.koech@canonical.com>
@skoech skoech self-assigned this Apr 30, 2026
@geoffreynyaga
Copy link
Copy Markdown

@skoech

I have reviewed the PR and also run it locally.
The cookie banner is working and I can customize the available options. The code changes also follow the provided guidance from the starter pack repo.

All good!

Copy link
Copy Markdown
Contributor

@lmlg lmlg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@skoech
Copy link
Copy Markdown
Collaborator Author

skoech commented Apr 30, 2026

Thanks, @geoffreynyaga and @lmlg!

@skoech skoech merged commit 1133001 into main Apr 30, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants