Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cookie banner to frontend docs #134

Open
11 tasks
Tracked by #133
vanitabarrett opened this issue Apr 22, 2021 · 1 comment
Open
11 tasks
Tracked by #133

Add cookie banner to frontend docs #134

vanitabarrett opened this issue Apr 22, 2021 · 1 comment

Comments

@vanitabarrett
Copy link
Contributor

What

Add the cookie banner component to all pages in the design system.
Hook into the cookie consent functions so that users can accept or reject cookies

This is likely to look different to alphagov/govuk-design-system#1618 as the frontend docs uses the tech docs template. We should look into if it's possible to add functionality to the tech docs template to display a cookie banner without having to inject it using JavaScript.

Why

We need to give users the choice to accept or reject cookies.

Who needs to know about this

Developers

Done when

  • Work in the feature branch
  • Consider Cumulative Layout Shift in the implementation
  • Explore expanding tech docs template functionality to allow displaying a cookie banner
  • Add the cookie banner component to all pages in the frontend docs, using the drafted text
  • Only show the cookie banner if a consent cookie isn't present and/or if it's not an up-to-date version
  • Hook into the cookie consent functions to allow users to accept cookies
  • Hook into the cookie consent functions to allow users to reject cookies
  • Show a confirmation banner when a user has selected a preference
  • Allow users to hide the confirmation banner
  • Implement a no-JS solution
  • Hide the banner when on the cookie page?
@vanitabarrett vanitabarrett transferred this issue from alphagov/govuk-design-system Jun 18, 2021
@owenatgov
Copy link
Contributor

It now makes sense to do this across the design system and frontend docs as we've figured out as part of alphagov/govuk-design-system#1613 that we can do cross domain cookie consent.

From investigation, doing this poses some tricky technical problems, mostly around the context of this being the tech docs gem.

If we don't want to do cross domain tracking, we have to either inject the cookie banner via js or rebuild the core template in the tech docs gem so that we can include the cookie banner like we do in the design system. Injecting via js will involve some potentially quite heavy js and rewriting the core template runs the risk of becoming out of sync with the upstream version of core. Both of these mean we have to find a way to remember ot stay up to date with changes to the cookie banner.

If we do want to do cross domain tracking, we'd need a way for our analytics code to stay up to date between domains. Pay do this using their own separate package: Pay JS Commons, which includes their analytics and cookie consent code. It would be an extra thing for us to maintain but theoretically small and conveneient. It also includes injection of the cookie banner via js, which we'd ideally want to avoid.

There was some work done a while ago to try and add the cookie banner as a configurable element in the tech docs gem but it fell through. We could potentially pick this up again and release a new version of the gem. The risk here is that we also need a way to keep the cookie banner in the tech docs gem up to date as well, especially since the tech docs gem is a rails project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog 🏃🏼‍♀️
Development

No branches or pull requests

3 participants