1. Component Guide
  2. Cookie banner
  3. In services asking for analytics only
Cookie banner example

In services asking for analytics only

Use this type of banner in your service if it only uses cookies for analytics.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/cookie_banner", {
  title: "Can we store analytics cookies on your device?",
  text: "Analytics cookies help us understand how our website is being used.",
  confirmation_message: sanitize("You’ve accepted all cookies. You can `<a class='govuk-link' href='/cookies'>change your cookie settings</a>` at any time."),
  services_cookies: {
    yes: {
      text: "Yes",
      data_attributes: {
        "track-category": "cookieBanner"
      }
    },
    no: {
      text: "No",
      data_attributes: {
        "track-category": "cookieBanner"
      }
    },
    cookie_preferences: {
      text: "How we use cookies",
      href: "/cookies"
    }
  }
} %>