Bart Veneman

Creator of Project Wallace, analytics for CSS. <noscript>-fanboy. Serverless clearfix engineer. I can lift node_modules twice my own weight.

Ping attribute on anchor tag

🤓 TIL about the "ping" attribute on <a> tags, which will send a POST request to the given URLs when the anchor is clicked.

🔗 https://t.co/1BP30xMR1l pic.twitter.com/gXPFPDIz8u

— Sven (@svenluijten) February 20, 2021

Docs on MDN

<a href="some-url" ping="/track?param=x&value=1"> Click me </a>

<!-- Space separated for multiple trackers -->
<a href="some-url" ping="/tracker-1 /tracker-2"> Click me </a>

Tags