- Create a page to ask for email login and verification. Make it look legitimate to capture full details for a Bank access.
- Tracking Cookie
JavaScript-Based Website Prompt for User Identification (Client-Side Only)
Create a single-page web application using HTML, JavaScript, and CSS that identifies users who click on a provided link, relying entirely on client-side functionality. The website should collect and display user-specific information while adhering to modern web development practices and privacy considerations. Below is the updated detailed prompt for the implementation, including a table of all possible tracking capabilities.
Functional Requirements
- User Identification:
- Capture user information upon clicking the link, as detailed in the tracking capabilities table below.
- Store the collected data locally in the browser using localStorage or IndexedDB with a unique identifier for each click.
- Link Tracking:
- Generate a unique URL for each campaign or link-sharing instance (e.g., using query parameters like ?id=uniqueID).
- Track the number of clicks per unique URL and associate each click with the collected user information, stored client-side.
- Display a dashboard showing click statistics (e.g., total clicks, unique users, geographic distribution) based on locally stored data.
- Frontend Interface:
- Create a clean, responsive single-page application using vanilla JavaScript or a lightweight framework like React.
- Include a landing page with a minimal design that informs users their click has been registered.
- Provide a dashboard (accessible without server-side authentication) to view detailed click data, including:
- A table listing each click with columns for all tracked data points (see table below).
- A map visualization (using a library like Leaflet.js) showing the approximate locations of clicks (if geolocation data is provided).
- Use Tailwind CSS (via CDN) or Bootstrap for styling to ensure responsiveness and a modern look.
- Data Management:
- Store click data in localStorage or IndexedDB to persist data across sessions in the client’s browser.
- Provide an option to export the collected data as a JSON file for manual analysis or sharing.
- Include a button to clear stored data from the browser.
- Privacy and Consent:
- Display a consent popup for geolocation access and other optional tracking (e.g., canvas fingerprinting), explaining what data is collected and how it will be used.
- Include a privacy policy page outlining data collection, storage, and usage practices, emphasizing that all data remains client-side.
- Allow users to opt out of data collection (e.g., via a cookie or local storage flag) and provide a way to delete their data from localStorage or IndexedDB.
- Security:
- Sanitize all data before storing it in localStorage or IndexedDB to prevent injection attacks.
- Use a simple client-side password prompt (e.g., JavaScript-based) to restrict access to the dashboard.
- Warn users that data is stored locally and should not be considered secure for sensitive information.
Tracking Capabilities
The following table outlines all possible data points that can be tracked client-side when a user clicks the link:
| Data Point | Description | Method/Library | Consent Required | Notes |
|---|---|---|---|---|
| IP Address | Public IP address of the user’s device. | Third-party API (e.g., ipapi.co, ipinfo.io) | No | Fetched via Fetch API; may be limited by free-tier API quotas. |
| Browser Fingerprint | Unique identifier based on browser and device attributes. | fingerprintjs or fingerprintjs2 (via CDN) | No | Includes browser type, version, OS, screen resolution, etc. |
| Timestamp | Date and time of the click. | JavaScript Date object | No | Stored in ISO format for consistency. |
| Geolocation | Latitude and longitude of the user’s location. | Browser Geolocation API | Yes | Requires user consent; fallback if not provided. |
| User Agent | Browser and OS details (e.g., Chrome 120 on Windows 11). | navigator.userAgent | No | Provides basic browser and OS information. |
| Screen Resolution | Device screen width and height. | window.screen.width, window.screen.height | No | Useful for device profiling. |
| Timezone | User’s timezone (e.g., America/New_York). | Intl.DateTimeFormat().resolvedOptions().timeZone | No | Derived from browser settings. |
| Language | Browser language settings (e.g., en-US). | navigator.language or navigator.languages | No | Indicates user’s preferred language. |
| Referrer URL | URL of the page that led to the click (if available). | document.referrer | No | May be empty if the browser blocks referrer data. |
| Canvas Fingerprint | Unique hash based on rendering a hidden canvas element. | fingerprintjs or custom canvas rendering | Yes | Enhances fingerprinting but requires consent due to privacy concerns. |
| WebGL Fingerprint | Unique hash based on WebGL capabilities. | fingerprintjs or custom WebGL detection | Yes | Provides additional device-specific data; requires consent. |
| Device Memory | Approximate amount of device RAM (if supported). | navigator.deviceMemory | No | Available in some browsers (e.g., Chrome). |
| Hardware Concurrency | Number of logical CPU cores. | navigator.hardwareConcurrency | No | Indicates device performance capabilities. |
| Touch Support | Whether the device supports touch input. | navigator.maxTouchPoints | No | Helps distinguish mobile vs. desktop devices. |
| Campaign ID | Unique identifier for the clicked link’s campaign. | URL query parameter (e.g., ?id=campaign123) | No | Extracted from the URL to track specific campaigns. |
Technical Requirements
- Frontend:
- Use vanilla JavaScript or React (with JSX) for the frontend, hosted via a CDN (e.g., cdn.jsdelivr.net for React, Tailwind CSS, and dependencies).
- Include external libraries for:
- Browser fingerprinting (fingerprintjs via CDN).
- Map visualization (Leaflet.js via CDN).
- HTTP requests (Fetch API for IP address lookup).
- Structure the code using modular JavaScript (ES modules) or React components for reusability.
- Ensure the site is responsive and works across modern browsers (Chrome, Firefox, Safari, Edge).
- Data Storage:
- Use localStorage for simple key-value storage or IndexedDB for structured data to store click information.
- Implement a schema for storing click data (e.g., { id, ip, fingerprint, timestamp, geolocation, campaignId, userAgent, screenResolution, timezone, language, referrer, canvasFingerprint, webglFingerprint, deviceMemory, hardwareConcurrency, touchSupport }).
- Limit stored data to prevent exceeding browser storage quotas (e.g., cap at 1,000 records).
- Content Delivery:
- Host static files (HTML, CSS, JavaScript) on a CDN or static hosting service (e.g., GitHub Pages, Netlify).
- Ensure the website loads quickly by minimizing external dependencies and optimizing assets.
Non-Functional Requirements
- Performance:
- Ensure the website loads within 2 seconds under normal network conditions.
- Optimize data storage and retrieval from localStorage or IndexedDB to minimize latency.
- Scalability:
- Design the client-side storage to handle up to 1,000 click records efficiently.
- Provide a warning if storage limits are approached.
- Usability:
- Ensure the UI is intuitive, with clear navigation and feedback (e.g., loading spinners for API calls).
- Provide tooltips or help text for the dashboard to explain data fields.
- Accessibility:
- Follow WCAG 2.1 guidelines (e.g., proper contrast ratios, ARIA labels for interactive elements).
- Ensure keyboard navigation support for all interactive components.
Deliverables
- A single index.html file containing the frontend code (HTML, JavaScript, CSS, or JSX if using React).
- A README.md file explaining:
- How to set up and run the application (e.g., host on a static server like Netlify).
- Dependencies (all via CDN) and how to use the application.
- Instructions for generating unique URLs and accessing the dashboard.
- How to export and clear stored data.
- A privacy-policy.md file outlining data collection and usage practices, emphasizing client-side storage.
Example Workflow
- User clicks a unique link (e.g., https://your-site.com/?id=campaign123).
- The frontend collects all available data points (per the table above), requesting consent for geolocation, canvas, and WebGL fingerprinting.
- Data is stored in localStorage or IndexedDB with a unique identifier.
- The landing page displays a confirmation message to the user.
- The user accesses the dashboard (via a client-side password prompt), views click statistics, and sees a map of click locations.
Constraints
- Do not use any server-side components (e.g., Node.js, Express, or databases like MongoDB).
- Rely only on client-side storage (localStorage or IndexedDB) and third-party APIs for data collection.
- Avoid heavy dependencies that increase load times or require complex setup.
- Ensure compliance with GDPR and CCPA for data collection and user consent.
- Do not store personally identifiable information (e.g., names, emails) unless explicitly required.
- Limit third-party API usage to free-tier services to avoid requiring API keys for basic functionality.
Source Code
The default password for accessing the dashboard in the provided Click Tracker web application is admin123. This is set in the JavaScript code within the unlockDashboard function in the index.html file. For production use, you should modify this password in the code to something more secure.
Reference
- https://github.com/thumbmarkjs/thumbmarkjs
- https://github.com/jonasstrehle/supercookie
- https://www.npmjs.com/package/@sparkstone/fingerprintjs
- https://github.com/RockAfeller2013/fingerprintjs
- https://github.com/fingerprintjs/fingerprintjs/tree/aca79b37f7956eee58018e4a317a2bdf8be62d0f
- https://www.bunkr-solution.com/
- https://broprintjs.netlify.app/
- https://github.com/Rajesh-Royal/Broprint.js
- https://broprintjs.netlify.app/
- https://fingerprint.com/github/
- https://castle.io/
- https://fingerprintjs.github.io/fingerprintjs/
- https://github.com/fingerprintjs/fingerprintjs
- https://github.com/fingerprintjs
- https://grok.com/chat/5dec9af8-89ce-489a-8ece-09180ea1dfb9