Content
Feedback
Asks “Did this page help you?” at the end of a page, so a service learns which pages fail people, and links to report a problem.
When to use
- At the end of information pages and the last page of a service, such as a confirmation, so every page of the website reports the same measure.
When not to use
- In the middle of a form: it takes people away from their task. Ask on the confirmation page instead.
- When nobody will read the answers. Before you add it, agree who looks at the results each month and what they will change.
How to use
- Put it after the page's content, before the footer.
- Send the page's address with the answer (the hidden
pagefield), and count the Yes and No answers for each page. A page with many No answers is the one to research and rewrite first. - After an answer, show the same page with the thank-you state, so people stay where they were.
- Link “Report a problem with this page” to a short form that asks what they were trying to do and what went wrong. Tell people not to type personal details such as their Ghana Card number.
- Keep only the page, the answer and the date. Do not store who answered, and do not set a cookie for it.
Accessibility
What GGDS does
- The buttons say what they mean to screen readers: “Yes this page helped me” and “No this page did not help me”.
- The thank-you message has
role="status", so screen readers announce it, and the buttons are at least 44 pixels high. - It works without JavaScript: the buttons send an ordinary form.
What you need to do
- Keep it after the main content, so it is not the first thing people hear.
- If you send the answer with JavaScript instead, move focus to the thank-you message (it has
tabindex="-1").
Research
Alpha: tested automatically, not yet with people on a live website. The question follows the pattern used by government websites that measure every page; check its wording with Ghanaian users and in the GGDS languages.
Example: Did this page help you?
<section class="ggds-feedback" aria-labelledby="ggds-feedback-title">
<form class="ggds-feedback__form" action="/feedback/" method="post">
<input type="hidden" name="page" value="/services/apply-for-a-licence/">
<h2 class="ggds-feedback__title" id="ggds-feedback-title">Did this page help you?</h2>
<div class="ggds-feedback__answers">
<button class="ggds-button ggds-button--secondary ggds-feedback__answer" type="submit" name="helpful" value="yes">Yes <span class="ggds-visually-hidden">this page helped me</span></button>
<button class="ggds-button ggds-button--secondary ggds-feedback__answer" type="submit" name="helpful" value="no">No <span class="ggds-visually-hidden">this page did not help me</span></button>
</div>
</form>
<p class="ggds-feedback__report"><a href="/report-a-problem/?page=/services/apply-for-a-licence/">Report a problem with this page</a></p>
</section><section className="ggds-feedback" aria-labelledby="ggds-feedback-title">
<form className="ggds-feedback__form" action="/feedback/" method="post">
<input type="hidden" name="page" value="/services/apply-for-a-licence/" />
<h2 className="ggds-feedback__title" id="ggds-feedback-title">Did this page help you?</h2>
<div className="ggds-feedback__answers">
<button className="ggds-button ggds-button--secondary ggds-feedback__answer" type="submit" name="helpful" value="yes">Yes <span className="ggds-visually-hidden">this page helped me</span></button>
<button className="ggds-button ggds-button--secondary ggds-feedback__answer" type="submit" name="helpful" value="no">No <span className="ggds-visually-hidden">this page did not help me</span></button>
</div>
</form>
<p className="ggds-feedback__report"><a href="/report-a-problem/?page=/services/apply-for-a-licence/">Report a problem with this page</a></p>
</section>Example: After an answer
<section class="ggds-feedback" aria-labelledby="ggds-feedback-title">
<p class="ggds-feedback__thanks" id="ggds-feedback-title" role="status" tabindex="-1">Thank you for your feedback.</p>
<p class="ggds-feedback__report"><a href="/report-a-problem/?page=/services/apply-for-a-licence/">Report a problem with this page</a></p>
</section><section className="ggds-feedback" aria-labelledby="ggds-feedback-title">
<p className="ggds-feedback__thanks" id="ggds-feedback-title" role="status" tabIndex={-1}>Thank you for your feedback.</p>
<p className="ggds-feedback__report"><a href="/report-a-problem/?page=/services/apply-for-a-licence/">Report a problem with this page</a></p>
</section>Use it
- Stylesheet
ggds.cssincludes it. To load only the parts you use:core.css, thencomponents/feedback.css(0.4 KB with gzip, minified).- JavaScript
- None needed.
HTML
Copy the HTML under each example above. It works in any website.
Astro
With @ggds/astro:
import Feedback from '@ggds/astro/Feedback.astro';
<Feedback action="/feedback/" page={Astro.url.pathname} reportHref="/report-a-problem/" />React and Next.js
No React component: switch the HTML under an example to JSX (React) and copy it.
Django
With ggds-django ({% load ggds %}):
{% ggds_feedback action="/feedback/" report_url="/report-a-problem/" %}Classes and states
| Class | What it does |
|---|---|
.ggds-feedback | At the end of the page: the question and the report link. |
.ggds-feedback__form | The question and the two answers, sent with the page's address. |
.ggds-feedback__title | "Did this page help you?" |
.ggds-feedback__answers | Yes and No, side by side. |
.ggds-feedback__answer | Each answer: a secondary button that sends the form. |
.ggds-feedback__thanks | After an answer: the thank-you message, announced by screen readers. |
.ggds-feedback__report | The link to report a problem with the page. |
Accessibility tests
Automated, on every change
These run each time GGDS changes. A change that fails one is not accepted.
- WCAG 2.2 A and AA rules (axe), at desktop and phone widths, on every example
- No sideways scrolling on a 320px screen, also with a wide font, on every example
- Every approved colour pair meets its contrast minimum, for every institution theme
- No inline scripts or styles, so it runs under a strict Content Security Policy
- Behaviour test: “feedback: an answer sends the page address, and the thank-you is announced”
- Behaviour test: “no horizontal scrolling at 320px”
- Behaviour test: “no horizontal scrolling at 320px with a wide font”
By people, with assistive technology
Automated tests find only some of the barriers people meet. These checks are still to be done.
| Check | Result | Notes |
|---|---|---|
| Keyboard only | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| NVDA screen reader with Firefox or Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| JAWS screen reader with Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| VoiceOver screen reader with Safari (iPhone) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| TalkBack screen reader with Chrome (Android) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Zoom to 400%, and increased text spacing | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Windows contrast themes (forced colours) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Voice control (Voice Access or Dragon) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
Changes
| Version | Change |
|---|---|
| 0.4.0 | New: feedback ("Did this page help you?"), in HTML, React, Astro and Django: Yes and No buttons that send an ordinary form with the page's address, a thank-you that screen readers announce, and a link to report a problem. It needs no JavaScript and keeps no personal details, so every page of a website can report the same measure. Alpha. |
| 0.1.0 | Added. |
Related components
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.