With data attributes
How it looks (preview)
How to call this example
<%= render "govuk_publishing_components/components/attachment_link", {
attachment: {
title: "Temporary snow ploughs: guidance note",
url: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/259634/temporary-snow-ploughs.pdf"
},
data_attributes: {
gtm: "attachment-preview"
}
} %>