A votive custom
The Lam Museum of Anthropology at Wake Forest University traces Mexican milagros to a votive custom of Iberia and medieval Spain: small metal body parts were pinned to the image of a saint, as a request or as thanks.
To verify: An early dated example or text for the custom in Spain