https://github.com/matronator/pingtracker
Ping Tracker is a tiny library that adds ping attribute to all <a> tags on the site with customizable list of URLs.
https://github.com/matronator/pingtracker
a-tag analytics anchor href html5 link-tracking ping statistics tracking
Last synced: 3 months ago
JSON representation
Ping Tracker is a tiny library that adds ping attribute to all <a> tags on the site with customizable list of URLs.
- Host: GitHub
- URL: https://github.com/matronator/pingtracker
- Owner: matronator
- License: mit
- Created: 2024-06-29T02:49:18.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-21T04:06:20.000Z (5 months ago)
- Last Synced: 2025-03-17T14:03:11.650Z (3 months ago)
- Topics: a-tag, analytics, anchor, href, html5, link-tracking, ping, statistics, tracking
- Language: TypeScript
- Homepage:
- Size: 417 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Ping Tracker










[](https://www.codefactor.io/repository/github/matronator/pingtracker)

Ping Tracker is a tiny library that adds `ping` attribute to all `` tags on the site with customizable list of URLs.
## Features
- 🏓 Add `ping` attribute to all `` tags automatically
- 👀 Watch for changes using `MutationObserver` to modify newly added links
- 📝 Customize the content of the `ping` tag (list of URLs)
- ⚡️ Tiny library (**2.5kB** minified, **1.1kB** gzipped)
- 📭 No dependencies
- 🌳 Tree-shakeable
- 🔥 Written in TypeScript## Installation
```
npm i ping-tracker
```## Usage
```js
import { PingTracker } from "ping-tracker";const pt = new PingTracker("https://analytics.example.com");
// Or with options
const pt = new PingTracker("https://analytics.example.com", {
hrefToQuery: false,
onlyExternal: false,
watchDOM: true,
elementsToWatch: document.body,
});
```