Counter

A graphical hit counter that creates counter images in-lined into your page without Server Side Includes. One of the most iconic scripts from the early web era.

Perl v1.1.1 FLY Graphics Legacy

Quick Info

  • Version: 1.1.1
  • Released: April 25, 1996
  • Era: 1990s Classic
  • Language: Perl 5+
  • Requires: FLY Graphics Library
  • License: Free for use

Overview

Counter creates a graphical hit counter in-lined into your page without Server Side Includes. Unlike text-based counters, this script generates actual images showing your page hit count using customizable digit graphics.

Key Features

  • Graphical digit display using customizable digit images
  • No Server Side Includes required
  • Access logging with detailed visitor information
  • Referer validation for security
  • Customizable frame and transparency options
  • HTML formatted log viewer included

Package Contents

counter.plMain counter program
count.txtCounter data file
access_logVisitor access log
error_logError log file
html_log.plHTML log formatter
bad_referer.gifError image

Historical Context

"Hit counters were the universal status symbol of the early web. Every webmaster proudly displayed their visitor count, often with elaborate animated digit designs."

The CGI Script Archive Era

Counter was part of a popular script collection from the mid-1990s. These free Perl CGI scripts powered millions of websites in the late 1990s, becoming popular tools for webmasters who wanted dynamic features without programming knowledge.

Why Hit Counters Mattered

  • Social proof: High visitor counts attracted more visitors
  • Monetization: Advertisers paid based on "eyeballs"
  • Bragging rights: Webmasters competed for highest counts
  • No alternatives: Google Analytics didn't exist until 2005

The Decline of Hit Counters

Hit counters fell out of favor in the early 2000s due to:

  • Emergence of sophisticated analytics (Google Analytics, 2005)
  • Easy manipulation and fake counts
  • Bots and crawlers inflating numbers
  • Professional web design moving away from visible counters
  • Privacy concerns about tracking visitors

Fun Fact

Some websites in the 1990s displayed counters starting at arbitrary high numbers (like 100,000) to appear more popular. This practice was so common it became a running joke in web design circles.

Modern Alternatives (2024)

Today's visitor tracking has evolved far beyond simple hit counters. Modern analytics provide detailed insights while respecting user privacy.

Privacy-Focused Analytics

Plausible Analytics

Lightweight, privacy-friendly analytics. Script is 75x smaller than Google Analytics. GDPR compliant, no cookies required.

From $9/mo Open Source Self-hostable
Umami

Open source, easy-to-use Google Analytics alternative. Free tier available, easy self-hosting with Docker.

Free Tier Open Source Next.js
Fathom Analytics

Simple, privacy-first analytics. No cookies, GDPR compliant. Canadian company with strong privacy focus.

From $14/mo SaaS Only

Full-Featured Analytics

Google Analytics 4

Industry standard with powerful features. Free for most sites. Requires cookie consent in EU.

Free Requires Consent
Matomo (Piwik)

Powerful open source analytics platform. Full Google Analytics feature parity. Self-hosted or cloud.

Open Source Self-hostable Cloud from €19/mo
GoatCounter

Simple, privacy-aware counter. Free for non-commercial use. Shows a visible counter if desired!

Free (non-commercial) Open Source

Simple Visible Counters (Retro Style)

StatCounter

Free visible counter with detailed stats. Still supports classic counter images.

Free
Counter.dev

Privacy-focused, open source counter. Simple embed, no tracking.

Free
Free Hit Counter

Classic style hit counters with various digit designs. Nostalgia-friendly!

Free

Comparison: Then vs Now

Feature 1996 Counter Modern Analytics
Data collectedPage views onlyViews, sessions, paths, events
User identificationIP onlyCookies or cookieless hashing
Real-time dataNoYes
Geographic dataNoCountry, city, region
Device infoNoBrowser, OS, screen size
Referrer trackingBasicFull attribution
Server requirementsPerl + GD/FLYJavaScript snippet
Privacy complianceN/AGDPR, CCPA options
CostFree (self-hosted)Free to $50+/mo

Installation (Legacy)

Step 1: Install FLY

The FLY program provides an interface to the GD graphics library. It compiles on SunOS, OSF 3.2, and most Unix systems.

Step 2: Upload Files

  • counter.pl → CGI-bin directory
  • count.txt → Data directory (writable)
  • Digit images (0.gif - 9.gif) → Images directory

Step 3: Set Permissions

chmod 755 counter.pl
chmod 666 count.txt
chmod 666 access_log

Step 4: Configure Variables

Edit counter.pl and set paths, referer validation, and display options.

Step 5: Add to Your Page

<!-- Basic usage -->
<img src="/cgi-bin/counter.pl" alt="Visitor Counter">

<!-- As background (creative use!) -->
<body background="/cgi-bin/counter.pl">

Configuration Options

Variable Description Example
$basedir Base directory for counter files /home/user/counter/
$count_file File storing the count count.txt
$digit_dir Directory with digit images /images/digits/
$fly_path Path to FLY executable /usr/local/bin/fly
@referers Allowed referer domains ('yourdomain.com')
$log_access Enable access logging 1 (on) or 0 (off)

Download

Download the Counter script package:

Additional Resources

Frequently Asked Questions

Common issues include:

  • FLY not installed: The script requires the FLY graphics library
  • Permissions: Ensure counter.pl is executable (755) and count.txt is writable (666)
  • Path issues: Check that all paths in configuration are correct
  • Referer check: Your domain must be in the @referers array

In the 1990s, sites like GifWorks offered thousands of animated digit sets. Today you can:

  • Search for "counter digits GIF" on archive.org
  • Create your own using any graphics program
  • Use CSS counters for a modern approach

Visible counters persist for several reasons:

  • Nostalgia: Retro web design is experiencing a revival
  • Transparency: Shows visitors you track minimal data
  • Social proof: Popular blogs still benefit from visible counts
  • Simplicity: Services like GoatCounter make it easy

We recommend modern alternatives for production use because:

  • Modern analytics provide much richer data
  • Privacy-focused options (Plausible, Umami) are easy to set up
  • The FLY library is difficult to find and compile today
  • Server-side image generation adds unnecessary load

This script is preserved for historical interest and learning purposes.

FeatureCounterTextCounter
OutputGIF imagePlain text/SSI
RequirementsFLY + GDPerl only
CustomizationDigit imagesCSS styling
Server loadHigherLower

View All FAQs | Counter FAQ Archive

Related Scripts

TextCounter Perl

Simple text-based counter using SSI. No graphics library required.

Book 'em Dan-O Perl

Visitor logging without visible counter. Tracks detailed access info.

Guestbook Perl

Let visitors leave comments on your site.

Counter Examples

See modern analytics alternatives and implementation guides.

Back to Scripts TextCounter