1. Component Guide
  2. Single page notification button
  3. With data attributes
Single page notification button example

With data attributes

The component accepts data attributes (for example, for analytics)

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/single_page_notification_button", {
  base_path: "/current-page-path",
  data_attributes: {
    test_attribute: "testing",
    track_label: "/current-page-path",
    track_action: "Subscribe-button",
    track_category: "Single-page-notification-button",
    button_location: null
  }
} %>