Skip to content

GPT Stats is a lightweight Chrome extension that tracks ChatGPT usage effortlessly. It automatically measures the time you spend, counts your prompts, and displays useful usage statistics.

Notifications You must be signed in to change notification settings

fchavonet/chrome_extension-gpt_stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPT Stats

Description

GPT Stats is a lightweight Chrome extension that tracks ChatGPT usage effortlessly. It automatically measures the time you spend, counts your prompts, and displays useful usage statistics, all in a clean and minimal popup interface.

All data is stored locally in your browser using chrome.storage.local, ensuring full control, offline compatibility, and compliance with modern extension security standards.

Whether you're curious about your productivity, want to better understand your usage habits and environmental impact, or just love data, GPT Stats gives you clear insights without compromising performance or privacy.

Objectives

  • Track the time spent on ChatGPT.
  • Count the number of prompts sent.
  • Provide a visual dashboard using Chart.js.
  • Estimate water consumption based on usage patterns.
  • Persist usage data across browser sessions.
  • Ensure everything works offline, locally, with no external dependencies.

Tech Stack

HTML5 badge CSS3 badge JavaScript badge JSON badge Chrome badge

File Description

FILE DESCRIPTION
assets Contains the resources required for the repository.
manifest.json Chrome manifest file (V3) that declares extension metadata.
background.js Background service worker, manages session timing.
popup Contains the popup interface: popup.html, popup.css, and popup.js.
scripts Placeholder for extra logic or utility functions.
libs Contains local dependencies.
images Folder containing icons or UI images.
README.md The README file you are currently reading 😉.

Installation & Usage

Installation

  1. Clone this repository:
    • Open your preferred Terminal.
    • Navigate to the directory where you want to clone the repository.
    • Run the following command:
git clone https://github.com/fchavonet/chrome_extension-gpt_stats.git
  1. Open a Chromium-based browser (Brave, Edge, Google Chrome...) and navigate to:
chrome://extensions/
  1. Enable Developer Mode (top-right corner).

  2. Click on "Load unpacked" and select the project folder.

  3. The extension should now appear in your extensions menu.

You can pin it to your browser toolbar via your extensions menu.

Usage

  1. Open ChatGPT in your browser.

  2. The extension will automatically start tracking your usage time.

  3. Each prompt you send is counted in real time.
    ( ⚠️ Make sure you're logged into your OpenAI account for prompt tracking to work! ⚠️ )

  4. Click the extension icon to open the popup and view your usage statistics.

  5. All data is stored locally and will persist across browser restarts.

  6. If you just want to test the extension without waiting, you can inject some mock data using the script below.

Click here to see the code.
(function simulateUsageHistory() {
    const now = new Date();
    const dailyUsage = {};
    const dailyPromptCount = {};

	for (let i = 0; i < 185; i++) {
		const date = new Date();
		date.setDate(now.getDate() - i);

		const yyyy = date.getFullYear();
		const mm = String(date.getMonth() + 1).padStart(2, "0");
		const dd = String(date.getDate()).padStart(2, "0");

		const key = `${yyyy}-${mm}-${dd}`;

		const seconds = Math.floor(Math.random() * (90 - 5 + 1) + 5) * 60;
		dailyUsage[key] = seconds;

		dailyPromptCount[key] = Math.floor(Math.random() * 30) + 1;
	}

	const totalPrompt = Object.values(dailyPromptCount).reduce((a, b) => a + b, 0);

	chrome.storage.local.set({
		dailyUsage: dailyUsage,
		dailyPromptCount: dailyPromptCount,
		promptUsage: totalPrompt
	}, () => {
		console.log("✅ Simulated 6 months of usage data successfully injected.");
	});
})();

Right-click the opened extension → Inspect → open the Console tab, then paste and run the code.

You can also install the Chrome extension directly from the Chrome Web Store by clicking here.

Desktop screenshot

What's Next?

  • Implement CSV export of usage data.
  • Improve or redesign the mobile layout.
  • Add additional usage metrics.
  • Explore Firefox support.

Thanks

  • A big thank you to my friends Pierre and Yoann, always available to test and provide feedback on my projects.

Author(s)

Fabien CHAVONET

About

GPT Stats is a lightweight Chrome extension that tracks ChatGPT usage effortlessly. It automatically measures the time you spend, counts your prompts, and displays useful usage statistics.

Topics

Resources

Stars

Watchers

Forks