Download the PHP package simplestats-io/php-client without Composer

On this page you can find all versions of the php package simplestats-io/php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-client

PHP Client for SimpleStats.io

Latest Version on Packagist Tests Check & fix styling License

This is the official plain PHP client to send tracking data to https://simplestats.io. It works with any PHP 8.2+ application, no framework required.

For Laravel applications, use the dedicated Laravel Client instead, which provides automatic middleware, observers, and queue integration.

Introduction

SimpleStats is analytics that goes beyond simple page views. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. With server-side tracking and filtering via UTM codes, you get detailed analysis of marketing efforts and clearly see which channels drive revenue. Effortlessly evaluate ROI, identify cost-effective user acquisition channels, and pinpoint the most effective performance channels. SimpleStats is fully GDPR compliant and unaffected by ad blockers since all tracking occurs server-side.

screenshot

Installation

Quick Start

Configuration

Pass a configuration array when creating the client:

Option Type Default Description
api_token string (required) Your project API token from SimpleStats
api_url string https://simplestats.io/api/v1/ API base URL (change for self-hosted)
timeout int 5 HTTP request timeout in seconds
max_retries int 3 Number of retries on transient failures
enabled bool true Set to false to disable all tracking

When tracking is disabled, all methods return an empty array without making any HTTP requests.

Usage

Tracking Visitors

Track anonymous visitors with optional UTM parameters and metadata:

Tracking User Registrations

Tracking Logins

Tracking Payments

Amounts must be in cents (e.g., 2000 = $20.00). Currency must be ISO 4217 (EUR, USD, GBP, etc.).

Associate a payment with either a user or a visitor:

Tracking Custom Events

Tracking Data

The TrackingData class holds visitor metadata (IP, user agent, UTM parameters, referer, page entry).

Auto-extract from the current request

This automatically extracts:

Build manually

Visitor Hash Generator

Generate GDPR-compliant anonymized visitor identifiers. The hash rotates daily to prevent long-term tracking.

The generator creates a SHA-256 hash from IP + User-Agent + date + secret key, truncated to 32 characters. The daily date rotation ensures hashes are not persistent across days, keeping visitor tracking fully anonymous.

Error Handling

The client throws specific exceptions you can catch:

The HTTP client automatically retries on transient failures (connection errors, 429, 5xx) with exponential backoff.

Performance: Non-Blocking Tracking

By default, all tracking calls are synchronous and block the current request. In production, you should avoid adding latency to your user-facing responses. Here are a few strategies:

Testing

Documentation

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of php-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package simplestats-io/php-client contains the following files

Loading the files please wait ...