0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Hyperlink auditing: when a link is followed, the browser POSTs a small notification to each listed URL while it navigates. Firefox ignores it by default.
Overview
The pingattribute lists URLs to notify when the user follows a link. The browser navigates straight to the link's href and, in parallel, sends a POST to each ping URL. There is no redirect hop and no script. Because the tracking URL is in the markup, users and extensions can see it, which was the point of the design.
Applies to:<a> and <area> elements that have an href.
There is no live demo: the ping is a background request that only shows up in DevTools (Network panel, type "ping"), and it needs a server to receive it. The examples show the markup and what is sent.
Values
Value
Behaviour
One URL
One POST when the link is followed.
Space-separated URLs
One POST to each.
Absent or empty
No pings.
Relative URLs resolve against the document. URLs that are not http: or https: are skipped, and so is everything if the href cannot be parsed.
Examples
Outbound link tracking
ping on links
12345
<ahref="https://github.com/profpowell/vanilla-breeze"ping="/api/click?to=github">Source on GitHub</a><!-- Several endpoints --><ahref="/pricing"ping="/api/click?cta=hero https://stats.example.net/hit">See pricing</a>
POST /api/click?to=github HTTP/1.1Content-Type: text/pingPing-To: https://github.com/profpowell/vanilla-breezePing-From: https://vanilla-breeze.com/docs/ (only in some cases, see below)Cookie: ... (credentials are included)PING
Situation
Headers
Ping URL is same-origin with the page
Ping-From and Ping-To
Ping URL is cross-origin, page is not HTTPS
Ping-From and Ping-To
Ping URL is cross-origin, page is HTTPS
Ping-To only
Pings never carry a Referer header. The body is always the string PING: put any context you need in the ping URL's query string.
In Vanilla Breeze
Analytics sets it for you. When VB analytics is enabled, it adds ping to outbound a[href^="http"] links (pointing at its click endpoint) unless the link already has one or sits inside [data-vb-no-track], and falls back to navigator.sendBeacon() in Firefox and Brave, where ping is off. See src/lib/analytics.js and data-vb-no-track. Analytics is off inside iframes, so the demos on this site never get it.
The sanitiser removes it.src/lib/sanitize-html.js drops ping from untrusted HTML (markdown, comments, chat) in every profile, so user content cannot add tracking beacons.
Not the same as <markdown-viewer ping>. That is a component attribute: the viewer sends render metadata with sendBeacon after loading. It is unrelated to link auditing.
Accessibility
The attribute does not change how the link is announced or activated. Keyboard activation sends the ping just like a click.
Security
It is tracking. Tell users in your privacy policy, and do not add ping for visitors who have opted out: the browser sends it whenever the attribute is present.
Cookies are sent. Ping requests use credentials mode include, so a third-party ping URL receives that site's cookies (subject to the browser's third-party cookie blocking).
Strip it from user content. Untrusted HTML with ping can make your readers notify someone else's server; VB's sanitiser removes it.
Browser support
Chrome 12 and Safari 6 send pings. Firefox has the attribute but does nothing unless the user enables browser.send_pings; Brave and many content blockers also suppress pings (MDN browser-compat-data, November 2026). Treat ping as best-effort and pair it with navigator.sendBeacon() where counts matter.
Gotchas
Only followed links. No ping for <button>, form submissions, window.open() or location changes.
Responses are ignored. The browser discards the response body; the endpoint should reply quickly with 204.
Related
referrerpolicy — how much of the page URL a navigation reveals.