Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Send tracking pings to specified URLs when a link is clicked. A transparent, declarative alternative to redirect-based or JavaScript click tracking.
The ping attribute on <a> elements sends background POST requests to one or more URLs when the link is clicked. The user navigates directly to the link's href destination while the tracking requests are sent asynchronously — no redirect delay, no JavaScript required.
Applies to: <a>
| Value | Behavior |
|---|---|
| Single URL | Sends one POST request on click |
| Space-separated URLs | Sends a POST to each URL on click |
Add one or more tracking URLs to the ping attribute. The browser sends POST requests to each URL when the link is clicked.
<!-- Single tracking URL --><a href="/products/widget" ping="/analytics/click">Widget Product Page</a> <!-- Multiple tracking URLs (space-separated) --><a href="/products/widget" ping="/analytics/click /third-party/track"> Widget Product Page</a>
Common use cases include tracking outbound links, measuring CTA effectiveness, and notifying analytics services of navigation events.
<!-- Track outbound link clicks --><nav> <a href="https://github.com/example/repo" ping="/track/outbound"> GitHub Repository </a> <a href="https://docs.example.com" ping="/track/outbound"> Documentation </a></nav> <!-- Track CTA clicks in a marketing page --><a href="/signup" ping="/analytics/cta-click?source=hero"> Start Free Trial</a>
The POST request includes headers that identify both the page the user was on and the destination they are navigating to.
<!-- When the user clicks this link: --><a href="/destination" ping="/track">Click me</a> <!-- The browser sends a POST to /track with these headers: Content-Type: text/ping Ping-From: https://example.com/current-page Ping-To: https://example.com/destination The body is the string "PING" The user navigates directly to /destination without delay -->
The ping attribute competes with two established tracking patterns: redirect URLs and JavaScript click handlers. It has advantages over both.
<!-- Redirect tracking (common but slower) --><a href="/redirect?url=https://example.com&id=123">Example</a><!-- User goes to /redirect first, then gets redirected to example.com --> <!-- JavaScript tracking (common but fragile) --><a href="https://example.com" onclick="track('click', 123)">Example</a><!-- Depends on JS loading; may miss clicks --> <!-- ping attribute (fastest, declarative) --><a href="https://example.com" ping="/track?id=123">Example</a><!-- User goes directly to example.com; ping is sent in background -->
| Approach | User Delay | Requires JS | Visible in Source | Works if JS Fails |
|---|---|---|---|---|
| Redirect tracking | Yes (extra hop) | No | URL is obscured | Yes |
| JS click handler | Minimal | Yes | Buried in scripts | No |
ping attribute | None | No | Yes (in HTML) | Yes |
Unlike JavaScript-based tracking, the ping attribute is visible in the page source. Privacy-conscious users, browser extensions, and auditing tools can see exactly which URLs receive tracking pings. This transparency was an intentional design goal of the specification.
ping attribute has no effect on accessibility. Screen readers announce the link normally based on its text content and href.ping by default. The browser.send_pings preference is false in Firefox, making the attribute unreliable for cross-browser analytics.PING — you cannot send custom data. Any context must be encoded in the URL query string.<a> elements. It does not apply to <button>, <form>, or programmatic navigation.Ping-From header is omitted in cross-origin requests when the referring page uses HTTPS and the ping URL uses HTTP (downgrade scenario).referrerpolicy — control what referrer information is sent with requestsrel — link relationship types including noopener and noreferrer<a> — the anchor element