Free PHP script

Click Counter

A private, self-hosted click and download counter for ordinary websites.

Create clean tracking URLs, count redirects and download starts, view simple stats, and show public counters from your own hosting. No database, no Composer, no framework, no cloud account.

  • PHP 8.2+
  • Flat-file JSON
  • Apache friendly
  • Private admin
Dashboard
24Active links
8,431Total clicks
146Today
summer-sale302 redirect1,204
free-guideprotected download678
hosting-offeraffiliate link423

No SQL databaseUpload, configure, and go.

Safe redirectsPublic URLs only resolve stored slugs.

Privacy mindedNo third-party analytics or tracking pixels.

What it does

Simple tracking without turning your site into an analytics project

Clean branded URLs

Turn long URLs into memorable paths like /go/summer-sale or /download/free-guide.

Click and download counts

Count valid redirects, external download starts, and protected local downloads streamed through PHP.

Useful admin dashboard

See total clicks, daily counts, recent activity, link status, expiration, limits, and diagnostics.

Public counter embeds

Show a public count on another page with a small local JavaScript file and a simple HTML snippet.

Backups and exports

Create JSON backups, restore data, run maintenance, and export CSV reports with safer spreadsheet values.

Built for shared hosting

Plain PHP, local assets, Apache rewrite rules, query-string fallbacks, and clear setup instructions.

Good for

Everyday website links worth measuring

Click Counter is intentionally focused. It helps you answer, “How many people clicked this?” without adding a full analytics suite.

Install

Upload files, edit one config file, create your first link

  1. Upload the folder Put Click Counter on ordinary PHP hosting, such as /shed/click-counter/.
  2. Set private storage Place the storage folder outside the public web root when your host allows it.
  3. Edit config.php Set your base URL, timezone, storage paths, and administrator password hash.
  4. Generate the password hash Use /tools/generate-password.php once, paste the hash, then delete the helper.
  5. Log in and create a link Create a slug, store a destination, copy the tracking URL, and start counting.

Download Click Counter 1.0.0

Includes the PHP app, admin dashboard, public endpoints, assets, documentation, and test scripts.

Download ZIP

Included

A complete free script package

Admin dashboard Redirect endpoint Download endpoint Public counter API Counter embed JS Apache .htaccess Nginx example Backups Diagnostics Maintenance script README Security notes

FAQ

Quick answers before you install

Does Click Counter need MySQL?

No. It stores link records, daily counts, recent events, rate limits, and backups as JSON files.

Can visitors choose the redirect destination?

No. Public links only contain a stored slug. The destination is read from the private link record.

Does it track private visitor profiles?

No. By default it stores aggregate counts only. Optional referrer and device data are limited, and raw IP addresses are not stored.

Can it count local file downloads?

Yes. Protected downloads are stored with randomized filenames and streamed through PHP so the private file path is not exposed.

Is this a Bitly replacement?

No. It is for private self-hosted links on your own website, not for running a public URL-shortening service.