Skip to content

[DO NOT MERGE] Stream web analytics data to Umami - #187

Draft
sjlegg wants to merge 1 commit into
mainfrom
umami
Draft

sjlegg wants to merge 1 commit into
mainfrom
umami

Conversation

@sjlegg

@sjlegg sjlegg commented Aug 18, 2026 •

Copy link
Copy Markdown
  • JS snippet in <head> to stream web analytics data to Umami (NHSE-hosted in AWS)
  • New privacy policy
  • Add link to privacy policy to footer
  • Apply Content Security Policy (CSP) to all pages via a <meta> tag in the <head> - tested by running locally and checking logs for CSP violations, as well as LLM pixel-by-pixel comparison of screenshots before/after to check for missing fonts, style sheets etc.

@sjlegg
sjlegg requested review from csutter and a balanced review from Copilot August 18, 2026 16:04
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 18, 2026 16:04 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Umami web analytics and documents the associated privacy handling.

Changes:

  • Injects the Umami analytics script site-wide.
  • Adds and links a new privacy policy.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eleventy.config.mjs Adds footer link and analytics transform.
app/privacy-policy.md Documents analytics data processing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/privacy-policy.md Outdated
Comment thread eleventy.config.mjs Outdated

This comment was marked as outdated.

@sjlegg sjlegg linked an issue Aug 19, 2026 that may be closed by this pull request
@annapowellsmith-nhs
annapowellsmith-nhs marked this pull request as draft August 19, 2026 14:00
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 15:10 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 15:50 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 15:51 Inactive
@sjlegg
sjlegg requested a balanced review from Copilot August 19, 2026 15:52

This comment was marked as resolved.

This comment was marked as resolved.

@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 16:23 Inactive
@sjlegg
sjlegg requested a balanced review from Copilot August 19, 2026 16:24

This comment was marked as resolved.

@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 16:33 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 16:40 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 19, 2026 16:42 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 24, 2026 10:51 Inactive
@sjlegg
sjlegg requested a balanced review from Copilot August 24, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread eleventy.config.mjs Outdated
Comment thread eleventy.config.mjs Outdated
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 24, 2026 10:56 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 24, 2026 10:58 Inactive
@sjlegg
sjlegg requested a balanced review from Copilot August 24, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread eleventy.config.mjs Outdated
@annapowellsmith-nhs

Copy link
Copy Markdown

Lovely 🙌 I've deleted previous comments that are now outdated following our offline discussion.

Two minor things:

  • I wonder if we want to serve the script from a prettier URL like analytics.digital-prevention-services.nhs.uk, and lose crossorigin="anonymous" - one for @csutter to decide, I think.
  • Presumably the DPSP site admins will need to set up a CSP for this. Worth flagging that in this PR I think.

@NHSDigital NHSDigital deleted a comment from sjlegg Aug 24, 2026
@csutter

csutter commented Aug 24, 2026

Copy link
Copy Markdown

Looks good in principle!

It's not clear from the Umami docs whether different versions of the tracking script work with different versions of Umami, or if there's a risk of issues if they diverge. Either way it's probably worth us versioning the script files on the bucket like v3.3.1/script.js as part of deploying a new Umami version (in addition to the sensible use of a SHA).

I wonder if we want to serve the script from a prettier URL like analytics.digital-prevention-services.nhs.uk

We can set up an appropriate nhs.uk subdomain when the time comes (I believe www.digital-prevention-services.nhs.uk is just a CNAME and we haven't delegated a zone to us so we'll have to make a request to the DNS team).

Presumably the DPSP site admins will need to set up a CSP for this.

Can we do that in this PR? This will need a <meta> tag as we can't add custom headers on GitHub pages.

@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 25, 2026 13:57 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 August 25, 2026 15:48 Inactive
@sjlegg

sjlegg commented Aug 26, 2026

Copy link
Copy Markdown
Author

Looks good in principle!

It's not clear from the Umami docs whether different versions of the tracking script work with different versions of Umami, or if there's a risk of issues if they diverge. Either way it's probably worth us versioning the script files on the bucket like v3.3.1/script.js as part of deploying a new Umami version (in addition to the sensible use of a SHA).

I wonder if we want to serve the script from a prettier URL like analytics.digital-prevention-services.nhs.uk

We can set up an appropriate nhs.uk subdomain when the time comes (I believe www.digital-prevention-services.nhs.uk is just a CNAME and we haven't delegated a zone to us so we'll have to make a request to the DNS team).

Presumably the DPSP site admins will need to set up a CSP for this.

Can we do that in this PR? This will need a <meta> tag as we can't add custom headers on GitHub pages.

Thanks @csutter. I have added a CSP to this PR and tested it. I'll work on the version tracking in parallel. We're still waiting on an outcome of the DPIA screen for this.

Please can you provide details off this PR of how to make the request to the DNS team for the subdomain, or should this wait for the outcome of the DPIA screen first?

@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 September 3, 2026 13:47 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 September 3, 2026 13:48 Inactive
@frankieroberto
frankieroberto temporarily deployed to dpsp-website-umami-dvheupcg8z0 September 30, 2026 11:23 Inactive

This branch was successfully deployed

1 active deployment
dpsp-website-umami-dvheupcg8z0 — ef38964d Deployed Sep 30, 2026 by frankieroberto
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.

Add privacy-friendly analytics

5 participants