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: {
        an_attribute: "some_value1"
      }
    },
    no: {
      text: "No",
      data_attributes: {
        an_attribute: "some_value2"
      }
    },
    cookie_preferences: {
      text: "How we use cookies",
      href: "/cookies"
    }
  }
} %>