Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 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 (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T07:53:18.000Z (4 months ago)
- Last Synced: 2024-10-11T19:49:04.387Z (3 months ago)
- Topics: a-tag, analytics, anchor, href, html5, link-tracking, ping, statistics, tracking
- Language: TypeScript
- Homepage:
- Size: 243 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
![Ping Tracker logo](https://raw.githubusercontent.com/matronator/PingTracker/main/.github/ping-tracker.png)
![NPM Version](https://img.shields.io/npm/v/ping-tracker)
![NPM Downloads](https://img.shields.io/npm/dw/ping-tracker)
![npm TypeScript version](https://img.shields.io/npm/dependency-version/ping-tracker/dev/typescript)
![Tree shaking](https://badgen.net/bundlephobia/tree-shaking/ping-tracker)
![Dependencies](https://badgen.net/bundlephobia/dependency-count/ping-tracker)
![npm package minimized gzipped size](https://img.shields.io/bundlejs/size/ping-tracker)
![Commits](https://badgen.net/github/commits/matronator/PingTracker)
![Issues](https://img.shields.io/github/issues/matronator/PingTracker.svg)
![License](https://img.shields.io/github/license/matronator/PingTracker.svg)
[![CodeFactor](https://www.codefactor.io/repository/github/matronator/pingtracker/badge)](https://www.codefactor.io/repository/github/matronator/pingtracker)
![Follow](https://img.shields.io/github/followers/matronator.svg?style=social&label=Follow&maxAge=2592000)
![GitHub Sponsors](https://img.shields.io/github/sponsors/matronator)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,
});
```