global-click-tracker
v1.0.1
Published
A simple click tracking library for your front-end
Downloads
12
Readme
Proje Başlığı
Bu projenin ne yaptığı ve kimin için olduğu hakkında kısa bir açıklama
Click Tracker
A simple click tracking library with support for custom data, flexible API integration, and debounce functionality.
Installation
npm install global-click-tracker
CDN
To install the package via javascript:
<script src="https://cdn.jsdelivr.net/npm/click-tracker/dist/clickTracker.bundle.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Click Tracker Example</title>
<script src="https://cdn.jsdelivr.net/npm/click-tracker/dist/clickTracker.bundle.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const clickTracker = new ClickTracker({
threshold: 10,
apiEndpoint: 'https://api.yoursite.com/clicks',
customData:{} // set custom data for click event
});
// Set custom data dynamically if you want
clickTracker.setCustomData({ userId: 67890 });
});
</script>
</head>
<body>
<h1>Click Tracker Example</h1>
</body>
</html>