1. Component Guide
  2. Subscription links
  3. With tracking
Subscription links example

With tracking

Data attributes can be passed for each link as shown.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/subscription_links", {
  email_signup_link: "/foreign-travel-advice/singapore/email-signup",
  email_signup_link_data_attributes: {
    track_category: "email_link_category",
    track_action: 1.1,
    track_label: "email_link_label",
    track_options: {
      dimension28: 1,
      dimension29: "dimension29EmailLink"
    }
  },
  feed_link_box_value: "https://www.gov.uk/government/organisations/attorney-generals-office.atom",
  feed_link_data_attributes: {
    track_category: "feed_link_category",
    track_action: 1.2,
    track_label: "feed_link_label",
    track_options: {
      dimension28: 7,
      dimension29: "dimension29feedLink"
    }
  }
} %>