No description
- JavaScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| LICENSE | ||
| link-updater.user.js | ||
| README.md | ||
ChatGPT Thread First Seen (URL Tagger)
A Tampermonkey userscript that automatically tracks the first time you visit a ChatGPT thread and appends a timestamp plus the thread's title to the URL—no page reload required.
Features
- Automatic first-visit tracking: Records the first time you visit each ChatGPT thread (Unix timestamp)
- URL tagging: Appends date, time, and sanitized thread title as query parameters
- No reload: Uses
history.replaceState()to update the URL without navigation - Persistent storage: Uses Tampermonkey's
GM_setValueandGM_getValueto store timestamps locally - SPA-aware: Monitors URL changes, title changes, and history events to detect navigation
- Clean parameter ordering: Maintains consistent query parameter order (title → date → time → timestamp)
Installation
- Install the Tampermonkey browser extension
- Click the Tampermonkey icon and select "Create a new script"
- Copy the contents of
link-updater.user.jsand paste it - Save and enable the script
- Visit ChatGPT and open any thread—the URL will automatically update with tracking parameters
Auto-Update (Optional)
To enable auto-updates, configure your Tampermonkey script manager:
- Set the
@downloadURLmetadata pointing to where you host this file - Set the
@updateURLmetadata pointing to the same location - Tampermonkey will periodically check for updates
How It Works
- Thread Detection: Recognizes ChatGPT thread URLs (pattern
/c/<thread-id>) - First-Visit Tracking: Stores the first visit timestamp in browser storage with key
cg_thread_first_seen_v1 - Title Extraction: Reads the current page title and sanitizes it:
- Replaces spaces with hyphens
- Removes non-alphanumeric characters (except hyphens)
- Removes leading/trailing hyphens
- URL Update: Appends four query parameters:
title: Sanitized thread titlefirst_seen_date: Date inYYYY-MM-DDformatfirst_seen_time: Time inHH.MMformatfirst_seen_timestamp: Unix timestamp (seconds)
- History Hooks: Intercepts
history.pushState()andhistory.replaceState()to detect navigation and re-run tagging
Storage
The script stores data using Tampermonkey's sandboxed storage (per-domain):
{
"thread-id-1": { "first_seen_unix_s": 1697000000 },
"thread-id-2": { "first_seen_unix_s": 1697100000 }
}
To clear stored timestamps, open Tampermonkey's dashboard → Storage → delete the cg_thread_first_seen_v1 key.
Requirements
- Tampermonkey extension (browser: Chrome, Firefox, Edge, Safari)
- ChatGPT access at
https://chatgpt.com/
Compatibility
- Chromium-based browsers: Chrome, Edge, Brave, Opera (with Tampermonkey)
- Firefox: With Tampermonkey extension
- Safari: With Tampermonkey extension
Usage Example
- Visit:
https://chatgpt.com/c/abc123xyz - The script detects the thread ID and first visit
- URL automatically becomes:
https://chatgpt.com/c/abc123xyz?title=How-to-learn-Python&first_seen_date=2026-10-20&first_seen_time=14.35&first_seen_timestamp=1729432500 - Visiting the same thread again later will preserve the original first-visit timestamp
License
MIT License
Author
Created with assistance from ChatGPT.